aboutsummaryrefslogtreecommitdiffstats
path: root/lib/types
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-11 17:04:13 +0000
committertv <tv@krebsco.de>2026-11-11 17:04:13 +0000
commit16da86c825f0dc3f85187311ec71ec1f038fc065 (patch)
tree9dc86e210fc1e67a04098f70cd58024e8ee6aff5 /lib/types
parentd7ebb66780b090b0ac140cad0b61daf7778fc772 (diff)
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.
Diffstat (limited to 'lib/types')
-rw-r--r--lib/types/populate.nix4
1 files changed, 4 insertions, 0 deletions
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
};