summary refs log tree commit diff
path: root/nixos/modules/services/continuous-integration
diff options
context:
space:
mode:
authorBruno BELANYI <bruno@belanyi.fr>2023-08-19 16:29:08 +0100
committerBruno BELANYI <bruno@belanyi.fr>2023-08-19 16:29:10 +0100
commit6dd4c5f73faae32bea4bed2cf8f1a98328387129 (patch)
tree5d4cea8e449cf40a75135a17f73d63c40d9478c6 /nixos/modules/services/continuous-integration
parent7d246a2873ea045ce7b2381f72a76f701f5abbd9 (diff)
downloadnixpkgs-6dd4c5f73faae32bea4bed2cf8f1a98328387129.tar
nixpkgs-6dd4c5f73faae32bea4bed2cf8f1a98328387129.tar.gz
nixpkgs-6dd4c5f73faae32bea4bed2cf8f1a98328387129.tar.bz2
nixpkgs-6dd4c5f73faae32bea4bed2cf8f1a98328387129.tar.lz
nixpkgs-6dd4c5f73faae32bea4bed2cf8f1a98328387129.tar.xz
nixpkgs-6dd4c5f73faae32bea4bed2cf8f1a98328387129.tar.zst
nixpkgs-6dd4c5f73faae32bea4bed2cf8f1a98328387129.zip
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.
Diffstat (limited to 'nixos/modules/services/continuous-integration')
-rw-r--r--nixos/modules/services/continuous-integration/woodpecker/agents.nix38
1 files 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 62719ee934a..4beb74ca5b3 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";
-            };
-
-            extraGroups = [ "podman" ];
+        example = lib.literalExpression ''
+          {
+            podman = {
+              environment = {
+                WOODPECKER_SERVER = "localhost:9000";
+                WOODPECKER_BACKEND = "docker";
+                DOCKER_HOST = "unix:///run/podman/podman.sock";
+              };
 
-            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" ];
             };
 
-            environmentFile = [ "/run/secrets/woodpecker/agent-secret.txt" ];
-          };
-        };
+            exec = {
+              environment = {
+                WOODPECKER_SERVER = "localhost:9000";
+                WOODPECKER_BACKEND = "local";
+              };
+
+              environmentFile = [ "/run/secrets/woodpecker/agent-secret.txt" ];
+            };
+          }
+        '';
         description = lib.mdDoc "woodpecker-agents configurations";
       };
     };