diff options
author | Katharina Fey <kookie@spacekookie.de> | 2019-12-01 21:06:12 +0100 |
---|---|---|
committer | Katharina Fey <kookie@spacekookie.de> | 2019-12-01 21:06:12 +0100 |
commit | 546bb774517a2c56254472fc5a84f476d9875ef5 (patch) | |
tree | a92d8e746788dc431d95bc28b37333dfe7e94a66 /build | |
parent | 2c5d6d5d13348980ae202ba3dd8716d64c4d82fc (diff) |
<>: build now properly activates generations
Diffstat (limited to 'build')
-rwxr-xr-x | build | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -2,21 +2,22 @@ set -eo pipefail +HOST=$(hostname) DIR=$(realpath $(dirname $0)) -D=$(mktemp -du) -ROOT="$DIR/roots/uwu.nix" +OUT=$(mktemp -du) +ROOT="$DIR/roots/$HOST.nix" echo Active tree: $DIR ## Build the libkookie tree function build { NIXPKGS_ALLOW_UNFREE=1 \ - nix build -f '<nixpkgs/nixos>' config.system.build \ + nix build -f '<nixpkgs/nixos>' system \ -I nixos-config="$ROOT" \ -I "nixpkgs=$DIR/nixpkgs" \ -I "nixpkgs-overlays=$DIR/overlays" \ -I "home-manager=$DIR/home-manager" \ - --out-link "$D" $ARGV + --out-link "$OUT" $ARGV } ## Build and output build path for debugging @@ -29,13 +30,14 @@ function debug { ## Build and switch to the new configuration (requires root) function switch { build $ROOT - $D-18/bin/switch-to-configuration switch + nix-env -p /nix/var/nix/profiles/system --set "$OUT" + $OUT/bin/switch-to-configuration switch } case "$1" in -s* | --switch*) shift; switch ;; -d* | --debug*) shift; debug ;; - *) shift; build ;; + *) build ;; esac -rm -rf $D* +rm -rf $OUT* |