From a4a4937cb9ab6bf3374ec097b0b57aa1d007d5d6 Mon Sep 17 00:00:00 2001 From: Reinout Meliesie Date: Sat, 15 Mar 2025 12:53:27 +0100 Subject: [PATCH] Add nix-store-fuzzy-find package --- nixos-module.nix | 4 +++ packages/nix-store-fuzzy-find/package.nix | 34 +++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 packages/nix-store-fuzzy-find/package.nix diff --git a/nixos-module.nix b/nixos-module.nix index ae84001..6544d04 100644 --- a/nixos-module.nix +++ b/nixos-module.nix @@ -20,6 +20,10 @@ with pkgs ; import packages/journalctl-last-invocation/package.nix ) {} ; + nix-store-fuzzy-find = callPackage ( + import packages/nix-store-fuzzy-find/package.nix + ) {} ; + python = { bw-file-resubmit = callPackage ( diff --git a/packages/nix-store-fuzzy-find/package.nix b/packages/nix-store-fuzzy-find/package.nix new file mode 100644 index 0000000..98d8bcd --- /dev/null +++ b/packages/nix-store-fuzzy-find/package.nix @@ -0,0 +1,34 @@ +{ + pkgs , + stdenv , +} : + +with pkgs ; +with stdenv ; + +mkDerivation { + pname = "nix-store-fuzzy-find" ; + version = "2025-03-09" ; + + dontUnpack = true ; + dontPatch = true ; + dontConfigure = true ; + dontBuild = true ; + + installPhase = '' + runHook preInstall + + mkdir -p $out/bin + + cat <<- EOF > $out/bin/nix-store-fuzzy-find + #!${bash}/bin/sh + + exec ${findutils}/bin/find /nix/store -maxdepth 1 -type d -name "*-\$1-*" + EOF + + # TODO: Check if Nix does this for us + chmod +x $out/bin/* + + runHook postInstall + '' ; +}