diff options
author | Profpatsch <mail@profpatsch.de> | 2019-09-26 02:40:07 +0200 |
---|---|---|
committer | Profpatsch <mail@profpatsch.de> | 2019-09-26 03:51:25 +0200 |
commit | 61dda874aab6fe77d3d71eb4845ba3717e9c80d2 (patch) | |
tree | d0b0e9110bd22ac8c7df0dcab88b32642e6eb33d /pkgs/profpatsch/execline/run-execline.nix | |
parent | e8738a02aab262e1016fe270a16ec2c0f66795dc (diff) |
pkgs/profpatsch/runExecline: move to list
We can auto-escape execlines correctly if we model them as nix-style lists, so we shoud certainly do so. It also helps abstraction.
Diffstat (limited to 'pkgs/profpatsch/execline/run-execline.nix')
-rw-r--r-- | pkgs/profpatsch/execline/run-execline.nix | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/pkgs/profpatsch/execline/run-execline.nix b/pkgs/profpatsch/execline/run-execline.nix index 18514464..8983dc8e 100644 --- a/pkgs/profpatsch/execline/run-execline.nix +++ b/pkgs/profpatsch/execline/run-execline.nix @@ -1,6 +1,8 @@ -{ stdenv, bin }: +{ stdenv, bin, lib }: { name -# the execline script as string +# the execline script as a nested list of string, +# representing the blocks; +# see docs of `escapeExecline`. , execline # a string to pass as stdin to the execline script , stdin ? "" @@ -27,7 +29,10 @@ derivation (derivationArgs // { # to pass the script and stdin as envvar; # this might clash with another passed envar, # so we give it a long & unique name - _runExeclineScript = execline; + _runExeclineScript = + let + escape = (import ./escape.nix { inherit lib; }); + in escape.escapeExecline execline; _runExeclineStdin = stdin; passAsFile = [ "_runExeclineScript" |