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