summaryrefslogtreecommitdiff
path: root/hostnix/elmo/cgithub.nix
diff options
context:
space:
mode:
Diffstat (limited to 'hostnix/elmo/cgithub.nix')
-rw-r--r--hostnix/elmo/cgithub.nix37
1 files changed, 37 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";
+ };
+ };
+}