Add rev to label
This commit is contained in:
parent
6b3b45f32a
commit
add7bbc626
@ -9,5 +9,6 @@
|
||||
./security.nix
|
||||
./services.nix
|
||||
./users.nix
|
||||
./label.nix
|
||||
];
|
||||
}
|
||||
|
19
system/label.nix
Normal file
19
system/label.nix
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user