diff --git a/nix/module-eval/nats-authelia.nix b/nix/module-eval/nats-authelia.nix index 4cb15060..d12e19bf 100644 --- a/nix/module-eval/nats-authelia.nix +++ b/nix/module-eval/nats-authelia.nix @@ -377,16 +377,30 @@ let && lib.hasInfix "services.hyperhive.${path}" a.message && lib.hasInfix "live in the swarm secret store" a.message ) m.assertions; - setting = { - "deploy.nats.autoGenerateCallout" = hive { deploy.nats.autoGenerateCallout = true; }; - "swarm.nats.autoGenerateCallout" = hive { swarm.nats.autoGenerateCallout = true; }; - "deploy.nats.calloutUserPublicKey" = hive { deploy.nats.calloutUserPublicKey = "U"; }; - "deploy.nats.calloutIssuerPublicKey" = hive { deploy.nats.calloutIssuerPublicKey = "A"; }; - "deploy.nats.calloutUserSeedFile" = hive { deploy.nats.calloutUserSeedFile = "/run/u.seed"; }; - "swarm.nats.calloutIssuerSeedFile" = hive { swarm.nats.calloutIssuerSeedFile = "/run/i.seed"; }; + removedOptions = { + autoGenerateCallout = true; + calloutUserPublicKey = "U"; + calloutIssuerPublicKey = "A"; + calloutUserSeedFile = "/run/u.seed"; + calloutIssuerSeedFile = "/run/i.seed"; }; + setting = lib.listToAttrs ( + lib.concatMap + ( + ns: + lib.mapAttrsToList (name: value: { + name = "${ns}.nats.${name}"; + value = hive { ${ns}.nats.${name} = value; }; + }) removedOptions + ) + [ + "deploy" + "swarm" + ] + ); in - lib.all (path: refused setting.${path} path) (lib.attrNames setting) + lib.length (lib.attrNames setting) == 10 + && lib.all (path: refused setting.${path} path) (lib.attrNames setting) && !(lib.any (path: refused natsWithStoreIdentity path) (lib.attrNames setting)); } {