summaryrefslogtreecommitdiffstats
path: root/modules/enstate.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-12-01 05:45:18 +0000
committertv <tv@krebsco.de>2026-12-01 05:45:18 +0000
commit8b6ec43779ee2f2760a11fed65e24f3e6648216e (patch)
tree2d3d525ae6cd498cb5ce6d1a6709ae9e84d1bc0e /modules/enstate.nix
parente5a6773693ed16a489b9233c712271dcfa77f099 (diff)
enstate: let a slot's source be a location
Diffstat (limited to 'modules/enstate.nix')
-rw-r--r--modules/enstate.nix8
1 files changed, 6 insertions, 2 deletions
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);