about summary refs log tree commit diff
path: root/nix/runExecline
diff options
context:
space:
mode:
Diffstat (limited to 'nix/runExecline')
-rw-r--r--nix/runExecline/default.nix13
-rw-r--r--nix/runExecline/tests.nix21
2 files changed, 17 insertions, 17 deletions
diff --git a/nix/runExecline/default.nix b/nix/runExecline/default.nix
index 22d968a1c643..fd92203d0146 100644
--- a/nix/runExecline/default.nix
+++ b/nix/runExecline/default.nix
@@ -6,8 +6,18 @@ let
     inherit pkgs lib;
   };
 
+  runExeclineLocal = name: args: execline:
+    runExecline name
+      (args // {
+        derivationArgs = args.derivationArgs or {} // {
+          preferLocalBuild = true;
+          allowSubstitutes = false;
+        };
+      })
+      execline;
+
   tests = import ./tests.nix {
-    inherit runExecline;
+    inherit runExecline runExeclineLocal;
     inherit (depot.nix) getBins writeScript;
     inherit (pkgs) stdenv coreutils;
     inherit pkgs;
@@ -15,5 +25,6 @@ let
 
 in {
   __functor = _: runExecline;
+  local = runExeclineLocal;
   inherit tests;
 }
diff --git a/nix/runExecline/tests.nix b/nix/runExecline/tests.nix
index a8f91f3cf3ae..d2f5a1780c16 100644
--- a/nix/runExecline/tests.nix
+++ b/nix/runExecline/tests.nix
@@ -1,4 +1,4 @@
-{ stdenv, pkgs, runExecline, getBins, writeScript
+{ stdenv, pkgs, runExecline, runExeclineLocal, getBins, writeScript
 # https://www.mail-archive.com/skaware@list.skarnet.org/msg01256.html
 , coreutils }:
 
@@ -44,23 +44,15 @@ let
   };
 
   # basic test that touches out
-  basic = runExecline "run-execline-test-basic" {
-    derivationArgs = {
-      preferLocalBuild = true;
-      allowSubstitutes = false;
-    };
+  basic = runExeclineLocal "run-execline-test-basic" {
   } [
       "importas" "-ui" "out" "out"
       "${bins.s6-touch}" "$out"
   ];
 
   # whether the stdin argument works as intended
-  stdin = fileHasLine "foo" (runExecline "run-execline-test-stdin" {
+  stdin = fileHasLine "foo" (runExeclineLocal "run-execline-test-stdin" {
     stdin = "foo\nbar\nfoo";
-    derivationArgs = {
-      preferLocalBuild = true;
-      allowSubstitutes = false;
-    };
   } [
       "importas" "-ui" "out" "out"
       # this pipes stdout of s6-cat to $out
@@ -68,15 +60,12 @@ let
       "redirfd" "-w" "1" "$out" bins.s6-cat
   ]);
 
-  wrapWithVar = runExecline "run-execline-test-wrap-with-var" {
+
+  wrapWithVar = runExeclineLocal "run-execline-test-wrap-with-var" {
     builderWrapper = writeScript "var-wrapper" ''
       #!${bins.execlineb} -S0
       export myvar myvalue $@
     '';
-    derivationArgs = {
-      preferLocalBuild = true;
-      allowSubstitutes = false;
-    };
   } [
     "importas" "-ui" "v" "myvar"
     "if" [ bins.s6-test "myvalue" "=" "$v" ]