Embed the source Git revision in future Mercurius generations #1
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
The Mercurius asset-roster pilot records the active NixOS generation separately from a pinned
nixos-configGit commit. The current remotemainflake definesnixosConfigurations.mercuriusbut does not explicitly setsystem.configurationRevision; a generation store path alone does not establish which commit was used for deployment. We should make future generations report their source revision without claiming this retroactively fixes existing generations.Related pilot decision: pti/infrastructure-asset-register#11
Proposed work
nixos-configflake's Mercurius NixOS module, setsystem.configurationRevisionfrom the top-level flake's clean Git revision (for example,self.rev or null). Do not substitutedirtyRev, the current checkout HEAD at inspection time, or thenixpkgsinput revision as though it identified the committed system source./run/current-systempath; read the revision from the active generation (for example,/run/current-system/sw/bin/nixos-version --configuration-revision). Distinguish an embedded revision/output-path match from authenticated evidence of the historical deployment action.nixos-rebuild switch; do not change the live host merely to backfill pilot evidence.Acceptance criteria
nixosConfigurations.mercurius.config.system.configurationRevisionyields the expected full top-level flake commit SHA; a dirty/uncommitted evaluation cannot misleadingly report that SHA as covering uncommitted changes.Reference: NixOS's
system.configurationRevisionoption is the Git revision of the top-level flake and defaults tonull: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/misc/version.nix