2022-12-30 02:23:45 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
2023-01-01 01:07:08 +00:00
|
|
|
, installShellFiles
|
2022-12-30 02:23:45 +00:00
|
|
|
, makeWrapper
|
|
|
|
, gitMinimal
|
|
|
|
, mercurial
|
|
|
|
, nix
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "nurl";
|
2023-01-03 19:56:47 +00:00
|
|
|
version = "0.3.3";
|
2022-12-30 02:23:45 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nix-community";
|
|
|
|
repo = "nurl";
|
|
|
|
rev = "v${version}";
|
2023-01-03 19:56:47 +00:00
|
|
|
hash = "sha256-bZJlhGbRjhrLk8J0WJq3NCY71MZYsxy8f1ippguOsIM=";
|
2022-12-30 02:23:45 +00:00
|
|
|
};
|
|
|
|
|
2023-01-03 19:56:47 +00:00
|
|
|
cargoSha256 = "sha256-904IOaovvSOuMyXIxZjaG2iqUoz5qq3hftLGaiA8h0U=";
|
2022-12-30 02:23:45 +00:00
|
|
|
|
2023-01-01 01:07:08 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
makeWrapper
|
|
|
|
];
|
2022-12-30 02:23:45 +00:00
|
|
|
|
2023-01-03 19:56:47 +00:00
|
|
|
# tests require internet access
|
|
|
|
doCheck = false;
|
|
|
|
|
2022-12-30 02:23:45 +00:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/nurl \
|
|
|
|
--prefix PATH : ${lib.makeBinPath [ gitMinimal mercurial nix ]}
|
2023-01-01 01:07:08 +00:00
|
|
|
installManPage artifacts/nurl.1
|
|
|
|
installShellCompletion artifacts/nurl.{bash,fish} --zsh artifacts/_nurl
|
2022-12-30 02:23:45 +00:00
|
|
|
'';
|
|
|
|
|
2023-01-01 01:07:08 +00:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|