about summary refs log tree commit diff
path: root/modules/nixos/git/default.nix
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2023-10-29 15:43:07 +0300
committerAzat Bahawi <azat@bahawi.net>2023-10-29 15:43:07 +0300
commit26125aac992416df8a3fd1f860aabcf6a37380ba (patch)
tree11ecb98248812a2b8392f3a879199835a55e9ee6 /modules/nixos/git/default.nix
parent2023-10-25 (diff)
2023-10-29
Diffstat (limited to '')
-rw-r--r--modules/nixos/git/default.nix25
1 files changed, 12 insertions, 13 deletions
diff --git a/modules/nixos/git/default.nix b/modules/nixos/git/default.nix
index 9fb43db..4268f82 100644
--- a/modules/nixos/git/default.nix
+++ b/modules/nixos/git/default.nix
@@ -73,10 +73,10 @@ in {
             fastcgi_param QUERY_STRING $args;
             fastcgi_param HTTP_HOST $server_name;
 
-            # This makes `go get ...` work and adds analytics.
-            sub_filter '</head>'
-                '<meta name="go-import" content="$host$uri git https://$host$uri"><script defer data-domain="${cfg.server.domain}" src="https://plausible.shire.net/js/script.js"></script></head>';
-            sub_filter_once on;
+            ${nginxAppendHead [
+              ''<meta name="go-import" content="$host$uri git https://$host$uri">''
+              (htmlPlausibleScript {inherit (cfg.server) domain;})
+            ]}
           '';
           "~* ^.+(cgit.css|robots.txt)$".extraConfig = ''
             root ${cfg.server.package}/cgit;
@@ -88,16 +88,15 @@ in {
             alias ${./favicon.ico};
           '';
           "~* ^.+cgit-custom-style.css$".extraConfig = let
-            css = with config.colourScheme;
-              pkgs.writeText "custom.css" ''
-                @import url("cgit.css");
+            css = pkgs.writeText "custom.css" ''
+              @import url("cgit.css");
 
-                div#cgit {
-                  font-family: "${config.fontScheme.monospaceFont.family}", monospace;
-                  -moz-tab-size: 4;
-                  tab-size: 4;
-                }
-              '';
+              div#cgit {
+                font-family: "${config.fontScheme.monospaceFont.family}", monospace;
+                -moz-tab-size: 4;
+                tab-size: 4;
+              }
+            '';
           in ''
             alias ${css};
           '';

Consider giving Nix/NixOS a try! <3