mirror of
https://github.com/NixOS/nix
synced 2025-07-07 14:21:48 +02:00
Give errors in resolveFlake
If DontUpdate but the lockfile isn't correct
This commit is contained in:
parent
d9ad3723d5
commit
98f20dee41
6 changed files with 70 additions and 41 deletions
20
tests/config.nix
Normal file
20
tests/config.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
with import <nix/config.nix>;
|
||||
|
||||
rec {
|
||||
inherit shell;
|
||||
|
||||
path = coreutils;
|
||||
|
||||
system = "x86_64-linux";
|
||||
|
||||
shared = builtins.getEnv "_NIX_TEST_SHARED";
|
||||
|
||||
mkDerivation = args:
|
||||
derivation ({
|
||||
inherit system;
|
||||
builder = shell;
|
||||
args = ["-e" args.builder or (builtins.toFile "builder.sh" "if [ -e .attrs.sh ]; then source .attrs.sh; fi; eval \"$buildCommand\"")];
|
||||
PATH = path;
|
||||
} // removeAttrs args ["builder" "meta"])
|
||||
// { meta = args.meta or {}; };
|
||||
}
|
|
@ -59,7 +59,7 @@ EOF
|
|||
git -C $flake2Dir add flake.nix
|
||||
git -C $flake2Dir commit -m 'Initial'
|
||||
|
||||
cat > $flake3/flake.nix <<EOF
|
||||
cat > $flake3Dir/flake.nix <<EOF
|
||||
{
|
||||
name = "flake3";
|
||||
|
||||
|
@ -75,8 +75,8 @@ cat > $flake3/flake.nix <<EOF
|
|||
}
|
||||
EOF
|
||||
|
||||
git -C $flake3 add flake.nix
|
||||
git -C $flake3 commit -m 'Initial'
|
||||
git -C $flake3Dir add flake.nix
|
||||
git -C $flake3Dir commit -m 'Initial'
|
||||
|
||||
cat > $registry <<EOF
|
||||
{
|
||||
|
@ -139,4 +139,4 @@ nix build -o $TEST_ROOT/result --flake-registry $registry flake2:bar
|
|||
nix build -o $TEST_ROOT/result file://$flake2Dir:bar
|
||||
|
||||
# Test whether indirect dependencies work.
|
||||
#nix build -o $TEST_ROOT/result --flake-registry $registry $flake3:xyzzy
|
||||
nix build -o $TEST_ROOT/result --flake-registry $registry $flake3Dir:xyzzy
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue