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

30 lines
588 B
Nix
Raw Normal View History

{ pkgs, stdenvNoCC }:
2025-03-15 12:53:27 +01:00
with pkgs;
with stdenvNoCC;
2025-03-15 12:53:27 +01:00
mkDerivation {
pname = "nix-store-fuzzy-find";
version = "2026-04-29";
2025-03-15 12:53:27 +01:00
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
}