char/topaz-flake
git clone https://git.t4t.associates/char/topaz-flake
be98809
main
1{ pkgs , unstable-pkgs , ...} : 2let 3watch-party = pkgs . callPackage ../../packages/watch-party.nix { }; 4 5vhost = { 6forceSSL = true ; 7enableACME = true ; 8 9locations . "/" = { 10proxyPass = "http://127.0.0.1:8524" ; 11proxyWebsockets = true ; 12extraConfig = '' 13proxy_set_header Host $host; 14proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 15proxy_set_header X-Forwarded-Proto $scheme; 16'' ; 17}; 18}; 19in 20{ 21users . users . watch-party = { 22isSystemUser = true ; 23group = "watch-party" ; 24}; 25users . groups . watch-party = { }; 26 27systemd . services . watch-party = { 28description = "watch-party" ; 29after = [ "network.target" ]; 30wantedBy = [ "multi-user.target" ]; 31 32environment = { 33BIND_HOST = "127.0.0.1" ; 34PORT = "8524" ; 35HOME = "/var/lib/watch-party" ; 36}; 37 38serviceConfig = { 39Type = "simple" ; 40User = "watch-party" ; 41Group = "watch-party" ; 42StateDirectory = "watch-party" ; 43WorkingDirectory = "/var/lib/watch-party" ; 44ExecStartPre = [ 45" ${ pkgs . coreutils } /bin/rm -rf app" 46" ${ pkgs . coreutils } /bin/cp -r ${ watch-party } /share/watch-party app" 47" ${ pkgs . coreutils } /bin/chmod -R u+w app" 48]; 49ExecStart = " ${ unstable-pkgs . deno } /bin/deno task --cwd app start" ; 50Restart = "on-failure" ; 51RestartSec = "5s" ; 52 53NoNewPrivileges = true ; 54PrivateTmp = true ; 55ProtectSystem = "strict" ; 56ProtectHome = true ; 57}; 58}; 59 60services . nginx . virtualHosts = { 61"watch.bun.how" = vhost ; 62"staging.watch.bun.how" = vhost ; 63}; 64}