buildkite: allow configuration and actual use of agent-specific hooks

This commit is contained in:
Kosyrev Serge 2017-12-05 19:59:59 +03:00 committed by Domen Kožar
parent 69422ff361
commit 775e49439f

View File

@ -31,6 +31,14 @@ in
''; '';
}; };
hooks-path = mkOption {
type = types.str;
default = "${pkgs.buildkite-agent}/share/hooks";
description = ''
Path to the directory storing the hooks.
'';
};
meta-data = mkOption { meta-data = mkOption {
type = types.str; type = types.str;
default = ""; default = "";
@ -98,10 +106,12 @@ in
token="${catOrLiteral cfg.token}" token="${catOrLiteral cfg.token}"
name="${cfg.name}" name="${cfg.name}"
meta-data="${cfg.meta-data}" meta-data="${cfg.meta-data}"
hooks-path="${pkgs.buildkite-agent}/share/hooks" hooks-path="${cfg.hooks-path}"
build-path="/var/lib/buildkite-agent/builds" build-path="/var/lib/buildkite-agent/builds"
bootstrap-script="${pkgs.buildkite-agent}/share/bootstrap.sh" bootstrap-script="${pkgs.buildkite-agent}/share/bootstrap.sh"
EOF EOF
chmod +x ${cfg.hooks-path}/* 2>/dev/null || true # Guard against read-only paths.
''; '';
serviceConfig = serviceConfig =