2023-01-11 07:51:40 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
2023-04-29 16:46:19 +00:00
|
|
|
, makeBinaryWrapper
|
2023-01-11 07:51:40 +00:00
|
|
|
, stdenv
|
|
|
|
, darwin
|
|
|
|
, gitMinimal
|
|
|
|
, mercurial
|
2023-04-29 16:46:19 +00:00
|
|
|
, nixVersions
|
2023-01-11 07:51:40 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "nurl";
|
2023-04-29 16:46:19 +00:00
|
|
|
version = "0.3.11";
|
2023-01-11 07:51:40 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nix-community";
|
|
|
|
repo = "nurl";
|
|
|
|
rev = "v${version}";
|
2023-04-29 16:46:19 +00:00
|
|
|
hash = "sha256-erIC7JAluPs/ToXxjpSpSI6vB1hJVXywQTT+aARenOc=";
|
2023-01-11 07:51:40 +00:00
|
|
|
};
|
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
2023-04-29 16:46:19 +00:00
|
|
|
"nix-compat-0.1.0" = "sha256-J9MedxcVcH5DdRxdqD8cb5YRC/SjZ0vQTCFBMLVMQPo=";
|
2023-03-27 19:17:25 +00:00
|
|
|
};
|
|
|
|
};
|
2023-01-11 07:51:40 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
2023-04-29 16:46:19 +00:00
|
|
|
makeBinaryWrapper
|
2023-01-11 07:51:40 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
|
|
|
darwin.apple_sdk.frameworks.Security
|
|
|
|
];
|
|
|
|
|
|
|
|
# tests require internet access
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/nurl \
|
2023-04-29 16:46:19 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ gitMinimal mercurial nixVersions.unstable ]}
|
2023-01-11 07:51:40 +00:00
|
|
|
installManPage artifacts/nurl.1
|
|
|
|
installShellCompletion artifacts/nurl.{bash,fish} --zsh artifacts/_nurl
|
|
|
|
'';
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
env = {
|
|
|
|
GEN_ARTIFACTS = "artifacts";
|
|
|
|
};
|
2023-01-11 07:51:40 +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 ];
|
|
|
|
};
|
|
|
|
}
|