From bbb6072f10ed115aadaa7d433e81b212203561b5 Mon Sep 17 00:00:00 2001 From: Kosyrev Serge Date: Tue, 5 Dec 2017 19:59:59 +0300 Subject: [PATCH] buildkite: allow configuration and actual use of agent-specific hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 775e49439fe25a4cdc2a93e31dfb3968b9b02311) Signed-off-by: Domen Kožar --- .../continuous-integration/buildkite-agent.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/continuous-integration/buildkite-agent.nix b/nixos/modules/services/continuous-integration/buildkite-agent.nix index dcc5e7174601..41a1cc9d6420 100644 --- a/nixos/modules/services/continuous-integration/buildkite-agent.nix +++ b/nixos/modules/services/continuous-integration/buildkite-agent.nix @@ -48,6 +48,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 { type = types.str; default = ""; @@ -114,10 +122,12 @@ in token="$(cat ${toString cfg.tokenPath})" name="${cfg.name}" meta-data="${cfg.meta-data}" - hooks-path="${pkgs.buildkite-agent}/share/hooks" build-path="${cfg.dataDir}/builds" + hooks-path="${cfg.hooks-path}" bootstrap-script="${pkgs.buildkite-agent}/share/bootstrap.sh" EOF + + chmod +x ${cfg.hooks-path}/* 2>/dev/null || true # Guard against read-only paths. ''; serviceConfig =