From 8b6ec43779ee2f2760a11fed65e24f3e6648216e Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Dec 2026 05:45:18 +0000 Subject: enstate: let a slot's source be a location --- modules/enstate.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/enstate.nix b/modules/enstate.nix index 55e0d50c..c6f238f4 100644 --- a/modules/enstate.nix +++ b/modules/enstate.nix @@ -3,7 +3,8 @@ options.enstate = { # Where a deploy gets each slot's entry from, in enstate's source - # syntax, run on the deploying host. + # syntax, run on the deploying host; or { location = NAME; VAR = …; }, + # a source the deploying host declares, with its variables. channels = lib.mkOption { type = lib.types.attrsOf (lib.types.submodule { options.slots = lib.mkOption { @@ -26,7 +27,10 @@ in { inherit channel; complete = lib.attrNames sourced == lib.attrNames channelCfg.slots; - items = lib.mapAttrs (_: slot: { inherit (slot) source; }) sourced; + items = lib.mapAttrs (_: slot: + if slot.source ? location then slot.source + else { inherit (slot) source; } + ) sourced; }) (lib.filterAttrs (_: channelCfg: lib.any (slot: slot.source != null) (lib.attrValues channelCfg.slots) ) config.enstate.channels); -- cgit v1.3.1