mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-05 13:23:17 +00:00
34 lines
647 B
Nix
34 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;
|
|
}
|