depot/third_party/nixpkgs/pkgs/by-name/cz/czkawka/wrapper.nix

33 lines
678 B
Nix

{
lib,
czkawka,
makeWrapper,
symlinkJoin,
# configurable options
extraPackages ? [ ],
}:
symlinkJoin {
name = "czkawka-wrapped-${czkawka.version}";
inherit (czkawka) pname version outputs;
nativeBuildInputs = [ makeWrapper ];
paths = [ czkawka ];
postBuild = ''
${lib.concatMapStringsSep "\n" (
output: "ln --symbolic --no-target-directory ${czkawka.${output}} \$${output}"
) (lib.remove "out" czkawka.outputs)}
pushd $out/bin
for f in *; do
rm -v $f
makeWrapper ${lib.getBin czkawka}/bin/$f $out/bin/$f \
--prefix PATH ":" "${lib.makeBinPath extraPackages}"
done
popd
'';
meta = czkawka.meta;
}