feat: add assertion to ensure correctness of options

This commit is contained in:
Kiana Sheibani 2024-11-20 02:23:49 -05:00
parent c978882918
commit bb8f338c68
Signed by: toki
GPG key ID: 6CB106C25E86A9F7
2 changed files with 9 additions and 2 deletions

View file

@ -42,4 +42,11 @@ args@{ config, lib, ... }:
}; };
}; };
}; };
config.assertions = lib.mkIf config.aether.https [
{
assertion = !(builtins.isNull config.aether.acmeEmail);
message = "HTTPS support requires providing a contact email";
}
];
} }

View file

@ -12,8 +12,8 @@
}; };
acmeEmail = lib.mkOption { acmeEmail = lib.mkOption {
type = lib.types.str; type = lib.types.nullOr lib.types.str;
default = ""; default = null;
description = "Email address for ACME."; description = "Email address for ACME.";
}; };
} }