summaryrefslogtreecommitdiff
path: root/modules/git/cgit.nix
diff options
context:
space:
mode:
authorRaghuram Subramani <raghus2247@gmail.com>2025-10-09 16:10:11 -0400
committerRaghuram Subramani <raghus2247@gmail.com>2025-10-09 16:10:11 -0400
commit4df13c093b749cd9500512f01f5756f9f1d4d6e6 (patch)
treecb1eaf8594104cc748ea7378d7f9a1d7eb5ad0e1 /modules/git/cgit.nix
parentef4a327b37e3a76f92f7ae994b2e2d3423077de2 (diff)
configure h2o
Diffstat (limited to 'modules/git/cgit.nix')
-rw-r--r--modules/git/cgit.nix59
1 files changed, 33 insertions, 26 deletions
diff --git a/modules/git/cgit.nix b/modules/git/cgit.nix
index a958683..3749898 100644
--- a/modules/git/cgit.nix
+++ b/modules/git/cgit.nix
@@ -18,35 +18,42 @@ in {
services.h2o = {
enable = true;
- extraConfig = ''
- listen:
- port: 80
- host: 0.0.0.0
- listen:
- port: 443
- host: 0.0.0.0
- ssl:
- certificate-file: /var/lib/acme/git.compromyse.xyz/fullchain.pem
- key-file: /var/lib/acme/git.compromyse.xyz/key.pem
+ user = "cgit";
+ group = "cgit";
- # Default host configuration
- hosts:
- "*":
- paths:
- "/static/":
- file.dir: ${pkgs.cgit}/cgit
+ hosts = {
+ "" = {
+ listen = [
+ { port = 80; host = "0.0.0.0"; }
+ {
+ port = 443;
+ host = "0.0.0.0";
+ ssl = {
+ certificate-file = "/var/lib/acme/git.compromyse.xyz/fullchain.pem";
+ key-file = "/var/lib/acme/git.compromyse.xyz/key.pem";
+ };
+ }
+ ];
- "/":
- fastcgi.connect:
- unix: /run/cgit.sock
- fastcgi.spawn: "no"
- fastcgi.params:
- SCRIPT_FILENAME: ${pkgs.cgit}/cgit/cgit.cgi
- PATH_INFO: "index.html"
+ paths = {
+ "/static/" = {
+ file.dir = "${pkgs.cgit}/cgit";
+ };
- access-log: /var/log/h2o/git-access.log
- error-log: /var/log/h2o/git-error.log
- '';
+ "/" = {
+ fastcgi.connect.unix = "/run/cgit.sock";
+ fastcgi.spawn = "no";
+ fastcgi.params = {
+ SCRIPT_FILENAME = "${pkgs.cgit}/cgit/cgit.cgi";
+ PATH_INFO = "index.html";
+ };
+ };
+ };
+
+ accessLog = "/var/log/h2o/git-access.log";
+ errorLog = "/var/log/h2o/git-error.log";
+ };
+ };
};
security.acme = {