35 lines
520 B
Nix
35 lines
520 B
Nix
|
{
|
||
|
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
|
||
|
'' ;
|
||
|
}
|