move everything into own nix files

This commit is contained in:
2026-10-15 01:40:08 -04:00
parent 3103e4d071
commit c4cea79807
9 changed files with 64 additions and 213 deletions
+13 -41
View File
@@ -1,42 +1,14 @@
{ pkgs }:
{
writeShellApplication,
webhook,
pigeon-hooks
}:
let
hooks = pkgs.writeText "pigeon-hooks.json" (builtins.toJSON [{
id = "release";
execute-command = "{./pigeon.sh}";
include-command-output-in-response = false;
pass-arguments-to-command = [
{ source = "payload"; name = "project.git_http_url"; }
{ source = "payload"; name = "project.id"; }
{ source = "payload"; name = "tag"; }
{ source = "payload"; name = "commit.id"; }
];
trigger-rule.and = [
{
match = {
type = "value";
parameter = { source = "header"; name = "X-Gitlab-Event"; };
value = "Release Hook";
};
match = {
type = "value";
parameter = { source = "payload"; name = "action"; };
value = "create";
};
match = {
type = "value";
parameter = { source = "header"; name = "X-Gitlab-Token"; };
value = "{{ getenv `PIGEON_GITLAB_TOKEN` | js }}";
};
}
];
}]);
in
pkgs.writeShellApplication {
name = "pigeon";
runtimeInputs = [ pkgs.webhook ];
text = ''
: ''${PIGEON_GITLAB_TOKEN:?}
exec webhook -hooks ${hooks} -template -port "''${PIGEON_PORT:-9000}" -verbose
'';
}
writeShellApplication {
name = "pigeon-webhook";
runtimeInputs = [ webhook ];
text = ''
: "''${PIGEON_GITLAB_SECRET:?}"
exec webhook -hooks ${pigeon-hooks} -template -port "''${PIGEON_PORT:-3000}" -verbose
'';
}