mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-05 21:03:40 +00:00
nixos/etc: create uninitialized /etc/machine-id with readonly /etc/ (#523894)
This commit is contained in:
@@ -173,5 +173,18 @@
|
||||
|
||||
})
|
||||
|
||||
(lib.mkIf (config.system.etc.overlay.enable && !config.system.etc.overlay.mutable) {
|
||||
# Systemd requires /etc/machine-id exists or can be initialized on first
|
||||
# boot. This file should not be part of an image or system config because
|
||||
# it is unique to the machine, so it is initialized at first boot and
|
||||
# persisted in the system state directory, /var/lib/nixos.
|
||||
environment.etc."machine-id".source = lib.mkDefault "/var/lib/nixos/machine-id";
|
||||
boot.initrd.systemd.tmpfiles.settings.machine-id."/sysroot/var/lib/nixos/machine-id".f =
|
||||
lib.mkDefault
|
||||
{
|
||||
argument = "uninitialized";
|
||||
};
|
||||
})
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user