pkgs/mkScriptOverride: init
This commit is contained in:
parent
460b58d6dd
commit
f89c97d3a1
1 changed files with 29 additions and 0 deletions
29
pkgs/by-name/mk/mkScriptOverride/package.nix
Normal file
29
pkgs/by-name/mk/mkScriptOverride/package.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
lib,
|
||||
stdenv,
|
||||
}:
|
||||
|
||||
{
|
||||
src,
|
||||
script,
|
||||
...
|
||||
} @ args:
|
||||
lib.hiPrio (stdenv.mkDerivation (
|
||||
{
|
||||
src = src;
|
||||
name = "${src.name}-script-override";
|
||||
phases = [ "installPhase" "scriptOverridePhase" ];
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
cp -r $src $out
|
||||
chmod u+w -R $out
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
scriptOverridePhase = script;
|
||||
} // lib.removeAttrs args [
|
||||
"pkg"
|
||||
"commands"
|
||||
]
|
||||
))
|
Loading…
Reference in a new issue