diff options
-rwxr-xr-x | build | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -3,11 +3,11 @@ set -eo pipefail HOST=$(hostname) -DIR=$(realpath $(dirname $0)) +DIR=$(realpath "$(dirname "$0")") OUT=$(mktemp -du) ROOT="$DIR/roots/$HOST.nix" -echo Active tree: $DIR +echo Active tree: "$ROOT" ## Build the libkookie tree function build { @@ -17,21 +17,21 @@ function build { -I "nixpkgs=$DIR/nixpkgs" \ -I "nixpkgs-overlays=$DIR/overlays" \ -I "home-manager=$DIR/home-manager" \ - --out-link "$OUT" $ARGV + --out-link "$OUT" "$@" } ## Build and output build path for debugging function debug { - build $ROOT - echo "Build path: $D-18" + build "$ROOT" + echo "Build path: $OUT" exit 0 } ## Build and switch to the new configuration (requires root) function switch { - build $ROOT + build "$ROOT" nix-env -p /nix/var/nix/profiles/system --set "$OUT" - $OUT/bin/switch-to-configuration switch + "$OUT"/bin/switch-to-configuration switch } case "$1" in @@ -40,4 +40,4 @@ case "$1" in *) build ;; esac -rm -rf $OUT* +rm -rf "$OUT"* |