mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 05:29:46 +01:00
go: add goPrivate option
This option configures the `GOPRIVATE` variable. See https://golang.org/cmd/go/#hdr-Module_configuration_for_non_public_modules for more information. PR #1126
This commit is contained in:
parent
5ff245790d
commit
1fd874b7ea
1 changed files with 16 additions and 0 deletions
|
@ -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;
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue