diff --git a/system/default.nix b/system/default.nix index 269b554..ce7c693 100644 --- a/system/default.nix +++ b/system/default.nix @@ -9,5 +9,6 @@ ./security.nix ./services.nix ./users.nix + ./label.nix ]; } diff --git a/system/label.nix b/system/label.nix new file mode 100644 index 0000000..36e5cd6 --- /dev/null +++ b/system/label.nix @@ -0,0 +1,19 @@ +{ + self, + ... +}: +let + flakeRev = if (self ? shortRev) then self.shortRev else "dirty"; + flakeMod = if (self ? lastModifiedDate) then self.lastModifiedDate else ""; + flakeRevCount = if (self ? revCount) then builtins.toString self.revCount else ""; + tagGit = "rev:" + flakeRev + ":" + flakeRevCount; + tagMod = "mod:" + flakeMod; + label = tagGit + "_" + tagMod; +in +{ + system.nixos.tags = [ + tagGit + tagMod + ]; + system.nixos.label = label; +}