2025-03-15 14:43:23 +01:00
|
|
|
{ pkgs , stdenv } :
|
2025-03-15 12:53:27 +01:00
|
|
|
|
|
|
|
with pkgs ;
|
|
|
|
with stdenv ;
|
|
|
|
|
|
|
|
mkDerivation {
|
|
|
|
pname = "nix-store-fuzzy-find" ;
|
|
|
|
version = "2025-03-09" ;
|
|
|
|
|
2025-03-15 14:43:23 +01:00
|
|
|
phases = [ "createSourcesPhase" "installPhase" ] ;
|
2025-03-15 12:53:27 +01:00
|
|
|
|
2025-03-15 14:43:23 +01:00
|
|
|
createSourcesPhase = ''
|
|
|
|
# Same directory structure that `unpackPhase` would use
|
|
|
|
mkdir -p /build/source
|
2025-03-15 12:53:27 +01:00
|
|
|
|
2025-03-15 14:43:23 +01:00
|
|
|
cat <<- EOF > /build/source/nix-store-fuzzy-find
|
2025-03-15 12:53:27 +01:00
|
|
|
#!${bash}/bin/sh
|
|
|
|
|
|
|
|
exec ${findutils}/bin/find /nix/store -maxdepth 1 -type d -name "*-\$1-*"
|
|
|
|
EOF
|
2025-03-15 14:43:23 +01:00
|
|
|
'' ;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
|
|
|
|
cp /build/source/nix-store-fuzzy-find $out/bin/
|
2025-03-15 12:53:27 +01:00
|
|
|
|
2025-03-15 14:43:23 +01:00
|
|
|
chmod +x $out/bin/nix-store-fuzzy-find
|
2025-03-15 12:53:27 +01:00
|
|
|
'' ;
|
|
|
|
}
|