nixpkgs/pkgs/tools/misc/nurl/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

63 lines
1.4 KiB
Nix
Raw Normal View History

2022-12-30 02:23:45 +00:00
{ lib
, rustPlatform
, fetchFromGitHub
, installShellFiles
, makeBinaryWrapper
, stdenv
, darwin
2022-12-30 02:23:45 +00:00
, gitMinimal
, mercurial
2023-08-06 23:29:01 +00:00
, nix
2022-12-30 02:23:45 +00:00
}:
rustPlatform.buildRustPackage rec {
pname = "nurl";
version = "0.3.13";
2022-12-30 02:23:45 +00:00
src = fetchFromGitHub {
owner = "nix-community";
repo = "nurl";
rev = "v${version}";
hash = "sha256-rVqF+16esE27G7GS55RT91tD4x/GAzfVlIR0AgSknz0=";
2022-12-30 02:23:45 +00:00
};
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"nix-compat-0.1.0" = "sha256-xHwBlmTggcZBFSh4EOY888AbmGQxhwvheJSStgpAj48=";
};
};
2022-12-30 02:23:45 +00:00
nativeBuildInputs = [
installShellFiles
makeBinaryWrapper
];
2022-12-30 02:23:45 +00:00
buildInputs = lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
];
# tests require internet access
doCheck = false;
2022-12-30 02:23:45 +00:00
postInstall = ''
wrapProgram $out/bin/nurl \
2023-08-06 23:29:01 +00:00
--prefix PATH : ${lib.makeBinPath [ gitMinimal mercurial nix ]}
installManPage artifacts/nurl.1
installShellCompletion artifacts/nurl.{bash,fish} --zsh artifacts/_nurl
2022-12-30 02:23:45 +00:00
'';
env = {
GEN_ARTIFACTS = "artifacts";
};
2022-12-30 02:23:45 +00:00
meta = with lib; {
description = "Command-line tool to generate Nix fetcher calls from repository URLs";
homepage = "https://github.com/nix-community/nurl";
changelog = "https://github.com/nix-community/nurl/blob/v${version}/CHANGELOG.md";
license = licenses.mpl20;
maintainers = with maintainers; [ figsoda ];
mainProgram = "nurl";
2022-12-30 02:23:45 +00:00
};
}