mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-19 11:23:29 +00:00
micro.wrapper: init
This commit is contained in:
parent
bc448e7f96
commit
c16c239724
@ -63,6 +63,7 @@ let
|
||||
inherit callPackage;
|
||||
directory = ./tests;
|
||||
};
|
||||
wrapper = callPackage ./wrapper.nix { micro = self; };
|
||||
};
|
||||
|
||||
meta = {
|
||||
|
33
pkgs/by-name/mi/micro/wrapper.nix
Normal file
33
pkgs/by-name/mi/micro/wrapper.nix
Normal file
@ -0,0 +1,33 @@
|
||||
{
|
||||
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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user