assertions
This commit is contained in:
@@ -20,6 +20,21 @@ in
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion = cfg.upsName != "";
|
||||
message = "mjallen.power.ups.upsName must be a non-empty string.";
|
||||
}
|
||||
{
|
||||
assertion = cfg.upsUser != "";
|
||||
message = "mjallen.power.ups.upsUser must be a non-empty string.";
|
||||
}
|
||||
{
|
||||
assertion = builtins.hasAttr "jallen-nas/ups_password" config.sops.secrets;
|
||||
message = "mjallen.power.ups requires a sops secret \"jallen-nas/ups_password\" to be declared.";
|
||||
}
|
||||
];
|
||||
|
||||
power.ups = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
|
||||
Reference in New Issue
Block a user