diff --git a/modules/programs/go.nix b/modules/programs/go.nix index 983769d2..4b85ec85 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; + }) ]); }