diff options
author | Katharina Fey <kookie@spacekookie.de> | 2020-03-30 17:14:18 +0200 |
---|---|---|
committer | Katharina Fey <kookie@spacekookie.de> | 2020-03-30 17:14:18 +0200 |
commit | 302fca8ead2be4d5e6e4d907b578df0021d524a6 (patch) | |
tree | b4655e23792fa6136908608af4c9df28c3fc710e /build | |
parent | 3358c7a7623909f21b0bdc5fb641af01bc011ea6 (diff) |
build: fixing script issues and adding better output
Diffstat (limited to 'build')
-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"* |