diff --git a/nixos/ferret/adguard.nix b/nixos/ferret/adguard.nix index 5b47fb8..2f535e5 100644 --- a/nixos/ferret/adguard.nix +++ b/nixos/ferret/adguard.nix @@ -1,6 +1,7 @@ { pkgs, config, ... }: - -{ +let + certloc = "/var/lib/acme/ferret.otter.place"; +in { networking.firewall.allowedTCPPorts = [ 53 ]; services.adguardhome = { @@ -16,7 +17,6 @@ upstream_dns = [ "1.1.1.1" "9.9.9.9#dns.quad9.net" - "149.112.112.112#dns.quad9.net" ]; }; filtering = { @@ -37,4 +37,15 @@ ]; }; }; + + # SSL config + services.caddy = { + virtualHosts."adguard.ferret.otter.place".extraConfig = '' + reverse_proxy http://${toString config.services.adguardhome.host}:${toString config.services.adguardhome.port} + + tls ${certloc}/cert.pem ${certloc}/key.pem { + protocols tls1.3 + } + ''; + }; } \ No newline at end of file