diff options
author | Martin Fischer <martin@push-f.com> | 2024-12-16 05:42:35 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2024-12-18 11:21:58 +0100 |
commit | 5a510517e69d5993c2276e8dc84006dbb3e3f34e (patch) | |
tree | 5679032eff4cd5b92d544fe93c2a839ac80c021f | |
parent | 86590a9d84602ac529b7b64394d78baca4925455 (diff) |
tente: add cgit
-rw-r--r-- | nixos/domains.nix | 1 | ||||
-rw-r--r-- | nixos/tente-configuration.nix | 28 |
2 files changed, 29 insertions, 0 deletions
diff --git a/nixos/domains.nix b/nixos/domains.nix index 95f0a3c..f087169 100644 --- a/nixos/domains.nix +++ b/nixos/domains.nix @@ -4,4 +4,5 @@ in { personalWebsite = domain; tailscaleControlServer = "tailscale.${domain}"; + gitWebsite = "git.${domain}"; } diff --git a/nixos/tente-configuration.nix b/nixos/tente-configuration.nix index bef490c..5ece21a 100644 --- a/nixos/tente-configuration.nix +++ b/nixos/tente-configuration.nix @@ -93,6 +93,10 @@ in dataDir = "/srv/gitolite"; extraGitoliteRc = '' $RC{UMASK} = 0027; + $RC{GIT_CONFIG_KEYS} = 'cgit.* gitweb.*'; + + # not working for some reason? still getting `FATAL: git config 'gitweb.description' not allowed` if gitweb.* is omitted in GIT_CONFIG_KEYS + # push( @{$RC{ENABLE}}, 'cgit' ); # update description files instead of gitweb.description config ''; }; @@ -125,6 +129,30 @@ in forceSSL = true; root = "/srv/www/${domains.personalWebsite}"; }; + + nginx.virtualHosts.${domains.gitWebsite} = { + enableACME = true; + forceSSL = true; + }; + + cgit.main = { + enable = true; + # running as the gitolite user because otherwise cloning a repo via cgit fails with: + # fatal: detected dubious ownership in repository + user = config.services.gitolite.user; + group = config.services.gitolite.group; + nginx.virtualHost = domains.gitWebsite; + scanPath = "${config.services.gitolite.dataDir}/repositories"; + settings = { + remove-suffix = 1; + enable-git-config = 1; + root-title = "push-f.com repositories"; + root-desc = "My various repositories."; + enable-index-owner = 0; + source-filter = "${pkgs.cgit}/lib/cgit/filters/syntax-highlighting.py"; + clone-prefix = "https://${domains.gitWebsite}"; + }; + }; }; security.acme = { |