diff --git a/modules/programs/go.nix b/modules/programs/go.nix index 983769d26..4b85ec854 100644 --- a/modules/programs/go.nix +++ b/modules/programs/go.nix @@ -62,6 +62,18 @@ in { example = ".local/bin.go"; description = "GOBIN relative to HOME"; }; + + goPrivate = mkOption { + type = with types; listOf str; + default = [ ]; + example = [ "*.corp.example.com" "rsc.io/private" ]; + description = '' + The GOPRIVATE environment variable controls + which modules the go command considers to be private (not + available publicly) and should therefore not use the proxy + or checksum database. + ''; + }; }; }; @@ -85,5 +97,9 @@ in { home.sessionVariables.GOBIN = builtins.toPath "${config.home.homeDirectory}/${cfg.goBin}"; }) + + (mkIf (cfg.goPrivate != [ ]) { + home.sessionVariables.GOPRIVATE = concatStringsSep "," cfg.goPrivate; + }) ]); }