nixos-container: avoid subshell when testing $PRIVATE_USERS (#383056)

authored by

Ramses and committed by
GitHub
51e84098 d1e7ea7c

+1 -1
+1 -1
nixos/modules/virtualisation/nixos-containers.nix
··· 118 NIX_BIND_OPT="" 119 if [ -n "$PRIVATE_USERS" ]; then 120 extraFlags+=("--private-users=$PRIVATE_USERS") 121 - if [ "$PRIVATE_USERS" = "pick" ] || ( [ "$PRIVATE_USERS" != "identity" ] && [ "$PRIVATE_USERS" -gt 0 ] ); then 122 # when user namespacing is enabled, we use `idmap` mount option 123 # so that bind mounts under /nix get proper owner (and not nobody/nogroup). 124 NIX_BIND_OPT=":idmap"
··· 118 NIX_BIND_OPT="" 119 if [ -n "$PRIVATE_USERS" ]; then 120 extraFlags+=("--private-users=$PRIVATE_USERS") 121 + if [ "$PRIVATE_USERS" = "pick" ] || { [ "$PRIVATE_USERS" != "identity" ] && [ "$PRIVATE_USERS" -gt 0 ]; }; then 122 # when user namespacing is enabled, we use `idmap` mount option 123 # so that bind mounts under /nix get proper owner (and not nobody/nogroup). 124 NIX_BIND_OPT=":idmap"