From 61dda874aab6fe77d3d71eb4845ba3717e9c80d2 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Thu, 26 Sep 2019 02:40:07 +0200 Subject: 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. --- pkgs/profpatsch/execline/run-execline.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'pkgs/profpatsch/execline/run-execline.nix') 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" -- cgit 1.4.1