diff options
Diffstat (limited to 'nix/web.nix')
| -rw-r--r-- | nix/web.nix | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/nix/web.nix b/nix/web.nix index b34f8d8..0013d4f 100644 --- a/nix/web.nix +++ b/nix/web.nix @@ -1,8 +1,32 @@ -{...}: { - # dont serve git.kassouni.net traffic to other subdomains - services.nginx.virtualHosts."_" = { - default = true; - rejectSSL = true; - locations."/".return = 444; +{inputs, pkgs, ...}: let + domain = "kassouni.net"; +in { + services.nginx = { + enable = true; + recommendedGzipSettings = true; + recommendedOptimisation = true; + recommendedTlsSettings = true; + + virtualHosts = { + # dont serve kassouni.net traffic to other subdomains + "_" = { + default = true; + rejectSSL = true; + locations."/".return = 444; + }; + + ${domain} = { + forceSSL = true; + enableACME = true; + root = inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.website; + }; + }; }; + + security.acme = { + acceptTerms = true; + defaults.email = "alex@${domain}"; + }; + + networking.firewall.allowedTCPPorts = [ 80 443 ]; } |