summary refs log tree commit diff
path: root/pkgs/tools/misc/zf/default.nix
blob: 041f2a3989ccb48826bae172a0027ad7eb79e2dc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{ lib
, stdenv
, fetchFromGitHub
, installShellFiles
, testers
, zig_0_10
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "zf";
  version = "0.8.0";

  src = fetchFromGitHub {
    owner = "natecraddock";
    repo = "zf";
    rev = "refs/tags/${finalAttrs.version}";
    fetchSubmodules = true;
    hash = "sha256-MzlSU5x2lb6PJZ/iNAi2aebfuClBprlfHMIG/4OPmuc=";
  };

  nativeBuildInputs = [
    installShellFiles
    zig_0_10.hook
  ];

  doCheck = false; # it's failing somehow

  postInstall = ''
    installManPage doc/zf.1
    installShellCompletion \
      --bash complete/zf \
      --fish complete/zf.fish \
      --zsh complete/_zf
  '';

  passthru.tests.version = testers.testVersion { package = finalAttrs.zf; };

  meta = {
    homepage = "https://github.com/natecraddock/zf";
    description = "A commandline fuzzy finder that prioritizes matches on filenames";
    license = lib.licenses.mit;
    platforms = lib.platforms.unix;
    maintainers = with lib.maintainers; [ dit7ya mmlb ];
  };
})