summaryrefslogtreecommitdiff
path: root/modules/golang.nix
diff options
context:
space:
mode:
authorQuentin Aristote <quentin@aristote.fr>2021-12-03 11:48:19 +0100
committerQuentin Aristote <quentin@aristote.fr>2021-12-03 11:48:19 +0100
commit6bb027dbeb3dedb6c65cb27274465105bccdfb18 (patch)
tree7613a6397d866617c5c71cb3c906d86f03baba75 /modules/golang.nix
initial commit
Diffstat (limited to 'modules/golang.nix')
-rw-r--r--modules/golang.nix22
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 ]);
+ };
+}