nixos/nixos-init: add more strict assertions for required config
This commit is contained in:
@@ -24,7 +24,15 @@ in
|
||||
assertions = [
|
||||
{
|
||||
assertion = config.boot.initrd.systemd.enable;
|
||||
message = "nixos-init can only be used with systemd initrd";
|
||||
message = "nixos-init can only be used with boot.initrd.systemd.enable";
|
||||
}
|
||||
{
|
||||
assertion = config.system.etc.overlay.enable;
|
||||
message = "nixos-init can only be used with system.etc.overlay.enable";
|
||||
}
|
||||
{
|
||||
assertion = config.services.userborn.enable || config.systemd.sysusers.enable;
|
||||
message = "nixos-init can only be used with services.userborn.enable or systemd.sysusers.enable";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
@@ -8,11 +8,9 @@
|
||||
nodes.machine =
|
||||
{ modulesPath, ... }:
|
||||
{
|
||||
imports = [
|
||||
"${modulesPath}/profiles/perlless.nix"
|
||||
];
|
||||
virtualisation.mountHostNixStore = false;
|
||||
virtualisation.useNixStoreImage = true;
|
||||
boot.initrd.systemd.enable = true;
|
||||
system.etc.overlay.enable = true;
|
||||
services.userborn.enable = true;
|
||||
|
||||
system.nixos-init.enable = true;
|
||||
# Forcibly set this to only these specific values.
|
||||
|
||||
Reference in New Issue
Block a user