buildkite: add preCommands option

This commit is contained in:
Samuel Leathers 2019-10-17 14:40:49 -04:00
parent da52dc006c
commit c9d1defa33
No known key found for this signature in database
GPG key ID: 9BCE91C969768E0F

View file

@ -89,6 +89,13 @@ in
Extra lines to be added verbatim to the configuration file.
'';
};
services.buildkite-agent.preCommands = mkOption {
type = types.lines;
default = "";
description = ''
Extra commands to run before starting buildkite.
'';
};
services.buildkite-agent.openssh =
{ privateKeyPath = mkOption {
@ -215,6 +222,8 @@ in
chmod 750 "${cfg.dataDir}"
chmod 640 "${cfg.dataDir}/buildkite-agent.cfg"
${cfg.preCommands}
exec buildkite-agent start --config "${cfg.dataDir}/buildkite-agent.cfg"
'';