diff options
| author | tv <tv@krebsco.de> | 2026-11-12 02:33:43 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-12 02:33:43 +0000 |
| commit | 84444c00bf5ad06f8bca4e4cd68e6d227a8efd1e (patch) | |
| tree | 35cd74ccd2e96a638491c68d508c8b20055be142 /tests/scenarios.nix | |
| parent | 1dd511bd6920b428dbd48f36ac646da8463fcbdd (diff) | |
populate flake-input: replace symlinks pointing outside the store
nix-store --add-root only replaces symlinks pointing into the store, so a
symlink pointing elsewhere at the target path, e.g. one a symlink source
left there, made delivering a flake fail. Populate removes such links.
An edge case switches a symlink source to a flake source.
Diffstat (limited to 'tests/scenarios.nix')
| -rw-r--r-- | tests/scenarios.nix | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/scenarios.nix b/tests/scenarios.nix index 38f8736..9760e54 100644 --- a/tests/scenarios.nix +++ b/tests/scenarios.nix @@ -827,6 +827,22 @@ assert !(krops.isLocalTarget (targets.remote "/")); } ]; }) + (s "symlink-to-flake" { + phases = [ + { + sources = alt // { x.symlink = "alt"; }; + check = '' + expect_eq link "$(readlink "$T"/x)" alt + ''; + } + { + sources = alt // { x.flake = { flake = "/fixtures/top"; inherit fetchOnTarget; }; }; + check = checkFlake { attr = "msg"; expected = "top:dep+inner,sub"; } + '' + test -e "$T"/alt/flake.nix || fail "alt changed" + ''; + } + ]; + }) ] ++ lib.optional (targetKind == "local") # The target has the path the input is locked to. (s "uselocal" { |
