summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-12-01 13:42:11 +0000
committertv <tv@krebsco.de>2026-12-01 13:48:55 +0000
commitb85cbfd8014002ddc89bbc406ae86a54380cde72 (patch)
tree838b5f061d5e8fdaf09a59d8e8bc0440ba24e6c3 /modules
parent46f370278c091f89b3b321c7738d210c5617e06b (diff)
enstate: take the slots' sources and the source lists from its module
Upstream has hrm's options now, in the same shape.
Diffstat (limited to 'modules')
-rw-r--r--modules/enstate.nix38
1 files changed, 1 insertions, 37 deletions
diff --git a/modules/enstate.nix b/modules/enstate.nix
index c6f238f4..caf814eb 100644
--- a/modules/enstate.nix
+++ b/modules/enstate.nix
@@ -1,41 +1,5 @@
-{ config, inputs, lib, pkgs, ... }: {
+{ inputs, pkgs, ... }: {
imports = [ (inputs.enstate + "/nix/module.nix") ];
- options.enstate = {
- # Where a deploy gets each slot's entry from, in enstate's source
- # 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 {
- type = lib.types.attrsOf (lib.types.submodule {
- options.source = lib.mkOption {
- type = lib.types.nullOr lib.types.raw;
- default = null;
- };
- });
- };
- });
- };
- # Per channel, a source list for enstate --pack, from the slots that
- # name a source: complete if every slot of the channel does. For the
- # deploying host to evaluate; not part of the system.
- sourceLists = lib.mkOption {
- readOnly = true;
- default = lib.mapAttrs (channel: channelCfg: let
- sourced = lib.filterAttrs (_: slot: slot.source != null) channelCfg.slots;
- in {
- inherit channel;
- complete = lib.attrNames sourced == lib.attrNames channelCfg.slots;
- 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);
- };
- };
-
config.enstate.package = pkgs.enstate;
}