writeShellApplication: allow substitutions and remote building.
Unlike most other trivial builders, writeShellApplication has a relatively heavy checkphase that invokes shellcheck. On my system, a small writeShellApplication takes over 1 second to build. This PR allows substitutions and stops preferring local builds for writeShellApplication.
This commit is contained in:
parent
51f4624476
commit
e929a99848
1 changed files with 5 additions and 4 deletions
|
@ -132,13 +132,12 @@ rec {
|
|||
, destination ? "" # relative path appended to $out eg "/bin/foo"
|
||||
, checkPhase ? "" # syntax checks, e.g. for scripts
|
||||
, meta ? { }
|
||||
, allowSubstitutes ? false
|
||||
, preferLocalBuild ? true
|
||||
}:
|
||||
runCommand name
|
||||
{ inherit text executable checkPhase meta;
|
||||
{ inherit text executable checkPhase meta allowSubstitutes preferLocalBuild;
|
||||
passAsFile = [ "text" ];
|
||||
# Pointless to do this on a remote machine.
|
||||
preferLocalBuild = true;
|
||||
allowSubstitutes = false;
|
||||
}
|
||||
''
|
||||
target=$out${lib.escapeShellArg destination}
|
||||
|
@ -324,6 +323,8 @@ rec {
|
|||
inherit name;
|
||||
executable = true;
|
||||
destination = "/bin/${name}";
|
||||
allowSubstitutes = true;
|
||||
preferLocalBuild = false;
|
||||
text = ''
|
||||
#!${runtimeShell}
|
||||
set -o errexit
|
||||
|
|
Loading…
Reference in a new issue