From 208feca214b26d91992b010e0b20615323f3710e Mon Sep 17 00:00:00 2001 From: Ian Duncan Date: Thu, 23 Jan 2025 16:01:24 +0100 Subject: [PATCH 1/3] Support temporal dynamic config args --- src/modules/services/temporal.nix | 40 +++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/src/modules/services/temporal.nix b/src/modules/services/temporal.nix index d73ece406..bbeceacfa 100644 --- a/src/modules/services/temporal.nix +++ b/src/modules/services/temporal.nix @@ -1,4 +1,8 @@ -{ pkgs, lib, config, ... }: +{ pkgs +, lib +, config +, ... +}: let cfg = config.services.temporal; @@ -6,17 +10,19 @@ let databaseFile = config.env.DEVENV_STATE + "/temporal.sqlite"; - commandArgs = [ - "--log-format=pretty" - "--ip=${cfg.ip}" - "--port=${toString cfg.port}" - "--headless=${lib.boolToString (!cfg.ui.enable)}" - "--ui-ip=${cfg.ui.ip}" - "--ui-port=${toString cfg.ui.port}" - ] ++ - (lib.forEach cfg.namespaces (namespace: "--namespace=${namespace}")) ++ - (lib.optionals (!cfg.state.ephemeral) [ "--db-filename=${databaseFile}" ]) ++ - (lib.mapAttrsToList (name: value: "--sqlite-pragma ${name}=${value}") cfg.state.sqlite-pragma); + commandArgs = + [ + "--log-format=pretty" + "--ip=${cfg.ip}" + "--port=${toString cfg.port}" + "--headless=${lib.boolToString (!cfg.ui.enable)}" + "--ui-ip=${cfg.ui.ip}" + "--ui-port=${toString cfg.ui.port}" + ] + ++ (lib.forEach cfg.namespaces (namespace: "--namespace=${namespace}")) + ++ (lib.optionals (!cfg.state.ephemeral) [ "--db-filename=${databaseFile}" ]) + ++ (lib.mapAttrsToList (name: value: "--sqlite-pragma ${name}=${value}") cfg.state.sqlite-pragma) + ++ (lib.mapAttrsToList (name: value: "--dynamic-config-value ${name}=${value}") cfg.dynamicConfig); in { options.services.temporal = { @@ -101,6 +107,16 @@ in default = { }; description = "State configuration."; }; + + dynamicConfig = lib.mkOption { + type = types.attrsOf types.str; + default = { }; + description = "Dynamic configuration for the Temporal server."; + example = { + "frontend.rps" = "2500"; + "frontend.namespacerps" = "2500"; + }; + }; }; config = lib.mkIf cfg.enable { From d4eff74e841a6d20d657f47371b7bdcb0ef8e968 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 15:07:13 +0000 Subject: [PATCH 2/3] Auto generate docs/reference/options.md --- docs/reference/options.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/docs/reference/options.md b/docs/reference/options.md index af8429fd4..80db5a5bb 100644 --- a/docs/reference/options.md +++ b/docs/reference/options.md @@ -81173,6 +81173,38 @@ package +## services.temporal.dynamicConfig + + + +Dynamic configuration for the Temporal server. + + + +*Type:* +attribute set of string + + + +*Default:* +` { } ` + + + +*Example:* + +``` +{ + "frontend.namespacerps" = "2500"; + "frontend.rps" = "2500"; +} +``` + +*Declared by:* + - [https://github.com/cachix/devenv/blob/main/src/modules/services/temporal.nix](https://github.com/cachix/devenv/blob/main/src/modules/services/temporal.nix) + + + ## services.temporal.ip From 4a4532d48ccf2522d6760e59b2d91dc89b36cc03 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 15:08:16 +0000 Subject: [PATCH 3/3] Auto generate docs and examples --- docs/supported-services/temporal.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docs/supported-services/temporal.md b/docs/supported-services/temporal.md index 4b47a1687..868eb513a 100644 --- a/docs/supported-services/temporal.md +++ b/docs/supported-services/temporal.md @@ -5,6 +5,8 @@ ## services\.temporal\.enable + + Whether to enable Temporal process\. @@ -42,6 +44,33 @@ package +## services\.temporal\.dynamicConfig + +Dynamic configuration for the Temporal server\. + + + +*Type:* +attribute set of string + + + +*Default:* +` { } ` + + + +*Example:* + +``` +{ + "frontend.namespacerps" = "2500"; + "frontend.rps" = "2500"; +} +``` + + + ## services\.temporal\.ip