nixcfg/systems/x86_64-linux/attic/default.nix
Harald Hoyer f039e4af1b feat(attic): enable HTTPS and configure Nginx with ACME
- Allow TCP ports 80 and 443 in the firewall for HTTP and HTTPS traffic.
- Enable Nginx with ACME integration for automatic SSL certificate management.
- Configure a virtual host with proxy settings and support for WebSocket traffic.
2026-03-25 11:18:02 +01:00

75 lines
1.6 KiB
Nix

{
lib,
...
}:
{
imports = [
./hardware-configuration.nix
./atticd.nix
];
metacfg = {
base.enable = true;
nix.enable = true;
};
system.autoUpgrade = {
enable = true;
operation = "switch";
allowReboot = true;
};
virtualisation = {
docker.enable = true;
podman.dockerCompat = false;
libvirtd.enable = false;
};
# Legacy BIOS boot (Hetzner cloud instance)
boot.loader.systemd-boot.enable = lib.mkForce false;
boot.loader.efi.canTouchEfiVariables = lib.mkForce false;
boot.loader.grub.enable = true;
security.sudo.wheelNeedsPassword = false;
security.tpm2.enable = false;
security.tpm2.abrmd.enable = false;
networking.wireless.enable = false;
networking.useDHCP = false;
networking.useNetworkd = true;
systemd.network.networks."30-wan" = {
matchConfig.Name = "enp1s0";
networkConfig.DHCP = "ipv4";
address = [ "2a01:4f9:c014:619::1/64" ];
routes = [{ Gateway = "fe80::1"; }];
};
networking.firewall.allowedTCPPorts = [ 80 443 ];
networking.firewall.allowPing = true;
security.acme = {
acceptTerms = true;
defaults.email = "harald@hoyer.xyz";
};
services.nginx = {
enable = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts."attic.teepot.org" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://[::1]:8080";
proxyWebsockets = true;
extraConfig = ''
client_max_body_size 0;
'';
};
};
};
powerManagement.cpuFreqGovernor = "ondemand";
system.stateVersion = "25.11";
}