2022-12-17 10:02:37 +00:00
|
|
|
{ lib
|
|
|
|
, buildNpmPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, nix-update-script
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildNpmPackage rec {
|
|
|
|
pname = "ansible-language-server";
|
2023-08-04 22:07:22 +00:00
|
|
|
version = "1.2.1";
|
2022-12-17 10:02:37 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ansible";
|
|
|
|
repo = pname;
|
|
|
|
rev = "refs/tags/v${version}";
|
2023-08-04 22:07:22 +00:00
|
|
|
hash = "sha256-e6cOWoryOxWnl8q62rlGmSgwLVnoxLMwNFoGlUZw2bQ=";
|
2022-12-17 10:02:37 +00:00
|
|
|
};
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
npmDepsHash = "sha256-Lzwj0/2fxa44DJBsgDPa43AbRxggqh881X/DFnlNLig=";
|
2022-12-17 10:02:37 +00:00
|
|
|
npmBuildScript = "compile";
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
# We remove/ignore the prepare and prepack scripts because they run the
|
2022-12-17 10:02:37 +00:00
|
|
|
# build script, and therefore are redundant.
|
|
|
|
#
|
|
|
|
# Additionally, the prepack script runs npm ci in addition to the
|
|
|
|
# build script. Directly before npm pack is run, we make npm unaware
|
|
|
|
# of the dependency cache, causing the npm ci invocation to fail,
|
|
|
|
# wiping out node_modules, which causes a mysterious error stating that tsc isn't installed.
|
|
|
|
postPatch = ''
|
|
|
|
sed -i '/"prepare"/d' package.json
|
|
|
|
sed -i '/"prepack"/d' package.json
|
|
|
|
'';
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
npmPackFlags = [ "--ignore-scripts" ];
|
2022-12-28 21:21:41 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
2022-12-17 10:02:37 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
changelog = "https://github.com/ansible/ansible-language-server/releases/tag/v${version}";
|
|
|
|
description = "Ansible Language Server";
|
|
|
|
homepage = "https://github.com/ansible/ansible-language-server";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ hexa ];
|
|
|
|
};
|
|
|
|
}
|