From f7ee122c349bb1e4fbb149bb4990af2a25b77fdd Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 16 Jan 2025 21:18:25 +0000 Subject: [PATCH] modify justfile to check local flake.lock before rebuild --- justfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/justfile b/justfile index 85e173f..9b52f2b 100644 --- a/justfile +++ b/justfile @@ -11,12 +11,12 @@ update-flake-secrets: # full system rebuild from flake (stages changes and automatically detects host) rebuild-system: - git add *.nix + if [ -n "$(diff <(cat /etc/nixos/flake.lock) <(cat flake.lock))" ]; then echo "local flake.lock has diverged from system. Please update flake or rebase. Exiting" && exit 1; fi sudo nixos-rebuild switch --option eval-cache false --flake .#$(hostname) # test full system rebuild from flake (stages changes and automatically detects host) rebuild-system-test: - git add *.nix + if [ -n "$(diff <(cat /etc/nixos/flake.lock) <(cat flake.lock))" ]; then echo "local flake.lock has diverged from system. Please update flake or rebase. Exiting" && exit 1; fi sudo nixos-rebuild test --option eval-cache false --flake .#$(hostname) # updates all flake inputs for system