diff options
Diffstat (limited to 'modules/golang.nix')
| -rw-r--r-- | modules/golang.nix | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/modules/golang.nix b/modules/golang.nix new file mode 100644 index 0000000..e6e0821 --- /dev/null +++ b/modules/golang.nix @@ -0,0 +1,22 @@ +{ config, lib, pkgs, ... }: + +with lib; +let cfg = config.golang; +in { + options.golang = { + enable = mkEnableOption { name = "golang"; }; + package = mkOption { + type = types.package; + default = pkgs.go; + defaultText = literalExample "pkgs.go"; + description = '' + The package for Go. This sets the version of Go.. + ''; + example = literalExample "pkgs.go_1_15"; + }; + }; + + config = mkIf cfg.enable { + buildInputs = [ cfg.package ] ++ (with pkgs; [ gofumpt golint ]); + }; +} |
