nixpkgs/pkgs/by-name/sh/shepherd/package.nix
Alexis Hildebrandt 755b915a15 treewide: Remove indefinite article from meta.description
nix run nixpkgs#silver-searcher -- -G '\.nix$' -0l 'description.*"[Aa]n?' pkgs \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee 's/(description.*")[Aa]n? (.)/\1\U\2/'
2024-06-09 23:07:45 +02:00

77 lines
1.7 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, fetchYarnDeps
, makeWrapper
, nodejs
, fixup-yarn-lock
, yarn
}:
stdenv.mkDerivation rec {
pname = "shepherd";
version = "1.16.0";
src = fetchFromGitHub {
owner = "NerdWalletOSS";
repo = "shepherd";
rev = "v${version}";
hash = "sha256-LY8Vde4YpGuKnQ5UnSOpsQDY7AOyZRziUrfZb5dRiX4=";
};
offlineCache = fetchYarnDeps {
yarnLock = "${src}/yarn.lock";
hash = "sha256-tJXJ8ePr5ArAV+0JcuJsTo/B2PUcgsXfZrSDCpna/9k=";
};
nativeBuildInputs = [
makeWrapper
nodejs
fixup-yarn-lock
yarn
];
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 build
runHook postBuild
'';
installPhase = ''
runHook preInstall
yarn --offline --production install
mkdir -p "$out/lib/node_modules/@nerdwallet/shepherd"
cp -r . "$out/lib/node_modules/@nerdwallet/shepherd"
makeWrapper "${nodejs}/bin/node" "$out/bin/shepherd" \
--add-flags "$out/lib/node_modules/@nerdwallet/shepherd/lib/cli.js"
runHook postInstall
'';
meta = {
changelog = "https://github.com/NerdWalletOSS/shepherd/blob/${src.rev}/CHANGELOG.md";
description = "Utility for applying code changes across many repositories";
homepage = "https://github.com/NerdWalletOSS/shepherd";
license = lib.licenses.asl20;
mainProgram = "shepherd";
maintainers = with lib.maintainers; [ dbirks ];
platforms = lib.platforms.all;
};
}