pkgs/mkWrappedExecutable: factor out to its own package
This commit is contained in:
parent
6e76c7422a
commit
8c1eb9dec3
2 changed files with 23 additions and 17 deletions
22
pkgs/by-name/mk/mkWrappedExecutable/package.nix
Normal file
22
pkgs/by-name/mk/mkWrappedExecutable/package.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
lib,
|
||||
makeWrapper,
|
||||
stdenv
|
||||
}:
|
||||
|
||||
/*
|
||||
pkg: package - nixpkgs package
|
||||
exe: string - executable (under bin) in pkg
|
||||
wrapperArgs: string[] - arguments to pass to the wrapper
|
||||
*/
|
||||
{ pkg, exe ? pkg.meta.mainProgram, wrapperArgs }:
|
||||
lib.hiPrio (stdenv.mkDerivation {
|
||||
inherit wrapperArgs;
|
||||
name = "${pkg.name}-wrap-${exe}";
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
phases = ["installPhase"];
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
makeWrapper ${pkg}/bin/${exe} $out/bin/${exe} $wrapperArgs
|
||||
'';
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue