about summary refs log tree commit diff
path: root/pkgs/profpatsch/execline/run-execline-tests.nix
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2018-09-22 23:09:03 +0200
committerProfpatsch <mail@profpatsch.de>2018-09-22 23:16:15 +0200
commit0cfe277878425794df5804b71d828161f5a95b43 (patch)
treee8e64cf6039c5c98eb096a1d9fc6be01adbf0b81 /pkgs/profpatsch/execline/run-execline-tests.nix
parent5dcf14e5cd3ac05767326522f64abdffbf26074e (diff)
pkgs.profpatsch: switch to different import scheme
Reference files in `bin` outputs for a derivation as an attribute set,
with renaming capabilities.
Diffstat (limited to 'pkgs/profpatsch/execline/run-execline-tests.nix')
-rw-r--r--pkgs/profpatsch/execline/run-execline-tests.nix27
1 files changed, 12 insertions, 15 deletions
diff --git a/pkgs/profpatsch/execline/run-execline-tests.nix b/pkgs/profpatsch/execline/run-execline-tests.nix
index c2c4c23e..ebfdeb20 100644
--- a/pkgs/profpatsch/execline/run-execline-tests.nix
+++ b/pkgs/profpatsch/execline/run-execline-tests.nix
@@ -1,7 +1,4 @@
-{ stdenv, drvSeqL, runExecline
-, ifCommand, redirfdCommand, s6GrepCommand
-, importasCommand, s6TouchCommand, s6CatCommand
-, execlinebCommand, s6TestCommand, s6ChmodCommand
+{ stdenv, drvSeqL, runExecline, bin
 # https://www.mail-archive.com/skaware@list.skarnet.org/msg01256.html
 , coreutils }:
 
@@ -22,7 +19,7 @@ let
       foreground {
         ${coreutils}/bin/mv $s $out
       }
-      ${s6ChmodCommand} 0755 $out
+      ${bin.s6-chmod} 0755 $out
     '';
    };
 
@@ -35,16 +32,16 @@ let
   fileHasLine = line: file: derivation {
     name = "file-${file.name}-has-line";
     inherit (stdenv) system;
-    builder = ifCommand;
+    builder = bin.execlineIf;
     args =
       (block [
-        redirfdCommand "-r" "0" file   # read file to stdin
-        s6GrepCommand "-F" "-q" line      # and grep for the line
+        bin.redirfd "-r" "0" file   # read file to stdin
+        bin.s6-grep "-F" "-q" line   # and grep for the line
       ])
       ++ [
         # if the block succeeded, touch $out
-        importasCommand "-ui" "out" "out"
-        s6TouchCommand "$out"
+        bin.importas "-ui" "out" "out"
+        bin.s6-touch "$out"
       ];
   };
 
@@ -53,7 +50,7 @@ let
     name = "basic";
     execline = ''
       importas -ui out out
-      ${s6TouchCommand} $out
+      ${bin.s6-touch} $out
     '';
   };
 
@@ -65,21 +62,21 @@ let
       importas -ui out out
       # this pipes stdout of s6-cat to $out
       # and s6-cat redirects from stdin to stdout
-      redirfd -w 1 $out ${s6CatCommand}
+      redirfd -w 1 $out ${bin.s6-cat}
     '';
   });
 
   wrapWithVar = runExecline {
     name = "wrap-with-var";
     builderWrapper = writeScript "var-wrapper" ''
-      #!${execlinebCommand} -S0
+      #!${bin.execlineb} -S0
       export myvar myvalue $@
     '';
     execline = ''
       importas -ui v myvar
-      if { ${s6TestCommand} myvalue = $v }
+      if { ${bin.s6-test} myvalue = $v }
         importas out out
-        ${s6TouchCommand} $out
+        ${bin.s6-touch} $out
     '';
   };