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

31 lines
588 B
Nix
Raw Permalink Normal View History

{ pkgs , stdenv } :
2025-03-15 12:53:27 +01:00
with pkgs ;
with stdenv ;
mkDerivation {
pname = "nix-store-fuzzy-find" ;
version = "2025-03-09" ;
phases = [ "createSourcesPhase" "installPhase" ] ;
2025-03-15 12:53:27 +01:00
createSourcesPhase = ''
# Same directory structure that `unpackPhase` would use
mkdir -p /build/source
2025-03-15 12:53:27 +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
'' ;
installPhase = ''
mkdir -p $out/bin
cp /build/source/nix-store-fuzzy-find $out/bin/
2025-03-15 12:53:27 +01:00
chmod +x $out/bin/nix-store-fuzzy-find
2025-03-15 12:53:27 +01:00
'' ;
}