aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorKatharina Fey <kookie@spacekookie.de>2020-03-30 17:14:18 +0200
committerKatharina Fey <kookie@spacekookie.de>2020-03-30 17:14:18 +0200
commit302fca8ead2be4d5e6e4d907b578df0021d524a6 (patch)
treeb4655e23792fa6136908608af4c9df28c3fc710e /build
parent3358c7a7623909f21b0bdc5fb641af01bc011ea6 (diff)
build: fixing script issues and adding better output
Diffstat (limited to 'build')
-rwxr-xr-xbuild16
1 files changed, 8 insertions, 8 deletions
diff --git a/build b/build
index c302bacdb6a..1b04c71fb33 100755
--- a/build
+++ b/build
@@ -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"*