diff options
author | Florian Klink <flokli@flokli.de> | 2020-01-17 17:12:35 +0100 |
---|---|---|
committer | Florian Klink <flokli@flokli.de> | 2020-01-17 23:11:26 +0100 |
commit | 63c310c07eb04837130c26bc1149e9a19dd2b559 (patch) | |
tree | f3834ed653f97e096c977dbf122a527b4fe47e89 /nixos | |
parent | e1ad9d16857d53aab8762249af7bd566856ed81a (diff) |
nixos/buildkite-agent: change option meta-data into tags attrset
This is called tags in the buildkite 3.
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/continuous-integration/buildkite-agent.nix | 18 |
1 files 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 00b881ffe3c29..3c9c92bf05273 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 - <code>key=value</code> 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" <<EOF token="$(cat ${toString cfg.tokenPath})" name="${cfg.name}" - ${metaData} shell="${cfg.shell}" + tags="${tagStr}" build-path="${cfg.dataDir}/builds" hooks-path="${cfg.hooksPath}" ${cfg.extraConfig} @@ -258,5 +255,6 @@ in (mkRenamedOptionModule [ "services" "buildkite-agent" "openssh" "privateKeyPath" ] [ "services" "buildkite-agent" "privateSshKeyPath" ]) (mkRemovedOptionModule [ "services" "buildkite-agent" "openssh" "publicKey" ] "SSH public keys aren't necessary to clone private repos.") (mkRemovedOptionModule [ "services" "buildkite-agent" "openssh" "publicKeyPath" ] "SSH public keys aren't necessary to clone private repos.") + (mkRenamedOptionModule [ "services" "buildkite-agent" "meta-data"] [ "services" "buildkite-agent" "tags" ]) ]; } |