diff options
| author | tv <tv@krebsco.de> | 2026-11-12 02:17:48 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-12 02:17:48 +0000 |
| commit | 5906453bc0c6e31cee65a20aa8e7811b6eaf3b1e (patch) | |
| tree | 654fce4aee7a9926739e3707e3e0e009106c28b7 /README.md | |
| parent | d4c352a402aec1682625144c0440ca31c232ee74 (diff) | |
populate flake-input: deliver the inputs the input's own lock file pins
A flake-input source delivers an input as its own flake, which
evaluating it uses with its own lock file. Populate, however, took the
input's inputs from the parent flake's lock file: on the target, by
walking the lock file, and on the deploying machine, from the parent's
nix flake archive. That had several consequences:
- An empty follows path, which removes an input, or two inputs following
each other made the walk loop forever.
- Copying left out inputs that follow other inputs, and rejected names
through them, e.g. dep/inner where dep's inner follows another input.
- Inputs given by relative paths, e.g. path:./lib, which have no lock
entry of their own to fetch, broke fetching on the target and
flake-input sources.
- Where the parent overrides an input's inputs, the input's own lock file
pins other versions than the delivered ones.
Populate now resolves the name through the parent's lock file, follows
included and guarded against cycles, to what to fetch: a locked
reference, or the flake itself, which inputs given by relative paths are
part of. It fetches that, on the deploying machine or on the target, and
then the inputs the input's own lock file pins, using nix flake archive.
An input without a lock file comes without its inputs.
New edge cases cover lock files with empty and cyclic follows, names
through follows, the delivered closure, and relative path inputs.
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -394,8 +394,10 @@ flake's lock file, to the target. This makes the lock file of a flake the single place that pins, e.g., nixpkgs, for flakes as well as for `NIX_PATH`. It works like the `flake` source type, but delivers the selected input instead of the flake, so the target path becomes a symlink to the input's -store path, and the input's own inputs get garbage collector roots in -`.populate/flake-inputs/<name>`. +store path. The inputs that the input's own lock file pins, which evaluating +the input needs, get delivered as well, with garbage collector roots in +`.populate/flake-inputs/<name>`. An input without a lock file comes without +its inputs, because locking it would change it. Because the target path points at the store path named by the lock file, it can be used in `NIX_PATH` as well as by flakes evaluated on the target, @@ -410,7 +412,8 @@ Supported attributes: * `name` - name of the input to deliver. Inputs of inputs are separated by `/`, - e.g. `stockholm/nixpkgs`. + e.g. `stockholm/nixpkgs`, and resolved as the flake's lock file resolves + them, so an input that follows another one names the other one. * `fetchOnTarget` (optional) - boolean that controls whether the target fetches the input itself instead |
