exec devbox init
exec devbox add which

# Ensure nix is accessible from the default profile
exec devbox run which nix
stdout '/nix/var/nix/profiles/default/bin/nix'

# Relative paths in PATH are removed, others are cleaned
env PATH=./relative/path:/some//dirty/../clean/path:$PATH
env DEVBOX_INCLUDE_BIN_WRAPPERS_IN_PATH=1
exec devbox run echo '$PATH'
! stdout 'relative/path'
! stdout '/some//dirty/../clean/path'
stdout '/some/clean/path'

# Path contains path to installed nix packages in the wrappers and nix profile
stdout '.devbox/virtenv/.wrappers/bin'
stdout '.devbox/nix/profile/default/bin'

# Verify PATH is set in correct order: virtual env path nix packages, host path.
path.order '.devbox/virtenv/.wrappers/bin' '/some/clean/path'

# TODO: verify that bashrc file prepends do not prepend before nix paths.
