Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

writeShellApplication: allow substitutions and remote building. #222136

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions pkgs/build-support/trivial-builders.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
andrewhamon marked this conversation as resolved.
Show resolved Hide resolved
}:
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}
Expand Down Expand Up @@ -324,6 +323,8 @@ rec {
inherit name;
executable = true;
destination = "/bin/${name}";
allowSubstitutes = true;
preferLocalBuild = false;
text = ''
#!${runtimeShell}
set -o errexit
Expand Down