depot/third_party/nixpkgs/pkgs/tools/misc/zf/default.nix
Default email 504525a148 Project import generated by Copybara.
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
2024-01-02 12:29:13 +01:00

49 lines
1.1 KiB
Nix

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