diff options
Diffstat (limited to 'nixos/modules/services/continuous-integration/woodpecker/agents.nix')
-rw-r--r-- | nixos/modules/services/continuous-integration/woodpecker/agents.nix | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/nixos/modules/services/continuous-integration/woodpecker/agents.nix b/nixos/modules/services/continuous-integration/woodpecker/agents.nix index ac6ec45c0ba7b..2dd6e39bdd946 100644 --- a/nixos/modules/services/continuous-integration/woodpecker/agents.nix +++ b/nixos/modules/services/continuous-integration/woodpecker/agents.nix @@ -9,6 +9,8 @@ let agentModule = lib.types.submodule { options = { + enable = lib.mkEnableOption (lib.mdDoc "this Woodpecker-Agent. Agents execute tasks generated by a Server, every install will need one server and at least one agent"); + package = lib.mkPackageOptionMD pkgs "woodpecker-agent" { }; environment = lib.mkOption { @@ -101,8 +103,6 @@ in options = { services.woodpecker-agents = { - enable = lib.mkEnableOption (lib.mdDoc "the Woodpecker-Agent, Agents execute tasks generated by a Server, every install will need one server and at least one agent"); - agents = lib.mkOption { default = { }; type = lib.types.attrsOf agentModule; @@ -133,7 +133,12 @@ in }; }; - config = lib.mkIf cfg.enable { - systemd.services = lib.mapAttrs' mkAgentService cfg.agents; + config = { + systemd.services = + let + mkServices = lib.mapAttrs' mkAgentService; + enabledAgents = lib.filterAttrs (_: agent: agent.enable) cfg.agents; + in + mkServices enabledAgents; }; } |