migrated all languages to devshell
This commit is contained in:
@@ -4,17 +4,35 @@
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
packages = builtins.attrValues {
|
||||
inherit (pkgs)
|
||||
bashdb # Debugger and completion support
|
||||
shellcheck # Shell script linter
|
||||
shfmt # Shell parser and formatter
|
||||
;
|
||||
# LSP for Bash and sh
|
||||
inherit (pkgs.nodePackages) bash-language-server;
|
||||
};
|
||||
in
|
||||
{
|
||||
options.my.dev.sh.enable = lib.mkEnableOption "enable";
|
||||
options = {
|
||||
my.dev.sh.enable = lib.mkEnableOption "Install shell scripting tools globally";
|
||||
devShells.sh = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.mkShell {
|
||||
inherit packages;
|
||||
name = "sh-dev-shell";
|
||||
shellHook = ''
|
||||
echo "💻 Shell scripting dev environment"
|
||||
'';
|
||||
};
|
||||
description = "Shell scripting dev shell";
|
||||
};
|
||||
};
|
||||
config = lib.mkIf config.my.dev.sh.enable {
|
||||
users.users.jawz.packages = builtins.attrValues {
|
||||
inherit (pkgs)
|
||||
bashdb # autocomplete
|
||||
shellcheck # linting
|
||||
shfmt # a shell parser and formatter
|
||||
;
|
||||
#LSP
|
||||
inherit (pkgs.nodePackages) bash-language-server;
|
||||
users.users.jawz = {
|
||||
inherit packages;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user