1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-24 22:11:15 +02:00
Commit graph

12 commits

Author SHA1 Message Date
Vladimír Čunát
77f6b6532f
tests: fixup with jq-1.8.0 2025-06-18 10:11:50 +02:00
Robert Hensing
f18af849fe
Merge pull request #13170 from MattSturgeon/fix/call-flake/rel-path
Use correct parent `outPath` for relative path inputs
2025-05-19 14:13:54 +02:00
Robert Hensing
eaee0b4740
tests/function/flakes/relative-paths: Test #13164 2025-05-18 00:40:08 +01:00
Eelco Dolstra
824e0d51fe Test lock file contents more precisely 2025-05-13 10:40:24 +02:00
Robert Hensing
2109a5a206 fix: Evaluate flake parent source without evaluating its outputs
This requires that we refer to the `sourceInfo` instead of the
`result`. However, `sourceInfo` does not create a chain of basedir
resolution, so we add that back with `flakeDir`.
2025-04-15 13:22:53 +02:00
Eelco Dolstra
14c9755462 nix flake archive: Recurse into relative path inputs
We can't ignore them entirely, since we do want to archive their
transitive inputs.

Fixes #12438.
2025-02-24 22:10:02 +01:00
Eelco Dolstra
b4dfeafed5 nix flake archive: Skip relative path inputs
Fixes #12438.
2025-02-24 15:30:30 +01:00
Eelco Dolstra
f2063255a4 tests/functional/flakes/relative-paths.sh: Fix build failure in hydraJobs.tests.functional_user 2024-09-25 16:29:43 +02:00
Eelco Dolstra
09d71974ef shellcheck 2024-09-16 14:11:08 +02:00
Eelco Dolstra
3180671cab Allow the 'url' flake input attribute to be a path literal
https://github.com/NixOS/nix/pull/10089#issuecomment-1978133326
2024-05-17 19:49:40 +02:00
Eelco Dolstra
49f592dd99 call-flake.nix: Fix relative path resolution
`parentNode.sourceInfo.outPath` does not include the subdir of the
parent flake, while `parentNode.outPath` does. So we need to use the
latter.
2024-05-17 16:38:01 +02:00
Eelco Dolstra
b2be6fed86 Improve support for subflakes
Subflakes are flakes in the same tree, accessed in flake inputs via
relative paths (e.g. `inputs.foo.url = "path:./subdir"`). Previously
these didn't work very well because they would be separately copied to
the store, which is inefficient and makes references to parent
directories tricky or impossible. Furthermore, they had their own NAR
hash in the lock file, which is superfluous since the parent is
already locked.

Now subflakes are accessed via the accessor of the calling flake. This
avoids the unnecessary copy and makes it possible for subflakes to
depend on flakes in a parent directory (so long as they're in the same
tree).

Lock file nodes for relative flake inputs now have a new `parent` field:

  {
    "locked": {
      "path": "./subdir",
      "type": "path"
    },
    "original": {
      "path": "./subdir",
      "type": "path"
    },
    "parent": [
      "foo",
      "bar"
    ]
  }

which denotes that `./subdir` is to be interpreted relative to the
directory of the `bar` input of the `foo` input of the root flake.

Extracted from the lazy-trees branch.
2024-05-15 20:22:34 +02:00