2023-07-10 01:37:39 +02:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, testers
|
2023-09-30 17:49:11 +02:00
|
|
|
, zig_0_11
|
|
|
|
, callPackage
|
2022-08-19 09:38:54 +02:00
|
|
|
}:
|
2023-07-10 01:37:39 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2022-08-19 09:38:54 +02:00
|
|
|
pname = "zf";
|
2024-02-07 08:33:07 +01:00
|
|
|
version = "0.9.1";
|
2022-08-19 09:38:54 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "natecraddock";
|
2023-07-10 01:37:39 +02:00
|
|
|
repo = "zf";
|
|
|
|
rev = "refs/tags/${finalAttrs.version}";
|
2024-02-07 08:33:07 +01:00
|
|
|
hash = "sha256-JPv/59ELh+CS1/akuLNy0qSimMEJsypPO8hiHFAOirI=";
|
2022-08-19 09:38:54 +02:00
|
|
|
};
|
|
|
|
|
2023-07-10 01:37:39 +02:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
2023-09-30 17:49:11 +02:00
|
|
|
zig_0_11.hook
|
2023-07-10 01:37:39 +02:00
|
|
|
];
|
2023-05-16 17:15:00 +02:00
|
|
|
|
2023-09-30 17:49:11 +02:00
|
|
|
postPatch = ''
|
|
|
|
ln -s ${callPackage ./deps.nix { }} $ZIG_GLOBAL_CACHE_DIR/p
|
|
|
|
'';
|
2023-05-16 17:15:00 +02:00
|
|
|
|
2023-07-10 01:37:39 +02:00
|
|
|
postInstall = ''
|
2023-05-16 17:15:00 +02:00
|
|
|
installManPage doc/zf.1
|
|
|
|
installShellCompletion \
|
|
|
|
--bash complete/zf \
|
|
|
|
--fish complete/zf.fish \
|
|
|
|
--zsh complete/_zf
|
2022-08-19 09:38:54 +02:00
|
|
|
'';
|
|
|
|
|
2023-09-30 17:55:38 +02:00
|
|
|
passthru.tests.version = testers.testVersion { package = finalAttrs.finalPackage; };
|
2022-08-19 09:38:54 +02:00
|
|
|
|
2023-07-10 01:37:39 +02:00
|
|
|
meta = {
|
2022-08-19 09:38:54 +02:00
|
|
|
homepage = "https://github.com/natecraddock/zf";
|
|
|
|
description = "A commandline fuzzy finder that prioritizes matches on filenames";
|
2023-09-30 17:49:11 +02:00
|
|
|
changelog = "https://github.com/natecraddock/zf/releases/tag/${finalAttrs.version}";
|
2023-07-10 01:37:39 +02:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
platforms = lib.platforms.unix;
|
2023-09-30 17:49:11 +02:00
|
|
|
maintainers = with lib.maintainers; [ dit7ya figsoda mmlb ];
|
2023-11-27 02:17:53 +01:00
|
|
|
mainProgram = "zf";
|
2022-08-19 09:38:54 +02:00
|
|
|
};
|
2023-07-10 01:37:39 +02:00
|
|
|
})
|