2022-01-27 14:32:14 +00:00
|
|
|
|
# Regression for https://github.com/NixOS/nix/issues/5998 and https://github.com/NixOS/nix/issues/5980
|
|
|
|
|
|
|
|
|
|
source common.sh
|
|
|
|
|
|
|
|
|
|
export NIX_PATH=non-existent=/non-existent/but-unused-anyways:by-absolute-path=$PWD:by-relative-path=.
|
|
|
|
|
|
|
|
|
|
nix-instantiate --eval -E '<by-absolute-path/simple.nix>' --restrict-eval
|
|
|
|
|
nix-instantiate --eval -E '<by-relative-path/simple.nix>' --restrict-eval
|
|
|
|
|
|
|
|
|
|
# Should ideally also test this, but there’s no pure way to do it, so just trust me that it works
|
|
|
|
|
# nix-instantiate --eval -E '<nixpkgs>' -I nixpkgs=channel:nixos-unstable --restrict-eval
|
2022-12-07 11:58:58 +00:00
|
|
|
|
|
|
|
|
|
[[ $(nix-instantiate --find-file by-absolute-path/simple.nix) = $PWD/simple.nix ]]
|
|
|
|
|
[[ $(nix-instantiate --find-file by-relative-path/simple.nix) = $PWD/simple.nix ]]
|
2023-01-25 14:10:35 +00:00
|
|
|
|
|
|
|
|
|
unset NIX_PATH
|
|
|
|
|
|
|
|
|
|
[[ $(nix-instantiate --option nix-path by-relative-path=. --find-file by-relative-path/simple.nix) = "$PWD/simple.nix" ]]
|
|
|
|
|
[[ $(NIX_PATH= nix-instantiate --option nix-path by-relative-path=. --find-file by-relative-path/simple.nix) = "$PWD/simple.nix" ]]
|