Skip to content

Commit

Permalink
nixosTests.etc: fix with structuredAttrs
Browse files Browse the repository at this point in the history
The NIX_ATTRS_SH_FILE needs to be available visible inside the
fakechroot environment, so that we can load it for structuredAttrs
support.
  • Loading branch information
wolfgangwalther committed Dec 29, 2024
1 parent d63aa1d commit 255012c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion nixos/modules/system/etc/test.nix
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,14 @@ lib.recurseIntoAttrs {
} ''
mkdir fake-root
export FAKECHROOT_EXCLUDE_PATH=/dev:/proc:/sys:${builtins.storeDir}:$out
fakechroot fakeroot chroot $PWD/fake-root bash -c 'source $stdenv/setup; eval "$fakeRootCommands"'
if [ -e "$NIX_ATTRS_SH_FILE" ]; then
export FAKECHROOT_EXCLUDE_PATH=$FAKECHROOT_EXCLUDE_PATH:$NIX_ATTRS_SH_FILE
fi
fakechroot fakeroot chroot $PWD/fake-root bash -e -c '
if [ -e "$NIX_ATTRS_SH_FILE" ]; then . "$NIX_ATTRS_SH_FILE"; fi
source $stdenv/setup
eval "$fakeRootCommands"
'
'';

}

0 comments on commit 255012c

Please sign in to comment.