feat(vesuvio): add acme certificates

This commit is contained in:
uku 2025-01-03 11:26:54 +01:00
parent 00c926e45b
commit 50a4954704
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, ... }:
{
imports = [
./certificates.nix
./frp.nix
./hetzner.nix
];
@ -10,8 +11,16 @@
traceroute
];
services.openssh = {
ports = [ 4269 ];
openFirewall = true;
services = {
nginx.enable = true;
openssh = {
ports = [ 4269 ];
openFirewall = true;
};
};
networking.firewall.allowedTCPPorts = [
80
443
];
}