Add rev to label
All checks were successful
Run nix flake check / flake-check (push) Successful in 1m54s
Periodic flake update / flake-update (push) Successful in 1m40s

This commit is contained in:
Torjus Håkestad 2024-10-04 17:40:16 +02:00
parent 6b3b45f32a
commit add7bbc626
2 changed files with 20 additions and 0 deletions

View File

@ -9,5 +9,6 @@
./security.nix
./services.nix
./users.nix
./label.nix
];
}

19
system/label.nix Normal file
View File

@ -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;
}