nixpkgs/pkgs/by-name/nr/nrr/package.nix
2024-04-19 10:52:06 +08:00

44 lines
918 B
Nix

{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, darwin
, pkg-config
, libiconv
, nrxAlias ? true
}:
rustPlatform.buildRustPackage rec {
pname = "nrr";
version = "0.9.0";
src = fetchFromGitHub {
owner = "ryanccn";
repo = "nrr";
rev = "v${version}";
hash = "sha256-94BeBCYCxZBoOp6xo4I/uxd6ULjIfmF4nw/vUWoaEpo=";
};
cargoHash = "sha256-DTQTIAk914XC+LecQTXk1TdBc/5sMFG8KiD9lO5HLiM=";
buildInputs = lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.CoreFoundation
darwin.apple_sdk.frameworks.Security
darwin.apple_sdk.frameworks.IOKit
libiconv
];
nativeBuildInputs = [
pkg-config
];
postInstall = lib.optionalString nrxAlias "ln -s $out/bin/nr{r,x}";
meta = with lib; {
description = "Minimal, blazing fast npm scripts runner";
maintainers = with maintainers; [ ryanccn ];
license = licenses.gpl3Only;
mainProgram = "nrr";
};
}