From da10937ed11567e263cdd28fa9113f72d0ec3759 Mon Sep 17 00:00:00 2001 From: James Patrick Date: Fri, 4 Mar 2022 22:24:38 -0500 Subject: [PATCH] Added lang. This is for development targets. This is kind of bad place for this. But I'm keeping it here until I can reorganize it. --- modules/default.nix | 1 + modules/lang/bash.nix | 23 +++++++++++++++++++++ modules/lang/default.nix | 3 +++ modules/lang/golang.nix | 40 +++++++++++++++++++++++++++++++++++++ modules/lang/javascript.nix | 25 +++++++++++++++++++++++ 5 files changed, 92 insertions(+) create mode 100644 modules/lang/bash.nix create mode 100644 modules/lang/default.nix create mode 100644 modules/lang/golang.nix create mode 100644 modules/lang/javascript.nix diff --git a/modules/default.nix b/modules/default.nix index cf8c71e..d21f725 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -8,6 +8,7 @@ imports = [ ./system ./applications + ./lang # TODO Refactor everything after this. ./cli.nix ]; diff --git a/modules/lang/bash.nix b/modules/lang/bash.nix new file mode 100644 index 0000000..d717e20 --- /dev/null +++ b/modules/lang/bash.nix @@ -0,0 +1,23 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.this.lang.bash; + graphical = config.this.graphical; +in with lib; { + options = { + this.lang.bash = { + enable = mkOption { + default = graphical.enable; + type = with types; bool; + }; + }; + }; + + config = mkIf cfg.enable { + home-manager.users.james = { + home.packages = with pkgs; [ + nodePackages.bash-language-server + shellcheck + ]; + }; + }; +} diff --git a/modules/lang/default.nix b/modules/lang/default.nix new file mode 100644 index 0000000..e460ec3 --- /dev/null +++ b/modules/lang/default.nix @@ -0,0 +1,3 @@ +{ config, pkgs, ... }: { + imports = [ ./golang.nix ./javascript.nix ./bash.nix ]; +} diff --git a/modules/lang/golang.nix b/modules/lang/golang.nix new file mode 100644 index 0000000..de79987 --- /dev/null +++ b/modules/lang/golang.nix @@ -0,0 +1,40 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.this.lang.golang; + graphical = config.this.graphical; +in with lib; { + options = { + this.lang.golang = { + enable = mkOption { + default = graphical.enable; + type = with types; bool; + }; + }; + }; + + config = mkIf cfg.enable { + home-manager.users.james = { + programs.go = { + enable = true; + goPath = ".local/go"; + goBin = ".local/bin.go"; + # packages = { + # "golang.org/x/tools/cmd/godoc"; + # "golang.org/x/tools/cmd/goimports"; + # "golang.org/x/tools/cmd/gorename"; + # "golang.org/x/tools/cmd/guru"; + # }; + }; + + home.packages = with pkgs; [ + air + gocode + golangci-lint + gomodifytags + gomodifytags + gore + gotests + ]; + }; + }; +} diff --git a/modules/lang/javascript.nix b/modules/lang/javascript.nix new file mode 100644 index 0000000..7ba6586 --- /dev/null +++ b/modules/lang/javascript.nix @@ -0,0 +1,25 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.this.lang.bash; + graphical = config.this.graphical; +in with lib; { + options = { + this.lang.javascript = { + enable = mkOption { + default = graphical.enable; + type = with types; bool; + }; + }; + }; + + config = mkIf cfg.enable { + home-manager.users.james = { + home.packages = with pkgs; [ + nodePackages.npm + nodePackages.vue-cli + nodejs + yarn + ]; + }; + }; +}