summary refs log tree commit diff
path: root/pkgs/tools/misc/zf/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/misc/zf/default.nix')
-rw-r--r--pkgs/tools/misc/zf/default.nix44
1 files changed, 44 insertions, 0 deletions
diff --git a/pkgs/tools/misc/zf/default.nix b/pkgs/tools/misc/zf/default.nix
new file mode 100644
index 0000000000000..98cdae6807fbc
--- /dev/null
+++ b/pkgs/tools/misc/zf/default.nix
@@ -0,0 +1,44 @@
+{
+  lib,
+  stdenv,
+  fetchFromGitHub,
+  zig,
+  testers,
+  zf,
+}:
+stdenv.mkDerivation rec {
+  pname = "zf";
+  version = "0.8.0";
+
+  src = fetchFromGitHub {
+    owner = "natecraddock";
+    repo = pname;
+    rev = "refs/tags/${version}";
+    fetchSubmodules = true;
+    hash = "sha256-MzlSU5x2lb6PJZ/iNAi2aebfuClBprlfHMIG/4OPmuc=";
+  };
+
+  nativeBuildInputs = [ zig ];
+
+  dontConfigure = true;
+
+  preBuild = ''
+    export HOME=$TMPDIR
+  '';
+
+  installPhase = ''
+    runHook preInstall
+    zig build -Drelease-safe -Dcpu=baseline --prefix $out install
+    runHook postInstall
+  '';
+
+  passthru.tests.version = testers.testVersion {package = zf;};
+
+  meta = with lib; {
+    homepage = "https://github.com/natecraddock/zf";
+    description = "A commandline fuzzy finder that prioritizes matches on filenames";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ dit7ya mmlb ];
+  };
+}