30 lines
580 B
Nix
30 lines
580 B
Nix
{ pkgs, stdenv }:
|
|
|
|
with pkgs;
|
|
with stdenv;
|
|
|
|
mkDerivation {
|
|
pname = "nix-store-fuzzy-find";
|
|
version = "2026-04-29";
|
|
|
|
phases = [ "createSourcesPhase" "installPhase" ];
|
|
|
|
createSourcesPhase = ''
|
|
# Same directory structure that `unpackPhase` would use.
|
|
mkdir -p /build/source
|
|
|
|
cat <<- EOF > /build/source/nix-store-fuzzy-find
|
|
#!${bash}/bin/sh
|
|
|
|
exec ${findutils}/bin/find /nix/store -maxdepth 1 -type d -name "*-\$1-*"
|
|
EOF
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
|
|
cp /build/source/nix-store-fuzzy-find $out/bin/
|
|
|
|
chmod +x $out/bin/nix-store-fuzzy-find
|
|
'';
|
|
}
|