From 9eb58f5209f9cd1fd18f33b691c6a613075dffc4 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Thu, 7 Mar 2024 10:46:47 +0100 Subject: Merge pull request #9032 from Ma27/structured-attrs-env-vars structured attrs: improve support / usage of NIX_ATTRS_{SH,JSON}_FILE (cherry picked from commit 3c042f3b0b0a7ef9c47bf049f5410dbd4aac9e90) Change-Id: I7e41838338ee1edf31fff6f9e354c3db2bba6c0e --- tests/functional/build-hook.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests/functional/build-hook.nix') diff --git a/tests/functional/build-hook.nix b/tests/functional/build-hook.nix index 7effd7903..99a13aee4 100644 --- a/tests/functional/build-hook.nix +++ b/tests/functional/build-hook.nix @@ -14,7 +14,10 @@ let derivation ({ inherit system; builder = busybox; - args = ["sh" "-e" args.builder or (builtins.toFile "builder-${args.name}.sh" "if [ -e .attrs.sh ]; then source .attrs.sh; fi; eval \"$buildCommand\"")]; + args = ["sh" "-e" args.builder or (builtins.toFile "builder-${args.name}.sh" '' + if [ -e "$NIX_ATTRS_SH_FILE" ]; then source $NIX_ATTRS_SH_FILE; fi; + eval "$buildCommand" + '')]; } // removeAttrs args ["builder" "meta" "passthru"] // caArgs) // { meta = args.meta or {}; passthru = args.passthru or {}; }; -- cgit v1.2.3