aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorKatharina Fey <kookie@spacekookie.de>2019-12-01 21:06:12 +0100
committerKatharina Fey <kookie@spacekookie.de>2019-12-01 21:06:12 +0100
commit546bb774517a2c56254472fc5a84f476d9875ef5 (patch)
treea92d8e746788dc431d95bc28b37333dfe7e94a66 /build
parent2c5d6d5d13348980ae202ba3dd8716d64c4d82fc (diff)
<>: build now properly activates generations
Diffstat (limited to 'build')
-rwxr-xr-xbuild16
1 files changed, 9 insertions, 7 deletions
diff --git a/build b/build
index 046a1df668a..c302bacdb6a 100755
--- a/build
+++ b/build
@@ -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*