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