aboutsummaryrefslogtreecommitdiff
path: root/home-manager/modules/programs/go.nix
diff options
context:
space:
mode:
Diffstat (limited to 'home-manager/modules/programs/go.nix')
-rw-r--r--home-manager/modules/programs/go.nix16
1 files changed, 16 insertions, 0 deletions
diff --git a/home-manager/modules/programs/go.nix b/home-manager/modules/programs/go.nix
index 983769d26af..4b85ec854ad 100644
--- a/home-manager/modules/programs/go.nix
+++ b/home-manager/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 <envar>GOPRIVATE</envar> 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;
+ })
]);
}