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