diff options
author | sinanmohd <sinan@sinanmohd.com> | 2024-01-09 13:24:58 +0530 |
---|---|---|
committer | sinanmohd <sinan@sinanmohd.com> | 2024-01-09 18:03:21 +0530 |
commit | c48a2543f0a11a92fd759188038c2767362ebec6 (patch) | |
tree | 05600de521c3ff623888610c340dadd4df46c4a8 /hosts/dspace/modules | |
parent | ca76ec99a638fb7ef8f54644695a47b627d64257 (diff) |
dspace/www/dsp: init
Diffstat (limited to 'hosts/dspace/modules')
-rw-r--r-- | hosts/dspace/modules/www.nix | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/hosts/dspace/modules/www.nix b/hosts/dspace/modules/www.nix new file mode 100644 index 0000000..90ab841 --- /dev/null +++ b/hosts/dspace/modules/www.nix @@ -0,0 +1,39 @@ +{ config, ... }: + +let + domain = "dsp.fscusat.ac.in"; +in +{ + networking.firewall.allowedTCPPorts = [ 80 443 ]; + + sops.secrets = let + opts = { + owner = config.services.nginx.user; + group = config.services.nginx.group; + }; + in{ + "cusat.ac.in/key" = opts; + "cusat.ac.in/crt" = opts; + }; + + services.nginx = { + enable = true; + recommendedTlsSettings = true; + recommendedZstdSettings = true; + recommendedOptimisation = true; + recommendedGzipSettings = true; + recommendedProxySettings = true; + recommendedBrotliSettings = true; + + virtualHosts.${domain} = { + forceSSL = true; + sslCertificateKey = config.sops.secrets."cusat.ac.in/key".path; + sslCertificate = config.sops.secrets."cusat.ac.in/crt".path; + + locations."/" = { + return = "200 '<h1>under construction</h1>'"; + extraConfig = "add_header Content-Type text/html;"; + }; + }; + }; +} |