diff --git a/modules/webstack.nix b/modules/webstack.nix index abd5277..1d9a4df 100644 --- a/modules/webstack.nix +++ b/modules/webstack.nix @@ -96,4 +96,26 @@ host all all ::1/128 trust ''; }; + + # Run Mono server + systemd.services.mono-server = { + description = "Mono server to run ASP .NET applications"; + wantedBy = [ "default.target" ]; + path = with pkgs; [ mono6 ]; + script = '' + lockfile=/tmp/mono-service + ${pkgs.mono6}/bin/mono-service -d:/vault/backups/frontend/inetpub/wwwroot/gcw -l:$lockfile + ${pkgs.mono6}/bin/mono-service -d:/vault/backups/frontend/inetpub/wwwroot/few -l:$lockfile + ''; + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = "yes"; + User = "nginx"; + Group = "nginx"; + ExecStop = '' + kill `cat $lockfile` + ''; + }; + before = [ "nginx.service" ]; + }; }