about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/misc/zf/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/misc/zf/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/misc/zf/default.nix49
1 files changed, 49 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/misc/zf/default.nix b/nixpkgs/pkgs/tools/misc/zf/default.nix
new file mode 100644
index 000000000000..402fbbb5f697
--- /dev/null
+++ b/nixpkgs/pkgs/tools/misc/zf/default.nix
@@ -0,0 +1,49 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, installShellFiles
+, testers
+, zig_0_11
+, callPackage
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "zf";
+  version = "0.9.1";
+
+  src = fetchFromGitHub {
+    owner = "natecraddock";
+    repo = "zf";
+    rev = "refs/tags/${finalAttrs.version}";
+    hash = "sha256-JPv/59ELh+CS1/akuLNy0qSimMEJsypPO8hiHFAOirI=";
+  };
+
+  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";
+  };
+})