Add impermanence to hostSpec

This commit is contained in:
TheWanderingCrow 2025-10-22 15:28:56 -04:00
parent 0fbc69679e
commit 80c5d4a256

View file

@ -89,18 +89,23 @@
default = false; default = false;
description = "Used to indicate a virtual host"; description = "Used to indicate a virtual host";
}; };
isImpermanent = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Used to indicate an impermanent host";
};
}; };
config = { #config = {
assertions = let # assertions = let
# We import these options to HM and NixOS, so need to not fail on HM # # We import these options to HM and NixOS, so need to not fail on HM
isImpermanent = # isImpermanent =
config ? "system" && config.system ? "impermanence" && config.system.impermanence.enable; # config ? "system" && config.system ? "impermanence" && config.system.impermanence.enable;
in [ # in [
{ # {
assertion = !isImpermanent || (isImpermanent && !("${config.hostSpec.persistFolder}" == "")); # assertion = !isImpermanent || (isImpermanent && !("${config.hostSpec.persistFolder}" == ""));
message = "config.system.impermanence.enable is true but no persistFolder path is provided"; # message = "config.system.impermanence.enable is true but no persistFolder path is provided";
} # }
]; # ];
}; #};
} }