1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00

Allow multiple tags with the same name in buildkite-agents.nix

This commit is contained in:
Heinrich Apfelmus 2023-11-23 13:00:39 +01:00
parent 4b9b83d5a9
commit 5039f01cdd

View file

@ -235,7 +235,11 @@ in
## don't end up in the Nix store. ## don't end up in the Nix store.
script = let script = let
sshDir = "${cfg.dataDir}/.ssh"; sshDir = "${cfg.dataDir}/.ssh";
tagStr = lib.concatStringsSep "," (lib.mapAttrsToList (name: value: "${name}=${value}") cfg.tags); tagStr = name: value:
if lib.isList value
then lib.concatStringsSep "," (builtins.map (v: "${name}=${v}") value)
else "${name}=${value}";
tagsStr = lib.concatStringsSep "," (lib.mapAttrsToList tagStr cfg.tags);
in in
optionalString (cfg.privateSshKeyPath != null) '' optionalString (cfg.privateSshKeyPath != null) ''
mkdir -m 0700 -p "${sshDir}" mkdir -m 0700 -p "${sshDir}"
@ -245,7 +249,7 @@ in
token="$(cat ${toString cfg.tokenPath})" token="$(cat ${toString cfg.tokenPath})"
name="${cfg.name}" name="${cfg.name}"
shell="${cfg.shell}" shell="${cfg.shell}"
tags="${tagStr}" tags="${tagsStr}"
build-path="${cfg.dataDir}/builds" build-path="${cfg.dataDir}/builds"
hooks-path="${cfg.hooksPath}" hooks-path="${cfg.hooksPath}"
${cfg.extraConfig} ${cfg.extraConfig}