2022-12-30 03:23:45 +01:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
2023-01-01 02:07:08 +01:00
|
|
|
, installShellFiles
|
2023-04-15 22:43:39 +02:00
|
|
|
, makeBinaryWrapper
|
2023-01-11 02:52:13 +01:00
|
|
|
, stdenv
|
|
|
|
, darwin
|
2022-12-30 03:23:45 +01:00
|
|
|
, gitMinimal
|
|
|
|
, mercurial
|
2023-08-07 01:29:01 +02:00
|
|
|
, nix
|
2022-12-30 03:23:45 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "nurl";
|
2023-07-21 23:22:37 +02:00
|
|
|
version = "0.3.13";
|
2022-12-30 03:23:45 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nix-community";
|
|
|
|
repo = "nurl";
|
|
|
|
rev = "v${version}";
|
2023-07-21 23:22:37 +02:00
|
|
|
hash = "sha256-rVqF+16esE27G7GS55RT91tD4x/GAzfVlIR0AgSknz0=";
|
2022-12-30 03:23:45 +01:00
|
|
|
};
|
|
|
|
|
2023-03-26 00:16:46 +01:00
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
2023-07-21 23:22:37 +02:00
|
|
|
"nix-compat-0.1.0" = "sha256-xHwBlmTggcZBFSh4EOY888AbmGQxhwvheJSStgpAj48=";
|
2023-03-26 00:16:46 +01:00
|
|
|
};
|
|
|
|
};
|
2022-12-30 03:23:45 +01:00
|
|
|
|
2023-01-01 02:07:08 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
2023-04-15 22:43:39 +02:00
|
|
|
makeBinaryWrapper
|
2023-01-01 02:07:08 +01:00
|
|
|
];
|
2022-12-30 03:23:45 +01:00
|
|
|
|
2023-01-11 02:52:13 +01:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
|
|
|
darwin.apple_sdk.frameworks.Security
|
|
|
|
];
|
|
|
|
|
2023-01-03 20:56:47 +01:00
|
|
|
# tests require internet access
|
|
|
|
doCheck = false;
|
|
|
|
|
2022-12-30 03:23:45 +01:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/nurl \
|
2023-08-07 01:29:01 +02:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ gitMinimal mercurial nix ]}
|
2023-01-01 02:07:08 +01:00
|
|
|
installManPage artifacts/nurl.1
|
|
|
|
installShellCompletion artifacts/nurl.{bash,fish} --zsh artifacts/_nurl
|
2022-12-30 03:23:45 +01:00
|
|
|
'';
|
|
|
|
|
2023-04-15 22:43:39 +02:00
|
|
|
env = {
|
|
|
|
GEN_ARTIFACTS = "artifacts";
|
|
|
|
};
|
2023-01-01 02:07:08 +01:00
|
|
|
|
2022-12-30 03:23:45 +01: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 ];
|
2023-07-31 21:49:41 +02:00
|
|
|
mainProgram = "nurl";
|
2022-12-30 03:23:45 +01:00
|
|
|
};
|
|
|
|
}
|