From 372da93812b245cb89214aeb8e5f709672b427f8 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Thu, 15 Oct 2026 07:31:36 +0200 Subject: feat(common): set system.configurationRevision --- nixos/rebuild | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'nixos/rebuild') diff --git a/nixos/rebuild b/nixos/rebuild index 395f78d..3589dc4 100755 --- a/nixos/rebuild +++ b/nixos/rebuild @@ -9,6 +9,13 @@ if [ ! -d "$hostDir" ]; 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 + ( # The result symlink created in the current directory is registered as a root of the Nix # garbage collector, so it's important that we call nixos-rebuild from the host directory. -- cgit v1.3.1