diff options
Diffstat (limited to 'os')
-rw-r--r-- | os/cez/modules/www.nix | 46 | ||||
-rw-r--r-- | os/kay/modules/www.nix | 6 |
2 files changed, 52 insertions, 0 deletions
diff --git a/os/cez/modules/www.nix b/os/cez/modules/www.nix new file mode 100644 index 0000000..9ec20da --- /dev/null +++ b/os/cez/modules/www.nix @@ -0,0 +1,46 @@ +{ config, pkgs, lib, ... }: + +let + domain = config.global.userdata.domain; +in +{ + services.nginx = { + enable = true; + + recommendedTlsSettings = true; + recommendedOptimisation = true; + recommendedGzipSettings = true; + recommendedProxySettings = true; + recommendedBrotliSettings = true; + + virtualHosts.${domain} = { + forceSSL = true; + enableACME = true; + useACMEHost = domain; + locations."= /" = { + extraConfig = "add_header Content-Type text/html;"; + return = ''200 + '<!DOCTYPE html> + <html lang="en"> + <head> + <meta charset="UTF-8"> + <title>Nix Cache</title> + </head> + <body> + <center> + <h1 style="font-size: 8em"> + ❄️ Nix Cache + </h1> + <p style="font-weight: bold"> + Public Key: nixbin.sinanmohd.com:dXV3KDPVrm+cGJ2M1ZmTeQJqFGaEapqiVoWHgYDh03k= + </p> + </center> + </body> + </html>' + ''; + }; + }; + + }; + }; +} diff --git a/os/kay/modules/www.nix b/os/kay/modules/www.nix index 5246d65..2500222 100644 --- a/os/kay/modules/www.nix +++ b/os/kay/modules/www.nix @@ -118,6 +118,12 @@ in "nixbin.${domain}" = defaultOpts // { extraConfig = "proxy_buffering off;"; locations = { + "= /files".return = "301 https://nixbin.${domain}/files/"; + "/files/" = { + alias = "/nix/store/"; + extraConfig = "autoindex on;"; + }; + "= /" = { extraConfig = "add_header Content-Type text/html;"; return = ''200 |