summaryrefslogtreecommitdiff
path: root/hostnix/elmo/cgithub.nix
diff options
context:
space:
mode:
authorJoe Mou <dev@mou.fo>2026-09-18 07:42:53 +0100
committerJoe Mou <dev@mou.fo>2026-09-18 08:11:33 +0100
commit363e8db444d9aade0fcca2bd3171653b7dab01d8 (patch)
tree64ef8ee4dc22ddb5313c6599e8e32754bb492991 /hostnix/elmo/cgithub.nix
parent9659525bf2387af6deab9d401784b94b1f44d395 (diff)
Run cgithub locally on elmotest
Diffstat (limited to 'hostnix/elmo/cgithub.nix')
-rw-r--r--hostnix/elmo/cgithub.nix27
1 files changed, 25 insertions, 2 deletions
diff --git a/hostnix/elmo/cgithub.nix b/hostnix/elmo/cgithub.nix
index ec7c162..45ca323 100644
--- a/hostnix/elmo/cgithub.nix
+++ b/hostnix/elmo/cgithub.nix
@@ -1,11 +1,34 @@
-{ ... }:
+{ pkgs, ... }:
+let
+ # The Makefile copies cgithub/ next to this flake before rebuilding.
+ cgithub = pkgs.callPackage ./packages/cgithub { src = ./cgithub; };
+in
{
+ 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;
+ ExecStart = "${cgithub}/bin/cgithub-server";
+ };
+ };
+
services.nginx.virtualHosts."fluffy-kitten.elmo.mou.fo" = {
useACMEHost = "elmo.mou.fo";
forceSSL = true;
locations."/" = {
- return = "301 https://cgithub.jmou.workers.dev$request_uri";
+ proxyPass = "http://unix:/run/cgithub/socket";
};
};
}