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-05-24 13:37:59 +00:00
|
|
|
version = "0.3.12";
|
2023-01-11 07:51:40 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nix-community";
|
|
|
|
repo = "nurl";
|
|
|
|
rev = "v${version}";
|
2023-05-24 13:37:59 +00:00
|
|
|
hash = "sha256-L9lYFPUk8B34vEtHZZ/9v1cEzQXoNo3Rc0e9/lwMrU0=";
|
2023-01-11 07:51:40 +00:00
|
|
|
};
|
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
2023-05-24 13:37:59 +00:00
|
|
|
"nix-compat-0.1.0" = "sha256-8QP9qEUtCvSvv1LcMPg04RrSagpINZeh4o2CBMzUjn4=";
|
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 ];
|
|
|
|
};
|
|
|
|
}
|