From d9ca24398ad71aca208c94a6399f13c46228b103 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Thu, 15 Oct 2026 07:31:36 +0200 Subject: feat: set system.configurationRevision --- nixos/rebuild | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'nixos/rebuild') 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 \ -- cgit v1.3.1