Kieran's opinionated (and probably slightly dumb) nix config

chore: fix cedarlogic

dunkirk.sh d543b8c9 c4fe3a9e

verified
+6 -6
+6 -6
modules/nixos/services/cedarlogic.nix
··· 66 66 systemd.services.cedarlogic.preStart = lib.mkAfter '' 67 67 cd ${webDir} 68 68 69 - if [ -f package.json ]; then 69 + # First start: install deps, parse gates, and build client 70 + if [ -f package.json ] && [ ! -d node_modules ]; then 70 71 ${pkgs.unstable.bun}/bin/bun install 72 + ${pkgs.unstable.bun}/bin/bun run parse-gates 73 + ${pkgs.unstable.bun}/bin/bun run build 71 74 fi 72 75 73 - # Generate gate definitions from XML 74 - ${pkgs.unstable.bun}/bin/bun run parse-gates 75 - 76 - # Build client (Vite) 77 - ${pkgs.unstable.bun}/bin/bun run build 76 + # Ensure Caddy can read static files 77 + chmod -R g+rX ${webDir}/dist 2>/dev/null || true 78 78 ''; 79 79 80 80 # Caddy - path-based routing to 3 backends + static file serving