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