diff options
author | Doron Behar | 2024-08-07 12:37:34 +0000 |
---|---|---|
committer | GitHub | 2024-08-07 12:37:34 +0000 |
commit | d6f7206fe064ac326ab5b44e1308f78b7cbb1fc7 (patch) | |
tree | d738da87e123ca9bda390332cacb017a6bf67119 /pkgs/by-name/as | |
parent | 39e2f7ff995d7e91ceb98e290e8eae2954f19c0d (diff) | |
parent | d128948f8c908057d56078380c797df14b6c4237 (diff) |
Merge pull request #323493 from pyrox0/pnpm-fetchdeps-improve
pnpm.fetchDeps: Add workspace and custom pnpm config commands support
Diffstat (limited to 'pkgs/by-name/as')
-rw-r--r-- | pkgs/by-name/as/astro-language-server/package.nix | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/pkgs/by-name/as/astro-language-server/package.nix b/pkgs/by-name/as/astro-language-server/package.nix new file mode 100644 index 000000000000..9859765bf897 --- /dev/null +++ b/pkgs/by-name/as/astro-language-server/package.nix @@ -0,0 +1,69 @@ +{ + lib, + stdenv, + fetchFromGitHub, + pnpm_8, + nodejs_22, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "astro-language-server"; + version = "2.10.0"; + + src = fetchFromGitHub { + owner = "withastro"; + repo = "language-tools"; + rev = "@astrojs/language-server@${finalAttrs.version}"; + hash = "sha256-WdeQQaC9AVHT+/pXLzaC6MZ6ddHsFSpxoDPHqWvqmiQ="; + }; + + pnpmDeps = pnpm_8.fetchDeps { + inherit (finalAttrs) + pname + version + src + pnpmWorkspace + prePnpmInstall + ; + hash = "sha256-n7HTd/rKxJdQKnty5TeOcyvBU9j/EClQ9IHqbBaEwQE="; + }; + + nativeBuildInputs = [ + nodejs_22 + pnpm_8.configHook + ]; + + buildInputs = [ nodejs_22 ]; + + pnpmWorkspace = "@astrojs/language-server"; + prePnpmInstall = '' + pnpm config set dedupe-peer-dependents false + ''; + + buildPhase = '' + runHook preBuild + + pnpm --filter=@astrojs/language-server build + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out/{bin,lib/astro-language-server} + cp -r {packages,node_modules} $out/lib/astro-language-server + ln -s $out/lib/astro-language-server/packages/language-server/bin/nodeServer.js $out/bin/astro-ls + + runHook postInstall + ''; + + meta = { + description = "The Astro language server"; + homepage = "https://github.com/withastro/language-tools"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ pyrox0 ]; + mainProgram = "astro-ls"; + platforms = lib.platforms.unix; + }; +}) |