1
0
Fork 0

Revert "Don’t see nixos label"

This reverts commit 2dc2b1e6dd.
This commit is contained in:
Malte 2023-03-06 18:30:14 +01:00
parent a1f7a4695c
commit 9834eba614

View file

@ -7,12 +7,19 @@
inherit (config.m-0) hosts;
inherit (config.networking) hostName;
inherit (pkgs.flake-inputs.self) sourceInfo;
s = builtins.substring;
formatDate = date: "${s 0 4 date}-${s 4 2 date}-${s 6 2 date}-${s 8 2 date}:${s 10 2 date}";
in {
imports = [
../../common
./admin.nix
];
system = {
configurationRevision = sourceInfo.rev or null;
nixos.label =
if sourceInfo ? shortRev
then "${formatDate sourceInfo.lastModifiedDate}-${sourceInfo.shortRev}"
else "${formatDate sourceInfo.lastModifiedDate}-dirty";
systemBuilderCommands = lib.mkIf (sourceInfo ? rev) ''
echo ${sourceInfo.rev} > $out/config-commit
'';