pkgs/mk{WrappedExecutable; ScriptOverride}: remove

This commit is contained in:
Wroclaw 2025-02-09 09:30:20 +01:00
parent b5e40f0d64
commit e176ea9483
2 changed files with 0 additions and 53 deletions

View file

@ -1,31 +0,0 @@
{
lib,
stdenv,
}:
{
src,
script,
...
} @ args:
lib.hiPrio (stdenv.mkDerivation (
{
src = src;
name = if lib.isDerivation src
then "${src.name}-script-override"
else "${builtins.baseNameOf src}-script-override";
phases = [ "installPhase" "scriptOverridePhase" ];
installPhase = ''
runHook preInstall
cp -r $src $out
chmod u+w -R $out
runHook postInstall
'';
scriptOverridePhase = script;
} // lib.removeAttrs args [
"src"
"script"
]
))

View file

@ -1,22 +0,0 @@
{
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
'';
})