Merge pull request #168 from input-output-hk/pre-commands-buildkite

buildkite: add preCommands option
This commit is contained in:
Daiderd Jordan 2020-01-28 08:26:42 +01:00 committed by GitHub
commit 3201be1bd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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"
'';