From 84888f4e20de185e3bd3aaaa63e180dace349b92 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 11 Nov 2026 16:14:54 +0000 Subject: populate: add flake source type Deliver a flake, or one of its locked inputs, to the target: archive the flake locally, copy the selected input together with its own inputs into the target's store, and link it at the target path, registered as garbage collector root. The result can be used in NIX_PATH as well as by flakes evaluated on the target, without network access. nix copy runs with a separate ssh wrapper without the control socket, because Nix waits for its LocalCommand, which may not run over a multiplexed connection. --- lib/types/populate.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'lib/types/populate.nix') diff --git a/lib/types/populate.nix b/lib/types/populate.nix index 6264f99..a194831 100644 --- a/lib/types/populate.nix +++ b/lib/types/populate.nix @@ -31,6 +31,14 @@ source-types.file ]); }; + flake = lib.mkOption { + apply = x: + if lib.types.str.check x + then { flake = x; } + else x; + default = null; + type = lib.types.nullOr (lib.types.either lib.types.str source-types.flake); + }; git = lib.mkOption { default = null; type = lib.types.nullOr source-types.git; @@ -137,6 +145,17 @@ }; }; }; + flake = lib.types.submodule { + options = { + flake = lib.mkOption { + type = lib.types.str; # TODO lib.types.flake-ref + }; + input = lib.mkOption { + default = null; + type = lib.types.nullOr lib.types.str; + }; + }; + }; git = lib.types.submodule { options = { clean = { -- cgit v1.3.1