nixpkgs/pkgs/by-name/ya/yaml-language-server/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

80 lines
1.7 KiB
Nix

{
lib,
fetchFromGitHub,
fetchYarnDeps,
fixup-yarn-lock,
makeWrapper,
nodejs,
stdenv,
yarn,
}:
stdenv.mkDerivation rec {
pname = "yaml-language-server";
version = "1.15.0";
src = fetchFromGitHub {
owner = "redhat-developer";
repo = "yaml-language-server";
rev = version;
hash = "sha256-Y3Q/y9UIiy7US8Jl4vxT0Pfw8h3hiXK+Cu9TEQHyAaA=";
};
offlineCache = fetchYarnDeps {
yarnLock = "${src}/yarn.lock";
hash = "sha256-zHcxZ4VU6CGux72Nsy0foU4gFshK1wO/LTfnwOoirmg=";
};
nativeBuildInputs = [
makeWrapper
fixup-yarn-lock
yarn
];
buildInputs = [
nodejs
];
configurePhase = ''
runHook preConfigure
export HOME=$(mktemp -d)
yarn config --offline set yarn-offline-mirror "$offlineCache"
fixup-yarn-lock yarn.lock
yarn --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive install
patchShebangs node_modules
runHook postConfigure
'';
buildPhase = ''
runHook preBuild
yarn --offline compile
yarn --offline build:libs
runHook postBuild
'';
installPhase = ''
runHook preInstall
yarn --offline --production install
mkdir -p $out/bin $out/lib/node_modules/yaml-language-server
cp -r . $out/lib/node_modules/yaml-language-server
ln -s $out/lib/node_modules/yaml-language-server/bin/yaml-language-server $out/bin/
runHook postInstall
'';
meta = {
changelog = "https://github.com/redhat-developer/yaml-language-server/blob/${src.rev}/CHANGELOG.md";
description = "Language Server for YAML Files";
homepage = "https://github.com/redhat-developer/yaml-language-server";
license = lib.licenses.mit;
mainProgram = "yaml-language-server";
maintainers = [ ];
};
}