diff options
Diffstat (limited to 'hostnix')
| -rw-r--r-- | hostnix/elmo/cgithub.nix | 37 | ||||
| -rw-r--r-- | hostnix/elmo/configuration.nix | 1 |
2 files changed, 38 insertions, 0 deletions
diff --git a/hostnix/elmo/cgithub.nix b/hostnix/elmo/cgithub.nix new file mode 100644 index 0000000..cae05c6 --- /dev/null +++ b/hostnix/elmo/cgithub.nix @@ -0,0 +1,37 @@ +{ pkgs, ... }: + +{ + systemd.tmpfiles.rules = [ + "d /opt/cgithub 0755 joe users" + ]; + + systemd.sockets.cgithub = { + wantedBy = [ "sockets.target" ]; + socketConfig = { + ListenStream = "/run/cgithub/socket"; + SocketGroup = "nginx"; + SocketMode = "0660"; + }; + }; + + systemd.services.cgithub = { + requires = [ "cgithub.socket" ]; + after = [ "cgithub.socket" ]; + serviceConfig = { + Type = "exec"; + DynamicUser = true; + WorkingDirectory = "/opt/cgithub"; + }; + script = '' + exec ${pkgs.nodejs-slim_24}/bin/node dist/build/index.js + ''; + }; + + services.nginx.virtualHosts."fluffy-kitten.elmo.mou.fo" = { + useACMEHost = "elmo.mou.fo"; + forceSSL = true; + locations."/" = { + proxyPass = "http://unix:/run/cgithub/socket"; + }; + }; +} diff --git a/hostnix/elmo/configuration.nix b/hostnix/elmo/configuration.nix index e7e3dc9..eadd00c 100644 --- a/hostnix/elmo/configuration.nix +++ b/hostnix/elmo/configuration.nix @@ -4,6 +4,7 @@ imports = [ ./acme.nix ./backup.nix + ./cgithub.nix ./dns.nix ./dyndns.nix ./email.nix |
