From 16da86c825f0dc3f85187311ec71ec1f038fc065 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 11 Nov 2026 17:04:13 +0000 Subject: populate flake: add fetchOnTarget With fetchOnTarget, the target fetches the input and its own inputs itself, using fetchTree with the arguments recorded in the flake's lock file. Only nix flake metadata runs on the deploying machine, so the inputs get downloaded once, by the target. This needs Nix with flake support on the target, which populate checks before fetching. Because nothing gets copied, this also works for targets using sudo. --- lib/types/populate.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/types') diff --git a/lib/types/populate.nix b/lib/types/populate.nix index a194831..319a7ba 100644 --- a/lib/types/populate.nix +++ b/lib/types/populate.nix @@ -147,6 +147,10 @@ }; flake = lib.types.submodule { options = { + fetchOnTarget = lib.mkOption { + default = false; + type = lib.types.bool; + }; flake = lib.mkOption { type = lib.types.str; # TODO lib.types.flake-ref }; -- cgit v1.3.1