aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs/populate/src/flake.rs
Commit message (Collapse)AuthorAgeFilesLines
* populate: state what the target sends back for derived copies in codetv14 hours1-32/+140
| | | | | | | | DerivedState::parse reads what derived_state prints, and key_text builds the text whose hash is a derived copy's key, the same as before, both with unit tests, instead of decoding fields by position inside Flakes::derive. Fields from the target that don't end in a null byte fail, instead of getting dropped.
* populate: refer to flakes as git+file: only with a usable .gittv14 hours1-2/+4
| | | | | | | | | | | | | Writing the lock file of a git+file: flake, Nix runs Git, with the repository's configuration and hooks, which may run commands. A .git in a source's directory can come from anywhere, e.g. one planted in a materialized flake, or one a file source keeps. So drawing inputs refers to a flake as git+file: only if git_problems finds nothing wrong with its .git directory, the way git sources check their work trees, and else as path:. lock-foreign-git plants a .git in a materialized flake and in a file source that keeps it, whose configuration names an fsmonitor command.
* populate: build with Rust 1.71, as in nixpkgs 23.11tv15 hours1-2/+1
| | | | | | The program needs Rust 1.71, the oldest version its dependencies support, which Cargo.toml states, so clippy points out what newer versions add. The lock file is of version 3, which Cargo reads from version 1.53 on.
* populate: draw flake inputs natively in Rusttv16 hours1-599/+752
| | | | | | | | | | | | | The program decides how to draw inputs and derive copies of flake and flake-input sources itself. The target runs fixed snippets, which send back what it needs to know: where paths resolve to and what's there, the lock files of flakes as nix flake metadata prints them, and what tells whether a derived copy needs to be made again. The program checks that drawn inputs exist in the lock files, computes the keys of derived copies, and writes generated flakes. Derived copies get the same keys as with the shell implementation, so switching implementations doesn't make them again.
* populate: deliver flake and flake-input sources natively in Rusttv17 hours1-610/+23
| | | | | | | | | | | src/flake_input.rs reads what nix flake metadata and nix flake archive print as JSON itself: it selects the flake or input, decides what the target fetches or gets copied, and computes the store paths to root, which are what selected.jq, selfIsRemote.jq, selfLocked.jq, and the Nix expressions of the shell implementation do there. On the target, fixed snippets in sh::flake run Nix, getting values as positional parameters, and send JSON or store paths back. The jq test's cases are unit tests of the Rust equivalents.
* populate: deliver flakes and draw inputs with the Rust programtv17 hours1-0/+1400
The program delivers flake and flake-input sources, draws inputs from sources, and removes state that sources don't need anymore, so it does everything the shell implementation does, and passes all scenarios. src/flake.rs builds the same shell code as shell.nix generates for these, with every value quoted, so both implementations behave alike while that code moves to Rust piece by piece. The ssh scripts in the temporary directory run the ssh that was in PATH when populate started, so one can be ssh in PATH for nix copy. The other one is for nix copy's ssh:// store, without the control socket.