nixpkgs/pkgs/by-name/an/ansible-language-server/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

45 lines
1.4 KiB
Nix

{ lib
, buildNpmPackage
, fetchFromGitHub
, nix-update-script
}:
buildNpmPackage rec {
pname = "ansible-language-server";
version = "1.2.1";
src = fetchFromGitHub {
owner = "ansible";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-e6cOWoryOxWnl8q62rlGmSgwLVnoxLMwNFoGlUZw2bQ=";
};
npmDepsHash = "sha256-Lzwj0/2fxa44DJBsgDPa43AbRxggqh881X/DFnlNLig=";
npmBuildScript = "compile";
# We remove/ignore the prepare and prepack scripts because they run the
# 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
'';
npmPackFlags = [ "--ignore-scripts" ];
passthru.updateScript = nix-update-script { };
meta = with lib; {
changelog = "https://github.com/ansible/ansible-language-server/releases/tag/v${version}";
description = "Ansible Language Server";
mainProgram = "ansible-language-server";
homepage = "https://github.com/ansible/ansible-language-server";
license = licenses.mit;
maintainers = with maintainers; [ hexa ];
};
}