feat: add temporary homepage

This commit is contained in:
oddlama 2024-04-12 20:28:27 +02:00
parent 36baaef47d
commit c345f4e937
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
7 changed files with 27 additions and 14 deletions

View file

@ -6,6 +6,7 @@
inherit
(lib)
assertMsg
elem
filter
genAttrs
hasInfix
@ -37,9 +38,12 @@ in {
# If no such domain is found then an assertion is triggered.
domain = submod.config._module.args.name;
matchingCerts =
filter
(x: !hasInfix "." (removeSuffix ".${x}" domain))
config.security.acme.wildcardDomains;
if elem domain config.security.acme.wildcardDomains
then [domain]
else
filter
(x: !hasInfix "." (removeSuffix ".${x}" domain))
config.security.acme.wildcardDomains;
in
mkIf submod.config.useACMEWildcardHost {
useACMEHost = assert assertMsg (matchingCerts != []) "No wildcard certificate was defined that matches ${domain}";