services: use subdomain for ACME cert

Avoids conflicts now that I have multiple servers sharing the config
This commit is contained in:
Antoine Martin 2022-06-12 17:18:58 +02:00
parent baa239dc72
commit 990c035c3b
13 changed files with 72 additions and 18 deletions

View file

@ -14,6 +14,8 @@
cfg = config.my.services.navidrome;
domain = config.networking.domain;
hostname = config.networking.hostName;
fqdn = "${hostname}.${domain}";
in {
options.my.services.navidrome = let
inherit (lib) types;
@ -46,7 +48,7 @@ in {
services.nginx.virtualHosts."music.${domain}" = {
forceSSL = true;
useACMEHost = domain;
useACMEHost = fqdn;
listen = [
# FIXME: hardcoded tailscale IP
@ -67,5 +69,7 @@ in {
proxyWebsockets = true;
};
};
security.acme.certs.${fqdn}.extraDomainNames = ["music.${domain}"];
};
}