nixos/buildkite-agents: fix race-condition when installing secrets

This commit is contained in:
Jörg Thalheim 2021-05-01 18:36:37 +02:00
parent 4e55c8bc67
commit 503b937542
No known key found for this signature in database
GPG key ID: B3F5D81B0C6967C4

View file

@ -238,8 +238,7 @@ in
in
optionalString (cfg.privateSshKeyPath != null) ''
mkdir -m 0700 -p "${sshDir}"
cp -f "${toString cfg.privateSshKeyPath}" "${sshDir}/id_rsa"
chmod 600 "${sshDir}"/id_rsa
install -m600 "${toString cfg.privateSshKeyPath}" "${sshDir}/id_rsa"
'' + ''
cat > "${cfg.dataDir}/buildkite-agent.cfg" <<EOF
token="$(cat ${toString cfg.tokenPath})"