@@ -48,6 +48,14 @@ in
4848 '';
4949 };
5050
51+ hooks-path = mkOption {
52+ type = types.str;
53+ default = "${pkgs.buildkite-agent}/share/hooks";
54+ description = ''
55+ Path to the directory storing the hooks.
56+ '';
57+ };
58+
5159 meta-data = mkOption {
5260 type = types.str;
5361 default = "";
@@ -114,10 +122,12 @@ in
114122 token="$(cat ${toString cfg.tokenPath})"
115123 name="${cfg.name}"
116124 meta-data="${cfg.meta-data}"
117− hooks-path="${pkgs.buildkite-agent}/share/hooks"
118125 build-path="${cfg.dataDir}/builds"
126+ hooks-path="${cfg.hooks-path}"
119127 bootstrap-script="${pkgs.buildkite-agent}/share/bootstrap.sh"
120128 EOF
129+
130+ chmod +x ${cfg.hooks-path}/* 2>/dev/null || true # Guard against read-only paths.
121131 '';
122132
123133 serviceConfig =