aboutsummaryrefslogtreecommitdiff
path: root/systems/eldiron/websites/tools/webhooks.nix
blob: 337c8f8d6d2beaef7887a6843d262c0c0c6ec71f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{ lib, env, binEnv }:
{
  keys = lib.attrsets.mapAttrs' (k: v:
    lib.nameValuePair "webapps/webhooks/${k}.php" {
    user = "wwwrun";
    group = "wwwrun";
    permissions = "0400";
    text = builtins.replaceStrings ["{{webhooks-bin-env}}"] [ "${binEnv}" ] v;
    keyDependencies = [ binEnv ];
  }) env // lib.attrsets.mapAttrs' (k: v:
    lib.nameValuePair "webapps/webhooks/${k}/index.php" {
    user = "wwwrun";
    group = "wwwrun";
    permissions = "0400";
    text = builtins.replaceStrings ["{{webhooks-bin-env}}"] [ "${binEnv}" ] v;
    keyDependencies = [ binEnv ];
  }) env // {
    "webapps/webhooks" = {
      isDir = true;
      user = "wwwrun";
      group = "wwwrun";
      permissions = "0500";
    };
  };
}