about summary refs log tree commit diff
path: root/modules/nixos/git
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2023-07-15 12:45:02 +0300
committerAzat Bahawi <azat@bahawi.net>2023-07-15 12:45:02 +0300
commita75acfb7ef640c2367d4547b0f479e7acaad9017 (patch)
tree253afd11564269b1812c96bf3518a8aab9d4597c /modules/nixos/git
parent2023-07-13 (diff)
2023-07-15
Diffstat (limited to '')
-rw-r--r--modules/nixos/git/default.nix5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/nixos/git/default.nix b/modules/nixos/git/default.nix
index 9236437..5fe4391 100644
--- a/modules/nixos/git/default.nix
+++ b/modules/nixos/git/default.nix
@@ -72,6 +72,11 @@ in {
             fastcgi_param PATH_INFO $uri;
             fastcgi_param QUERY_STRING $args;
             fastcgi_param HTTP_HOST $server_name;
+
+            # This makes `go get ...` work.
+            sub_filter '</head>'
+                '<meta name="go-import" content="$host$uri git https://$host$uri"></head>';
+            sub_filter_once on;
           '';
           "~* ^.+(cgit.css|robots.txt)$".extraConfig = ''
             root ${cfg.server.package}/cgit;

Consider giving Nix/NixOS a try! <3