aboutsummaryrefslogtreecommitdiff
path: root/nixos/rebuild
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2026-10-15 07:31:36 +0200
committerMartin Fischer <martin@push-f.com>2026-10-15 07:38:55 +0200
commitd9ca24398ad71aca208c94a6399f13c46228b103 (patch)
treeadad427caa5824bc3656378f45dfa7255396bde1 /nixos/rebuild
parent1c10d56a396518562bf466fb7a7ffd8a4d054655 (diff)
feat: set system.configurationRevisionHEADmaster
Diffstat (limited to 'nixos/rebuild')
-rwxr-xr-xnixos/rebuild7
1 files changed, 7 insertions, 0 deletions
diff --git a/nixos/rebuild b/nixos/rebuild
index bb44fe8..d714977 100755
--- a/nixos/rebuild
+++ b/nixos/rebuild
@@ -25,6 +25,13 @@ if [ ! -f "$configPath" ]; then
exit 1
fi
+# Make the configuration repository's commit available to the NixOS module.
+export NIXOS_CONFIG_REVISION
+NIXOS_CONFIG_REVISION=$(git -C "$top" rev-parse --verify HEAD)
+if [[ -n $(git -C "$top" status --porcelain) ]]; then
+ NIXOS_CONFIG_REVISION+="-dirty"
+fi
+
nixpkgsPath=$(
cd "$top" &&
nix-instantiate --eval --raw \