configure domain in a central file

This commit is contained in:
eyjhb 2024-08-11 14:50:32 +02:00
parent 865e1251de
commit d459fa895e
Signed by: eyjhb
GPG key ID: 609F508E3239F920
8 changed files with 52 additions and 30 deletions

View file

@ -1,13 +1,15 @@
{ config, pkgs, ... }:
{
services.nginx.virtualHosts."fricloud.dk" = {
let
svc_domain = config.mine.settings.domain;
in {
services.nginx.virtualHosts."${svc_domain}" = {
forceSSL = true;
enableACME = true;
root = pkgs.writeTextDir "index.html" ''
<html>
<head>
<title>Fricloud.dk</title>
<title>${svc_domain}</title>
</head>
<body>
<marquee
@ -21,7 +23,7 @@
};
# setup group for fricloud.dk cert + add nginx to group.
# group `fricloud-domain` is used for users that need access to the domain certificate, e.g. murmur
security.acme.certs."fricloud.dk".group = config.users.groups.fricloud-domain.name;
users.groups.fricloud-domain.members = [ config.users.users.nginx.name ];
# group `main-domain` is used for users that need access to the domain certificate, e.g. murmur
security.acme.certs."${svc_domain}".group = config.users.groups.main-domain.name;
users.groups.main-domain.members = [ config.users.users.nginx.name ];
}