Files
Richie 876683066c
treefmt / nix fmt (pull_request) Successful in 4s
build_systems / prebuild-common-x86-64-v3 (pull_request) Successful in 25s
build_systems / build-portal-1 (pull_request) Successful in 16s
build_systems / build-bob (pull_request) Successful in 33s
test ebook search / test-ebook-search (pull_request) Successful in 1m6s
build_systems / build-rhapsody-in-green (pull_request) Successful in 37s
build_systems / build-brain (pull_request) Successful in 41s
build_systems / build-jeeves (pull_request) Successful in 1m16s
treefmt / nix fmt (push) Successful in 2s
build_systems / prebuild-common-x86-64-v3 (push) Successful in 5s
build_systems / build-portal-1 (push) Successful in 16s
build_systems / build-bob (push) Successful in 25s
build_systems / build-brain (push) Successful in 28s
build_systems / build-rhapsody-in-green (push) Successful in 30s
test ebook search / test-ebook-search (push) Successful in 1m4s
build_systems / build-jeeves (push) Successful in 58s
feat(nornsight): remove Norn Sight service and related configurations
2026-10-16 10:29:06 -04:00

77 lines
1.8 KiB
Nix

let
domains = [
"audiobookshelf"
"cache"
"gitea"
"gems"
"jellyfin"
"share"
];
makeCert = name: {
name = "${name}.tmmworkshop.com";
value = {
webroot = "/var/lib/acme/.challenges";
group = "acme";
reloadServices = [ "haproxy.service" ];
};
};
acmeServices = map (domain: "acme-${domain}.tmmworkshop.com.service") domains;
in
{
networking.firewall.allowedTCPPorts = [
80
443
2223
];
# Global robots.txt served by HAProxy for every vhost (see haproxy.cfg).
environment.etc."haproxy/robots.txt".source = ./robots.txt;
services = {
haproxy = {
enable = true;
config = builtins.readFile ./haproxy.cfg;
};
nginx = {
enable = true;
virtualHosts."acme-challenge" = {
listen = [
{
addr = "127.0.0.1";
port = 8402;
}
];
locations."/.well-known/acme-challenge/" = {
root = "/var/lib/acme/.challenges";
};
};
};
};
security.acme = {
acceptTerms = true;
defaults.email = "Richie@tmmworkshop.com";
certs = builtins.listToAttrs ((map makeCert domains));
};
systemd = {
services.haproxy = {
# HAProxy needs the initial certificates and Tailscale connectivity before
# it can serve requests to its backends.
after = acmeServices ++ [ "tailscaled-autoconnect.service" ];
wants = acmeServices ++ [ "tailscaled-autoconnect.service" ];
};
tmpfiles.rules = [
"d /var/lib/acme/.challenges 0750 acme acme - -"
"d /var/lib/acme/.challenges/.well-known 0750 acme acme - -"
"d /var/lib/acme/.challenges/.well-known/acme-challenge 0750 acme acme - -"
];
};
users.users = {
haproxy.extraGroups = [ "acme" ];
nginx.extraGroups = [ "acme" ];
};
}