about summary refs log tree commit diff
path: root/nix/runExecline/default.nix
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2021-01-01T17·43+0100
committerProfpatsch <mail@profpatsch.de>2021-01-02T14·24+0000
commit2f063bc5b0b9ef7a077ce11910fde78bfe45f29b (patch)
treea361e3cd11d2ae5d541b4531d609300c05896c96 /nix/runExecline/default.nix
parent361aa2aac2fb8ec0989d449e835c19d681a0025b (diff)
feat(nix): add runExecline.local r/2049
Similar to runCommandLocal, this turns off substitutions and prefers
building locally.

Change-Id: I823b34c7fc54990b54a82324172c299aeffdbf41
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2309
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
Reviewed-by: lukegb <lukegb@tvl.fyi>
Diffstat (limited to 'nix/runExecline/default.nix')
-rw-r--r--nix/runExecline/default.nix13
1 files changed, 12 insertions, 1 deletions
diff --git a/nix/runExecline/default.nix b/nix/runExecline/default.nix
index 22d968a1c6..fd92203d01 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;
 }