depot/third_party/nixpkgs/pkgs/by-name/mi/micro/wrapper.nix
Default email 159e378cbb Project import generated by Copybara.
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
2024-09-19 17:19:46 +03:00

33 lines
647 B
Nix

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