diff --git a/examples/shell/.test.sh b/examples/shell/.test.sh new file mode 100755 index 000000000..2d2884169 --- /dev/null +++ b/examples/shell/.test.sh @@ -0,0 +1,6 @@ +#!/bin/sh +set -ex +bash-language-server --version +bats --version +shellcheck --version +shfmt --version diff --git a/examples/shell/devenv.nix b/examples/shell/devenv.nix new file mode 100644 index 000000000..0119b27ad --- /dev/null +++ b/examples/shell/devenv.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: + +{ + languages.shell.enable = true; + enterShell = '' + bash-language-server --version + bats --version + shellcheck --version + shfmt --version + ''; +} diff --git a/examples/shell/devenv.yaml b/examples/shell/devenv.yaml new file mode 100644 index 000000000..c7cb5ceda --- /dev/null +++ b/examples/shell/devenv.yaml @@ -0,0 +1,3 @@ +inputs: + nixpkgs: + url: github:NixOS/nixpkgs/nixpkgs-unstable diff --git a/examples/supported-languages/devenv.nix b/examples/supported-languages/devenv.nix index ea2305ac5..3639ba1da 100644 --- a/examples/supported-languages/devenv.nix +++ b/examples/supported-languages/devenv.nix @@ -38,6 +38,7 @@ languages.ruby.enable = true; languages.rust.enable = true; languages.scala.enable = true; + languages.shell.enable = true; languages.swift.enable = true; languages.terraform.enable = true; languages.texlive.enable = true; diff --git a/src/modules/languages/shell.nix b/src/modules/languages/shell.nix new file mode 100644 index 000000000..0c6787b24 --- /dev/null +++ b/src/modules/languages/shell.nix @@ -0,0 +1,19 @@ +{ pkgs, config, lib, ... }: + +let + cfg = config.languages.shell; +in +{ + options.languages.shell = { + enable = lib.mkEnableOption "tools for shell development"; + }; + + config = lib.mkIf cfg.enable { + packages = with pkgs; [ + bats + nodePackages.bash-language-server + shellcheck + shfmt + ]; + }; +}