pkgs/build-support/writers: use runCommandLocal for scripts

If we just want to write a non-compiled script (e.g. writeDash), it’s
usually a lot faster just doing it locally. That’s what
`runCommandLocal` was introduced for, so let’s use it in `writers`.
This commit is contained in:
Profpatsch 2020-02-18 19:53:18 +01:00
parent 55e1529335
commit 493c357720

View file

@ -15,7 +15,7 @@ rec {
name = last (builtins.split "/" nameOrPath);
in
pkgs.runCommand name (if (types.str.check content) then {
pkgs.runCommandLocal name (if (types.str.check content) then {
inherit content interpreter;
passAsFile = [ "content" ];
} else {
@ -192,7 +192,7 @@ rec {
{id="";for(i=idx;i<ctx;i++)id=sprintf("%s%s", id, "\t");printf "%s%s\n", id, $0}
'';
writeNginxConfig = name: text: pkgs.runCommand name {
writeNginxConfig = name: text: pkgs.runCommandLocal name {
inherit text;
passAsFile = [ "text" ];
} /* sh */ ''