system/moudule.nix: add machine-id

This commit is contained in:
Charlie Root 2024-11-01 13:50:12 +01:00
commit f6338803b1
Signed by: faukah
SSH key fingerprint: SHA256:jpYIt4Vkz1NBTQcks/N9OPTfTFxE6KF2W/rV7hrfrIw

View file

@ -1,4 +1,6 @@
{
{config, ...}: let
machine-id = builtins.substring 0 23 (builtins.hashString "sha256" config.networking.hostName);
in {
system = {
# faster rebuilds
switch = {
@ -8,4 +10,5 @@
# our state version
stateVersion = "23.11";
};
environment.etc."machine-id".text = "${machine-id}\n";
}