nix-packages/packages/nix-store-fuzzy-find/package.nix

30 lines
588 B
Nix

{ pkgs , stdenv } :
with pkgs ;
with stdenv ;
mkDerivation {
pname = "nix-store-fuzzy-find" ;
version = "2025-03-09" ;
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
'' ;
}