commit 0a2792059af2120ff275f02f5fd174811249e495
parent 8e4597b728a9140a138e38786a221631567679b8
Author: Vincent Demeester <vincent@sbr.pm>
Date: Mon, 1 Jun 2020 16:50:53 +0200
hack/system: build before switch and add dry-build
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/hack/system b/hack/system
@@ -19,6 +19,16 @@ function set_work_dir() {
fi
}
+function dry-build() {
+ [ "$#" -eq 0 ] || error "build"
+ set_work_dir
+ local machine
+ machine="$(hostname)"
+ unset NIX_PATH
+ nix-build --dry-run --out-link "$WORK_DIR" -A "$machine" ||
+ error "Failed to build system"
+}
+
function build() {
[ "$#" -eq 0 ] || error "build"
set_work_dir
@@ -31,6 +41,7 @@ function build() {
function switch() {
[ "$#" -eq 0 ] || error "switch"
+ build
set_work_dir
local switch_bin="$WORK_DIR/bin/switch-to-configuration"
sudo nix-env --set \