mirror of
https://github.com/NixOS/nix
synced 2025-07-07 01:51:47 +02:00
Fix dirOf on the root of a flake
This commit is contained in:
parent
4072024d79
commit
64a69b4054
3 changed files with 6 additions and 1 deletions
|
@ -23,6 +23,8 @@ writeSimpleFlake() {
|
|||
|
||||
# To test "nix flake init".
|
||||
legacyPackages.x86_64-linux.hello = import ./simple.nix;
|
||||
|
||||
parent = builtins.dirOf ./.;
|
||||
};
|
||||
}
|
||||
EOF
|
||||
|
|
|
@ -121,6 +121,9 @@ nix build -o $TEST_ROOT/result --expr "(builtins.getFlake \"$flake1Dir\").packag
|
|||
# 'getFlake' on a locked flakeref should succeed even in pure mode.
|
||||
nix build -o $TEST_ROOT/result --expr "(builtins.getFlake \"git+file://$flake1Dir?rev=$hash2\").packages.$system.default"
|
||||
|
||||
# Regression test for dirOf on the root of the flake.
|
||||
[[ $(nix eval --json flake1#parent) = '"/"' ]]
|
||||
|
||||
# Building a flake with an unlocked dependency should fail in pure mode.
|
||||
(! nix build -o $TEST_ROOT/result flake2#bar --no-registries)
|
||||
(! nix build -o $TEST_ROOT/result flake2#bar --no-use-registries)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue