mirror of
https://github.com/NixOS/nix
synced 2025-07-08 19:23:54 +02:00
Prefix env vars for attrs.* files with NIX_
This commit is contained in:
parent
a92245b110
commit
27ce722638
5 changed files with 7 additions and 7 deletions
|
@ -10,7 +10,7 @@ let pkgs = rec {
|
|||
done
|
||||
|
||||
# mimic behavior of stdenv for `$out` etc. for structured attrs.
|
||||
if [ -n "''${ATTRS_SH_FILE}" ]; then
|
||||
if [ -n "''${NIX_ATTRS_SH_FILE}" ]; then
|
||||
for o in "''${!outputs[@]}"; do
|
||||
eval "''${o}=''${outputs[$o]}"
|
||||
export "''${o}"
|
||||
|
|
|
@ -36,7 +36,7 @@ mkDerivation {
|
|||
echo bar > $dest
|
||||
echo foo > $dest2
|
||||
|
||||
json=$(cat $ATTRS_JSON_FILE)
|
||||
json=$(cat $NIX_ATTRS_JSON_FILE)
|
||||
[[ $json =~ '"narHash":"sha256:1r7yc43zqnzl5b0als5vnyp649gk17i37s7mj00xr8kc47rjcybk"' ]]
|
||||
[[ $json =~ '"narSize":288' ]]
|
||||
[[ $json =~ '"closureSize":288' ]]
|
||||
|
|
|
@ -11,7 +11,7 @@ nix-build structured-attrs.nix -A all -o $TEST_ROOT/result
|
|||
|
||||
export NIX_BUILD_SHELL=$SHELL
|
||||
env NIX_PATH=nixpkgs=shell.nix nix-shell structured-attrs-shell.nix \
|
||||
--run 'test -e .attrs.json; test "3" = "$(jq ".my.list|length" < $ATTRS_JSON_FILE)"'
|
||||
--run 'test -e .attrs.json; test "3" = "$(jq ".my.list|length" < $NIX_ATTRS_JSON_FILE)"'
|
||||
|
||||
# `nix develop` is a slightly special way of dealing with environment vars, it parses
|
||||
# these from a shell-file exported from a derivation. This is to test especially `outputs`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue