summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorPascal Bach <pascal.bach@nextrem.ch>2022-04-27 19:30:26 +0200
committerGitHub <noreply@github.com>2022-04-27 19:30:26 +0200
commitee385d836442ce60d20182b4742d65989726718e (patch)
tree356bc5013a5095c04858bdef5b520692b691dee1 /nixos
parenta231ab1096537dd4f4852adec84ed7ebfc0e6c39 (diff)
parentc1e318d0c5d2a065cecb9299fc58f889050f4149 (diff)
downloadnixpkgs-ee385d836442ce60d20182b4742d65989726718e.tar
nixpkgs-ee385d836442ce60d20182b4742d65989726718e.tar.gz
nixpkgs-ee385d836442ce60d20182b4742d65989726718e.tar.bz2
nixpkgs-ee385d836442ce60d20182b4742d65989726718e.tar.lz
nixpkgs-ee385d836442ce60d20182b4742d65989726718e.tar.xz
nixpkgs-ee385d836442ce60d20182b4742d65989726718e.tar.zst
nixpkgs-ee385d836442ce60d20182b4742d65989726718e.zip
Merge pull request #170396 from teto/gitlab-description
services.gitlab-runner: support runner description
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/continuous-integration/gitlab-runner.nix11
1 files changed, 9 insertions, 2 deletions
diff --git a/nixos/modules/services/continuous-integration/gitlab-runner.nix b/nixos/modules/services/continuous-integration/gitlab-runner.nix
index dc58c634523..85ac0fb2a89 100644
--- a/nixos/modules/services/continuous-integration/gitlab-runner.nix
+++ b/nixos/modules/services/continuous-integration/gitlab-runner.nix
@@ -36,12 +36,12 @@ let
 
       # register new services
       ${concatStringsSep "\n" (mapAttrsToList (name: service: ''
-        if echo "$NEW_SERVICES" | grep -xq ${name}; then
+        if echo "$NEW_SERVICES" | grep -xq "${name}"; then
           bash -c ${escapeShellArg (concatStringsSep " \\\n " ([
             "set -a && source ${service.registrationConfigFile} &&"
             "gitlab-runner register"
             "--non-interactive"
-            "--name ${name}"
+            (if service.description != null then "--description \"${service.description}\"" else "--name '${name}'")
             "--executor ${service.executor}"
             "--limit ${toString service.limit}"
             "--request-concurrency ${toString service.requestConcurrency}"
@@ -365,6 +365,13 @@ in
               with <literal>RUNNER_ENV</literal> variable set.
             '';
           };
+          description = mkOption {
+            type = types.nullOr types.str;
+            default = null;
+            description = ''
+              Name/description of the runner.
+            '';
+          };
           executor = mkOption {
             type = types.str;
             default = "docker";