|
316 | 316 |
|
317 | 317 | # ── Dependency introspection ──────────────────────────────────────────────── |
318 | 318 |
|
319 | | - introsepction.test-access-sub-flake-inputs = { |
| 319 | + introspection.test-access-sub-flake-inputs = { |
320 | 320 | # inputs.someFlake.inputs.dep — traverse a dependency's own inputs |
321 | 321 | expr = (with-inputs { } { a = mkFlake { dep = mkSrc "/dep"; } { }; }).a.inputs.dep.outPath; |
322 | 322 | expected = "/dep"; |
323 | 323 | }; |
324 | 324 |
|
325 | | - introsepction.test-access-sub-flake-outputs = { |
| 325 | + introspection.test-access-sub-flake-outputs = { |
326 | 326 | # inputs.someFlake.outputs.lib — explicit outputs access |
327 | 327 | expr = (with-inputs { } { a = mkFlake { } { lib = "mylib"; }; }).a.outputs.lib; |
328 | 328 | expected = "mylib"; |
329 | 329 | }; |
330 | 330 |
|
331 | | - introsepction.test-sub-flake-output-attrs-merged-at-top-level = { |
| 331 | + introspection.test-sub-flake-output-attrs-merged-at-top-level = { |
332 | 332 | # inputs.someFlake.lib ≡ inputs.someFlake.outputs.lib |
333 | 333 | expr = |
334 | 334 | let |
|
346 | 346 | expected = "mylib"; |
347 | 347 | }; |
348 | 348 |
|
| 349 | + introspection.test-follow-sub-npins-with-inputs-input = { |
| 350 | + # my-lib.inputs.nixpkgs.follows = "with-inputs-dep/nixpkgs" → traverse native inputs |
| 351 | + expr = |
| 352 | + (with-inputs |
| 353 | + { |
| 354 | + my-lib = mkSrc ./fixtures/fake-flake; |
| 355 | + with-inputs-dep = mkSrc ./fixtures/with-inputs-flake; |
| 356 | + } |
| 357 | + { |
| 358 | + my-lib.inputs.nixpkgs.follows = "with-inputs-dep/nixpkgs"; |
| 359 | + } |
| 360 | + ).my-lib.inputs.nixpkgs.outPath; |
| 361 | + expected = npins.nixpkgs.outPath; |
| 362 | + }; |
| 363 | + |
349 | 364 | real-flakes.test-npins-nix-maid-nixosModules-output-is-readable = { |
350 | 365 | expr = |
351 | 366 | (with-inputs npins { } (inputs: { |
|
378 | 393 | expected = npins.nixpkgs.outPath; |
379 | 394 | }; |
380 | 395 |
|
| 396 | + real-flakes.test-sub-npins-with-inputs-nested-follows = { |
| 397 | + # with-inputs-dep.inputs.nixpkgs.follows = "inputs/nixpkgs" → "blind" override of with-inputs-dep.inputs.nixpkgs |
| 398 | + expr = |
| 399 | + (with-inputs |
| 400 | + { |
| 401 | + inputs = mkFlake { nixpkgs = mkSrc "/nested-nixpkgs"; } { }; |
| 402 | + with-inputs-dep = mkSrc ./fixtures/with-inputs-flake; |
| 403 | + } |
| 404 | + { |
| 405 | + with-inputs-dep.inputs.nixpkgs.follows = "inputs/nixpkgs"; |
| 406 | + } |
| 407 | + (inputs: { |
| 408 | + check = inputs.with-inputs-dep.usedNixpkgs; |
| 409 | + }) |
| 410 | + ).check; |
| 411 | + expected = { |
| 412 | + outPath = "/nested-nixpkgs"; |
| 413 | + }; |
| 414 | + }; |
| 415 | + |
381 | 416 | non-flakes.test-non-flakes-are-not-evaluated = { |
382 | 417 | expr = |
383 | 418 | (with-inputs |
|
0 commit comments