aboutsummaryrefslogtreecommitdiffstats
path: root/lib/types
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-11 16:14:54 +0000
committertv <tv@krebsco.de>2026-11-11 16:14:54 +0000
commit84888f4e20de185e3bd3aaaa63e180dace349b92 (patch)
tree3d45686568c29e5bbaad25c9fbd6dbeeb17a2afb /lib/types
parent28430f1b07e85e0ea553d5486be568a2bf372e88 (diff)
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.
Diffstat (limited to 'lib/types')
-rw-r--r--lib/types/populate.nix19
1 files changed, 19 insertions, 0 deletions
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 = {