pinwheel: Add enable option to go module

And use it to check when to add private repository for work
This commit is contained in:
Alexander Heldt
2023-10-01 23:01:09 +02:00
parent 408751cce5
commit f37bbdfa09
3 changed files with 32 additions and 19 deletions

View File

@@ -130,6 +130,7 @@
mod = {
git.enable = true;
openvpn.enable = true;
go.enable = true;
};
# This value determines the NixOS release from which the default

View File

@@ -1,5 +1,15 @@
{ pkgs, ... }:
{ pkgs, lib, config, ... }:
let
enabled = config.mod.go.enable;
in
{
options = {
mod.go = {
enable = lib.mkEnableOption "enable openpn module";
};
};
config = lib.mkIf enabled {
home-manager.users.alex = {
programs.go = {
enable = true;
@@ -22,4 +32,5 @@
'';
};
};
};
}

View File

@@ -1,6 +1,7 @@
{ pkgs, lib, config, ... }:
let
gitEnabled = config.mod.git.enable;
goEnabled = config.mod.go.enable;
openvpnEnabled = config.mod.openvpn.enable;
work-vpn = let
@@ -35,7 +36,7 @@ in
];
};
programs.go = {
programs.go = lib.mkIf goEnabled {
goPrivate = [ "gitlab.com/zebware/*" ];
};