Skip to content

Commit

Permalink
Merge pull request #743 from mmlb/add-language-shell
Browse files Browse the repository at this point in the history
Add shell language support
  • Loading branch information
domenkozar authored Jul 21, 2023
2 parents f415d8c + 01721ce commit e8e82d5
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/shell/.test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
set -ex
bash-language-server --version
bats --version
shellcheck --version
shfmt --version
11 changes: 11 additions & 0 deletions examples/shell/devenv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{ pkgs, ... }:

{
languages.shell.enable = true;
enterShell = ''
bash-language-server --version
bats --version
shellcheck --version
shfmt --version
'';
}
3 changes: 3 additions & 0 deletions examples/shell/devenv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
inputs:
nixpkgs:
url: github:NixOS/nixpkgs/nixpkgs-unstable
1 change: 1 addition & 0 deletions examples/supported-languages/devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
19 changes: 19 additions & 0 deletions src/modules/languages/shell.nix
Original file line number Diff line number Diff line change
@@ -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
];
};
}

0 comments on commit e8e82d5

Please sign in to comment.