1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/by-name/gr/gramma/package.nix
2024-09-19 19:25:00 +02:00

51 lines
1.2 KiB
Nix

{
lib,
stdenvNoCC,
fetchYarnDeps,
fetchFromGitHub,
yarnConfigHook,
yarnInstallHook,
nodejs,
nix-update-script,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "gramma";
version = "1.6.0";
src = fetchFromGitHub {
owner = "caderek";
repo = "gramma";
rev = "refs/tags/v${finalAttrs.version}";
hash = "sha256-gfBwKpsttdhjD/Opn8251qskURpwLX2S5NSbpwP3hFg=";
};
postPatch = ''
# Set a script name to avoid yargs using cli.js as $0
substituteInPlace src/cli.js \
--replace-fail '.demandCommand()' '.demandCommand().scriptName("gramma")'
'';
offlineCache = fetchYarnDeps {
yarnLock = "${finalAttrs.src}/yarn.lock";
hash = "sha256-FuR6wUhAaej/vMgjAlICMEj1pPf+7PFrdu2lTFshIkg=";
};
nativeBuildInputs = [
yarnConfigHook
yarnInstallHook
nodejs
];
passthru.updateScript = nix-update-script { };
meta = {
description = "command-line grammar checker";
homepage = "https://caderek.github.io/gramma/";
changelog = "https://github.com/caderek/gramma/releases/tag/v${finalAttrs.version}";
license = lib.licenses.isc;
mainProgram = "gramma";
maintainers = with lib.maintainers; [ pyrox0 ];
};
})