about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--git.nix17
1 files changed, 10 insertions, 7 deletions
diff --git a/git.nix b/git.nix
index 99fb287..dc120f8 100644
--- a/git.nix
+++ b/git.nix
@@ -17,15 +17,17 @@
 # along with loang configuration.  If not, see <https://www.gnu.org/licenses/>.
 
 { config, lib, pkgs, ... }:
-let inherit (config.networking) domain;
+let
+  inherit (config.networking) domain;
+  cgit = pkgs.cgit-pink;
 in {
   services = let
     cgitrc = pkgs.writeText "cgitrc" ''
-      about-filter=${pkgs.cgit}/lib/cgit/filters/about-formatting.sh
+      about-filter=${cgit}/lib/cgit/filters/about-formatting.sh
       css=/style.css
       favicon=/favicon.ico
       logo=/cgit.png
-      source-filter=${pkgs.cgit}/lib/cgit/filters/syntax-highlighting.py
+      source-filter=${cgit}/lib/cgit/filters/syntax-highlighting.py
       virtual-root=/
 
       clone-url=${httpsClone} ${sshClone}
@@ -37,7 +39,7 @@ in {
       snapshots=tar.gz tar.zst
       scan-path=${scanPath}
     '';
-    css = builtins.readFile "${pkgs.cgit}/cgit/cgit.css" + ''
+    css = builtins.readFile "${cgit}/cgit/cgit.css" + ''
 
       div#cgit {
           font-size: initial;
@@ -48,15 +50,16 @@ in {
     sshClone = "ssh://${domain}:2211${scanPath}/$CGIT_REPO_URL";
   in {
     fcgiwrap.enable = true;
+
     nginx.virtualHosts."trong.${domain}" = {
       enableACME = true;
       forceSSL = true;
       locations = {
         "/" = {
-          root = "${pkgs.cgit}/cgit/";
+          root = "${cgit}/cgit/";
           tryFiles = "$uri @cgit";
         };
-        "~ ^/(cgit.png|favicon.ico|robots.txt)$".alias = "${pkgs.cgit}/cgit/$1";
+        "~ ^/(cgit.png|favicon.ico|robots.txt)$".alias = "${cgit}/cgit/$1";
         "= /style.css".alias = builtins.toFile "style.css" css;
         "@cgit".extraConfig = ''
           include ${pkgs.nginx}/conf/fastcgi_params;
@@ -64,7 +67,7 @@ in {
           fastcgi_param HTTP_HOST $server_name;
           fastcgi_param PATH_INFO $uri;
           fastcgi_param QUERY_STRING $args;
-          fastcgi_param SCRIPT_FILENAME ${pkgs.cgit}/cgit/cgit.cgi;
+          fastcgi_param SCRIPT_FILENAME ${cgit}/cgit/cgit.cgi;
           fastcgi_pass unix:${config.services.fcgiwrap.socketAddress};
         '';
       };