From 6dd4c5f73faae32bea4bed2cf8f1a98328387129 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sat, 19 Aug 2023 16:29:08 +0100 Subject: [PATCH] nixos/woodpecker-agents: use 'literalExample' The next commit is going to add an option which takes a list of packages. So the example must be converted to make it documentable. This will also allow adding comments, to explain why some options are used. --- .../woodpecker/agents.nix | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/nixos/modules/services/continuous-integration/woodpecker/agents.nix b/nixos/modules/services/continuous-integration/woodpecker/agents.nix index 62719ee934af..4beb74ca5b39 100644 --- a/nixos/modules/services/continuous-integration/woodpecker/agents.nix +++ b/nixos/modules/services/continuous-integration/woodpecker/agents.nix @@ -106,28 +106,30 @@ in agents = lib.mkOption { default = { }; type = lib.types.attrsOf agentModule; - example = { - podman = { - environment = { - WOODPECKER_SERVER = "localhost:9000"; - WOODPECKER_BACKEND = "docker"; - DOCKER_HOST = "unix:///run/podman/podman.sock"; + example = lib.literalExpression '' + { + podman = { + environment = { + WOODPECKER_SERVER = "localhost:9000"; + WOODPECKER_BACKEND = "docker"; + DOCKER_HOST = "unix:///run/podman/podman.sock"; + }; + + extraGroups = [ "podman" ]; + + environmentFile = [ "/run/secrets/woodpecker/agent-secret.txt" ]; }; - extraGroups = [ "podman" ]; + exec = { + environment = { + WOODPECKER_SERVER = "localhost:9000"; + WOODPECKER_BACKEND = "local"; + }; - environmentFile = [ "/run/secrets/woodpecker/agent-secret.txt" ]; - }; - - exec = { - environment = { - WOODPECKER_SERVER = "localhost:9000"; - WOODPECKER_BACKEND = "local"; + environmentFile = [ "/run/secrets/woodpecker/agent-secret.txt" ]; }; - - environmentFile = [ "/run/secrets/woodpecker/agent-secret.txt" ]; - }; - }; + } + ''; description = lib.mdDoc "woodpecker-agents configurations"; }; };