mirror of
https://github.com/TheWanderingCrow/CrOS.git
synced 2026-01-10 01:24:05 -05:00
Add impermanence to hostSpec
This commit is contained in:
parent
0fbc69679e
commit
80c5d4a256
1 changed files with 17 additions and 12 deletions
|
|
@ -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";
|
||||
# }
|
||||
# ];
|
||||
#};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue