Skip to content

Commit

Permalink
micro.wrapper: init
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersonTorres committed Sep 4, 2024
1 parent bc448e7 commit c16c239
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkgs/by-name/mi/micro/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ let
inherit callPackage;
directory = ./tests;
};
wrapper = callPackage ./wrapper.nix { micro = self; };
};

meta = {
Expand Down
33 changes: 33 additions & 0 deletions pkgs/by-name/mi/micro/wrapper.nix
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit c16c239

Please sign in to comment.