From 0e0880fc606e9277c1a52e637cebe7dd3438410d Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 13 Nov 2026 17:03:25 +0000 Subject: 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. --- pkgs/populate/docs/design.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'pkgs/populate/docs') diff --git a/pkgs/populate/docs/design.md b/pkgs/populate/docs/design.md index fd64c2b..3340ccf 100644 --- a/pkgs/populate/docs/design.md +++ b/pkgs/populate/docs/design.md @@ -177,10 +177,11 @@ Populate runs rsync, Git, ssh, and Nix as programs, found in `PATH`. ## Status The program delivers all source types, draws inputs from sources, makes -backups, and prunes. The code for flakes, in `src/flake.rs`, builds the -same shell code that `shell.nix` generates, with every value quoted, so -both implementations behave alike; it moves to Rust piece by piece, with -the scenarios telling whether it still behaves alike. +backups, and prunes. Drawing inputs, in `src/flake.rs`, builds the same +shell code that `shell.nix` generates, with every value quoted; it moves +to Rust like delivering flake and flake-input sources did, in +`src/flake_input.rs`, which reads what Nix prints as JSON itself, and runs +fixed snippets on the target that send JSON or store paths back. The jq programs in `flake-jq.nix`, which the shell implementation and the jq test use, have equivalents in Rust, with the jq test's cases as unit -- cgit v1.3.1