about summary refs log tree commit diff
path: root/modules/nixos/git
diff options
context:
space:
mode:
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