my nixos config
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

oh my god

chfour 09a6c57e 9260ce1c

+21 -25
+3 -3
flake.lock
··· 118 118 ] 119 119 }, 120 120 "locked": { 121 - "lastModified": 1738309502, 122 - "narHash": "sha256-36Y9BvEqHBRQ4oJDWe0iXXWvEkb4MUeX8aZ2EDAYe6k=", 121 + "lastModified": 1738362652, 122 + "narHash": "sha256-jk0Pos+dukDVbUJdmYMLvvAxDmBWNs5ojICAZlBguQc=", 123 123 "owner": "chfour", 124 124 "repo": "website3", 125 - "rev": "124ff3a3cbf5a95c905d538283ea3b3bbdd0e548", 125 + "rev": "16fb2420dfcd269cc5b0639731bb5505dbfbcfd4", 126 126 "type": "github" 127 127 }, 128 128 "original": {
+18 -22
machines/fovps/services/caddy/default.nix
··· 1 1 { pkgs, config, website, ... }: 2 2 3 3 let 4 - lastModified = "${config.services.caddy.dataDir}/Last-Modified"; 4 + websiteDest = "${config.services.caddy.dataDir}/website"; 5 + websitePath = builtins.toString website.website.out; 5 6 in { 6 7 services.caddy.enable = true; 7 8 services.caddy.extraConfig = '' ··· 18 19 } 19 20 ''; 20 21 services.caddy.virtualHosts = { 21 - "eeep.ee".extraConfig = let 22 - websitePath = builtins.toString website.website.out; 23 - in '' 22 + "eeep.ee".extraConfig = '' 24 23 import errors 25 24 26 25 # lol ··· 29 28 redir * https://github.com/chfour/nixos/tree/main{uri} 30 29 } 31 30 32 - vars { 33 - # epic hack hacky hackk 34 - import ${lastModified} 35 - } 36 - 37 - root * ${websitePath} 31 + root * ${websiteDest} 38 32 encode zstd gzip 39 - header { 40 - Last-Modified {vars.Last-Modified} 41 - defer 42 - } 43 33 file_server 44 34 ''; 45 35 ··· 54 44 ''; 55 45 }; 56 46 57 - systemd.services.caddy = { 58 - preStart = '' 59 - { 60 - echo -n 'Last-Modified "' 61 - date --date="@$(stat /usr/bin/env --format='%Y')" -Ru \ 62 - | sed 's/+0000$/GMT/' | tr -d '\n' 63 - echo '"' 64 - } > ${lastModified} 47 + system.activationScripts = { 48 + copyWebsite = { 49 + text = '' 50 + # epic hack hacky hackk 51 + mkdir -p ${websiteDest} 52 + cp -r ${websitePath}/* ${websiteDest} 53 + pushd ${websiteDest} && comm -z -13 \ 54 + <(find ${websitePath} -mindepth 1 -printf '%P\0' | sort -z) \ 55 + <(find . -mindepth 1 -printf '%P\0' | sort -z) \ 56 + | xargs -0 rm -rf; popd 57 + # :trol: 58 + ${pkgs.lib.getExe pkgs.gnused} -i 's|{{placeholder "http.vars.websitePath"}}|${websitePath}|' ${websiteDest}/index.html 65 59 ''; 60 + deps = []; 61 + }; 66 62 }; 67 63 networking.firewall.allowedTCPPorts = [ 80 443 ]; 68 64 networking.firewall.allowedUDPPorts = [ 80 443 ];