diff options
Diffstat (limited to 'os/kay/modules')
-rw-r--r-- | os/kay/modules/dns/sinanmohd.com.zone | 3 | ||||
-rw-r--r-- | os/kay/modules/nix-cache.nix | 12 | ||||
-rw-r--r-- | os/kay/modules/www.nix | 32 |
3 files changed, 46 insertions, 1 deletions
diff --git a/os/kay/modules/dns/sinanmohd.com.zone b/os/kay/modules/dns/sinanmohd.com.zone index f3caf8f..31627fc 100644 --- a/os/kay/modules/dns/sinanmohd.com.zone +++ b/os/kay/modules/dns/sinanmohd.com.zone @@ -2,7 +2,7 @@ $ORIGIN sinanmohd.com. $TTL 2d @ IN SOA ns1 hostmaster ( - 2024091105 ; serial + 2025021808 ; serial 2h ; refresh 5m ; retry 1d ; expire @@ -41,6 +41,7 @@ git IN CNAME @ bin IN CNAME @ static IN CNAME @ home IN CNAME @ +nixbin IN CNAME @ lia IN A 65.0.3.127 diff --git a/os/kay/modules/nix-cache.nix b/os/kay/modules/nix-cache.nix new file mode 100644 index 0000000..9c81b56 --- /dev/null +++ b/os/kay/modules/nix-cache.nix @@ -0,0 +1,12 @@ +{ config, ... }: +let + keyname = "misc/nixbin.${config.global.userdata.domain}"; +in +{ + sops.secrets.${keyname} = { }; + + services.nix-serve = { + enable = true; + secretKeyFile = config.sops.secrets.${keyname}.path; + }; +} diff --git a/os/kay/modules/www.nix b/os/kay/modules/www.nix index e8def58..5246d65 100644 --- a/os/kay/modules/www.nix +++ b/os/kay/modules/www.nix @@ -114,6 +114,38 @@ in ] }"''; }; + + "nixbin.${domain}" = defaultOpts // { + extraConfig = "proxy_buffering off;"; + 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>' + ''; + }; + + "/".proxyPass = "http://${config.services.nix-serve.bindAddress}:${ + toString config.services.nix-serve.port + }"; + }; + }; }; }; } |