Files
nixpkgs/pkgs/by-name/cs/cspell/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

81 lines
1.5 KiB
Nix

{
lib,
stdenv,
nodejs,
pnpm_10,
fetchFromGitHub,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cspell";
version = "9.2.1";
src = fetchFromGitHub {
owner = "streetsidesoftware";
repo = "cspell";
tag = "v${finalAttrs.version}";
hash = "sha256-xQCE6YWCvlWjcpf2nCBjbdI76qejlvHdWiUCD4SZhRg=";
};
patches = [
./inject-workplace-deps.patch
];
pnpmWorkspaces = [ "cspell..." ];
prePnpmInstall = ''
pnpm config set --location=project inject-workplace-packages true
'';
pnpmDeps = pnpm_10.fetchDeps {
inherit (finalAttrs)
pname
version
src
pnpmWorkspaces
patches
prePnpmInstall
;
fetcherVersion = 2;
hash = "sha256-aE7DHyXPLziVjW9bBL98fFRiPwOFIyU5edbj8rEws6U=";
};
nativeBuildInputs = [
nodejs
pnpm_10.configHook
];
buildInputs = [
nodejs
];
buildPhase = ''
runHook preBuild
pnpm --filter "cspell..." build
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/lib/node_modules/cspell
mkdir $out/bin
pnpm --filter="cspell" --offline --prod deploy $out/lib/node_modules/cspell
ln -s $out/lib/node_modules/cspell/bin.mjs $out/bin/cspell
runHook postInstall
'';
meta = {
description = "Spell checker for code";
homepage = "https://cspell.org";
changelog = "https://github.com/streetsidesoftware/cspell/releases/tag/v${finalAttrs.version}";
license = lib.licenses.mit;
mainProgram = "cspell";
maintainers = [ lib.maintainers.pyrox0 ];
};
})