Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shell language support #743

Merged
merged 1 commit into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
];
};
}
Loading