feat(vesuvio): add acme certificates

This commit is contained in:
uku 2025-01-03 11:26:54 +01:00
parent 60642a9ba7
commit 15b0781bee
Signed by: uku
SSH key fingerprint: SHA256:4P0aN6M8ajKukNi6aPOaX0LacanGYtlfjmN+m/sHY/o
2 changed files with 37 additions and 3 deletions

View file

@ -0,0 +1,25 @@
{ config, ... }:
{
security.acme = {
acceptTerms = true;
defaults = {
email = "acme@uku.moe";
webroot = "/var/lib/acme/acme-challenge";
};
};
services.nginx.virtualHosts = {
"acme.uku3lig.net" = {
serverAliases = [
"*.uku3lig.net"
"*.uku.moe"
];
locations."/.well-known/acme-challenge".root = config.security.acme.defaults.webroot;
};
};
# /var/lib/acme/acme-challenge must be writable by the ACME user and readable by the Nginx user.
# The easiest way to achieve this is to add the Nginx user to the ACME group.
users.users.nginx.extraGroups = [ "acme" ];
}

View file

@ -1,6 +1,7 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
imports = [ imports = [
./certificates.nix
./frp.nix ./frp.nix
./hetzner.nix ./hetzner.nix
]; ];
@ -10,8 +11,16 @@
traceroute traceroute
]; ];
services.openssh = { services = {
nginx.enable = true;
openssh = {
ports = [ 4269 ]; ports = [ 4269 ];
openFirewall = true; openFirewall = true;
}; };
};
networking.firewall.allowedTCPPorts = [
80
443
];
} }