feat: set up cache

This commit is contained in:
TheGeneralist 2025-06-30 21:00:51 +02:00
parent 4c899bbfc6
commit 56cc86052f
Signed by: thegeneralist01
SSH key fingerprint: SHA256:pp9qddbCNmVNoSjevdvQvM5z0DHN7LTa8qBMbcMq/R4
6 changed files with 51 additions and 8 deletions

View file

@ -0,0 +1,27 @@
{ pkgs, config, ... }: let
domain = "cache.thegeneralist01.com";
ssl = {
quic = true;
useACMEHost = "thegeneralist01.com";
};
in {
age.secrets.cacheSigningKey.file = ./key.age;
services.nix-serve = {
enable = true;
package = pkgs.nix-serve-ng;
secretKeyFile = config.age.secrets.cacheSigningKey.path;
port = 1337;
openFirewall = false;
};
services.nginx.virtualHosts.${domain} = ssl // {
locations."/".proxyPass = "http://127.0.0.1:1337";
locations."= /".return = "301 https://thegeneralist01.com/404";
extraConfig = /* nginx */ ''
proxy_intercept_errors on;
error_page 404 = thegeneralist01.com/404.html;
'';
};
}

View file

@ -0,0 +1,7 @@
age-encryption.org/v1
-> ssh-ed25519 pp9qdQ 7QBh40bF+3U+uQaQiZNMVsIWX2ZX162OKbuzgNwIR3A
Fj2ACjgfeswbIt+ril51zlNaacqgMzkl8p3CQpiUGFo
--- yVZxFaEnzft0ovxvy0CbdIZso0qVMyFPGocBRiONTQM
b²Q^ 4öø4ƒy!Rq9+AE6î²ÓòÅåW&ÃÇÃt[Ñç.ƒ…â/<2F>ª„ª™J¼<4A>#Bu„zwIïêÖ/ÊGCo¼xÕn©™0Ö1·J¡ckJv/¸p¤qwÿûz B/ßíëÖy<C396>$,¥;IÀ3©wˆYÙ»üòSÔ
ë³ÑP2‡
_ ƒÀ”Á_µõDPž

View file

@ -5,7 +5,7 @@
{ self, config, pkgs, lib, inputs, ... }:
{
imports = [ ./hardware-configuration.nix ./site.nix ];
imports = [ ./hardware-configuration.nix ./site.nix ./cache ];
users.users.thegeneralist = {
isNormalUser = true;

View file

@ -66,6 +66,7 @@ in {
ingress = {
"thegeneralist01.com" = "http://localhost:80";
"www.thegeneralist01.com" = "http://localhost:80";
"cache.thegeneralist01.com" = "http://localhost:80";
};
default = "http_status:404";