diff options
| author | tv <tv@krebsco.de> | 2026-11-13 17:03:25 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-13 18:21:08 +0100 |
| commit | 0e0880fc606e9277c1a52e637cebe7dd3438410d (patch) | |
| tree | 74383c8c11b0999c665da1ba66add2220b4ae685 /pkgs/populate/src/populate.rs | |
| parent | 96f5ecf73dba5762de4148ce2e9a0fdd3e13270f (diff) | |
populate: deliver flake and flake-input sources natively in Rust
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.
Diffstat (limited to 'pkgs/populate/src/populate.rs')
| -rw-r--r-- | pkgs/populate/src/populate.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/pkgs/populate/src/populate.rs b/pkgs/populate/src/populate.rs index ef806b0..ad0ec35 100644 --- a/pkgs/populate/src/populate.rs +++ b/pkgs/populate/src/populate.rs @@ -1,6 +1,7 @@ //! Delivering the sources of a spec. use crate::flake; +use crate::flake_input; use crate::rsync::{self, Config}; use crate::run::{self, Context, Failure, Result}; use crate::sh; @@ -132,11 +133,7 @@ fn deliver( }; rsync::transfer(context, &config, &out.to_string_lossy(), path) } - "flake" | "flake-input" => run::status(&mut run::local_shell( - &flake::flake_input(context, name, path, source), - &[], - &workdir, - )), + "flake" | "flake-input" => flake_input::deliver(context, name, path, source, &workdir), "git" => { let flag = |key| match settings.get(key).and_then(Value::as_bool) { Some(true) => "1", |
