11 stdenv.mkDerivation (finalAttrs: {
12 pname = "bash-language-server";
15 src = fetchFromGitHub {
17 repo = "bash-language-server";
18 rev = "server-${finalAttrs.version}";
19 hash = "sha256-yJ81oGd9aNsWQMLvDSgMVVH1//Mw/SVFYFIPsJTQYzE=";
22 pnpmDeps = pnpm_8.fetchDeps {
23 inherit (finalAttrs) pname version src;
24 hash = "sha256-W25xehcxncBs9QgQBt17F5YHK0b+GDEmt27XzTkyYWg=";
33 npmBuildScript = "compile";
34 # We are only interested in the bash-language-server executable, which is
35 # part of the `./server` directory. From some reason, the `./vscode-client`
36 # directory is not included in upstream's `pnpm-workspace.yaml`, so perhaps
37 # that's why our ${pnpmDeps} don't include the dependencies required for it.
40 substituteInPlace tsconfig.json \
41 --replace-fail '{ "path": "./vscode-client" },' ""
48 --frozen-lockfile --ignore-script \
49 --filter=bash-language-server \
50 deploy $out/lib/bash-language-server
51 # Cleanup directory a bit, to save space, and make fixup phase a bit faster
52 rm -r $out/lib/bash-language-server/src
53 find $out/lib/bash-language-server -name '*.ts' -delete
55 $out/lib/bash-language-server/node_modules/.bin \
56 $out/lib/bash-language-server/node_modules/*/bin
58 # Create the executable, based upon what happens in npmHooks.npmInstallHook
59 makeWrapper ${lib.getExe nodejs} $out/bin/bash-language-server \
60 --prefix PATH : ${lib.makeBinPath [ shellcheck ]} \
62 --add-flags $out/lib/bash-language-server/out/cli.js
68 description = "A language server for Bash";
69 homepage = "https://github.com/bash-lsp/bash-language-server";
70 license = licenses.mit;
71 maintainers = with maintainers; [ doronbehar ];
72 mainProgram = "bash-language-server";
73 platforms = platforms.all;