From 63c310c07eb04837130c26bc1149e9a19dd2b559 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Fri, 17 Jan 2020 17:12:35 +0100 Subject: [PATCH] nixos/buildkite-agent: change option meta-data into tags attrset This is called tags in the buildkite 3. --- .../continuous-integration/buildkite-agent.nix | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/nixos/modules/services/continuous-integration/buildkite-agent.nix b/nixos/modules/services/continuous-integration/buildkite-agent.nix index 00b881ffe3c2..3c9c92bf0527 100644 --- a/nixos/modules/services/continuous-integration/buildkite-agent.nix +++ b/nixos/modules/services/continuous-integration/buildkite-agent.nix @@ -74,13 +74,12 @@ in ''; }; - meta-data = mkOption { - type = types.str; - default = ""; - example = "queue=default,docker=true,ruby2=true"; + tags = mkOption { + type = types.attrsOf types.str; + default = {}; + example = { queue = "default"; docker = "true"; ruby2 ="true"; }; description = '' - Meta data for the agent. This is a comma-separated list of - key=value pairs. + Tags for the agent. ''; }; @@ -211,9 +210,7 @@ in ## don't end up in the Nix store. preStart = let sshDir = "${cfg.dataDir}/.ssh"; - metaData = if cfg.meta-data == "" - then "" - else "meta-data=${cfg.meta-data}"; + tagStr = lib.concatStringsSep "," (lib.mapAttrsToList (name: value: "${name}=${value}") cfg.tags); in '' mkdir -m 0700 -p "${sshDir}" @@ -223,8 +220,8 @@ in cat > "${cfg.dataDir}/buildkite-agent.cfg" <