about summary refs log tree commit diff
path: root/pkgs/profpatsch/execline/run-execline.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/profpatsch/execline/run-execline.nix')
-rw-r--r--pkgs/profpatsch/execline/run-execline.nix19
1 files changed, 13 insertions, 6 deletions
diff --git a/pkgs/profpatsch/execline/run-execline.nix b/pkgs/profpatsch/execline/run-execline.nix
index dbc6f4fd..2efe43d6 100644
--- a/pkgs/profpatsch/execline/run-execline.nix
+++ b/pkgs/profpatsch/execline/run-execline.nix
@@ -1,15 +1,18 @@
-{ stdenv, bin }:
-{ name
-# the execline script as string
-, execline
+{ stdenv, bin, lib }:
+name:
+{
 # a string to pass as stdin to the execline script
-, stdin ? ""
+stdin ? ""
 # a program wrapping the acutal execline invocation;
 # should be in Bernstein-chaining style
 , builderWrapper ? bin.exec
 # additional arguments to pass to the derivation
 , derivationArgs ? {}
 }:
+# the execline script as a nested list of string,
+# representing the blocks;
+# see docs of `escapeExecline`.
+ execline:
 
 # those arguments can’t be overwritten
 assert !derivationArgs ? system;
@@ -18,6 +21,7 @@ assert !derivationArgs ? builder;
 assert !derivationArgs ? args;
 
 derivation (derivationArgs // {
+  # TODO: what about cross?
   inherit (stdenv) system;
   inherit name;
 
@@ -26,7 +30,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"