mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-config.git
synced 2024-11-29 22:11:27 +00:00
flake: embed NixOS configuration git commit sha1 into nixos.label
This commit is contained in:
parent
3bf91c25c3
commit
5643877cc1
|
@ -22,6 +22,10 @@
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
cfgShortRev =
|
||||||
|
if self ? rev then builtins.substring 0 7 self.rev else "dirty";
|
||||||
|
nixosLabel = config:
|
||||||
|
"${cfgShortRev}.${config.system.nixos.release}.${nixpkgs.shortRev}";
|
||||||
userdata = builtins.fromJSON (builtins.readFile userdata-json);
|
userdata = builtins.fromJSON (builtins.readFile userdata-json);
|
||||||
hardware-configuration = import hardware-configuration-nix;
|
hardware-configuration = import hardware-configuration-nix;
|
||||||
in
|
in
|
||||||
|
@ -30,9 +34,14 @@
|
||||||
just-nixos = nixpkgs.lib.nixosSystem {
|
just-nixos = nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = { inherit system userdata; };
|
specialArgs = { inherit system userdata; };
|
||||||
modules = [
|
modules = [
|
||||||
|
# SelfPrivacy overlay
|
||||||
{ nixpkgs.overlays = [ selfprivacy-overlay.overlay ]; }
|
{ nixpkgs.overlays = [ selfprivacy-overlay.overlay ]; }
|
||||||
|
# machine specifics
|
||||||
hardware-configuration
|
hardware-configuration
|
||||||
|
# main configuration part
|
||||||
./configuration.nix
|
./configuration.nix
|
||||||
|
# we need to embed NixOS repository git commit sha1
|
||||||
|
({ config, ... }: { system.nixos.label = nixosLabel config; })
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue