diff --git a/nixos/modules/services/continuous-integration/buildkite-agent.nix b/nixos/modules/services/continuous-integration/buildkite-agent.nix index 36d321e59d83..161ed7801a39 100644 --- a/nixos/modules/services/continuous-integration/buildkite-agent.nix +++ b/nixos/modules/services/continuous-integration/buildkite-agent.nix @@ -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 { type = types.str; default = ""; @@ -98,10 +106,12 @@ in token="${catOrLiteral cfg.token}" name="${cfg.name}" meta-data="${cfg.meta-data}" - hooks-path="${pkgs.buildkite-agent}/share/hooks" + hooks-path="${cfg.hooks-path}" build-path="/var/lib/buildkite-agent/builds" bootstrap-script="${pkgs.buildkite-agent}/share/bootstrap.sh" EOF + + chmod +x ${cfg.hooks-path}/* 2>/dev/null || true # Guard against read-only paths. ''; serviceConfig =