From 2f063bc5b0b9ef7a077ce11910fde78bfe45f29b Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Fri, 1 Jan 2021 18:43:42 +0100 Subject: feat(nix): add runExecline.local 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 Reviewed-by: lukegb --- nix/runExecline/default.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'nix/runExecline/default.nix') 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; } -- cgit 1.4.1