X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=systems%2Feldiron%2Fwebsites%2Ftools%2Fwebhooks.nix;h=337c8f8d6d2beaef7887a6843d262c0c0c6ec71f;hb=1a64deeb894dc95e2645a75771732c6cc53a79ad;hpb=fa25ffd4583cc362075cd5e1b4130f33306103f0;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/systems/eldiron/websites/tools/webhooks.nix b/systems/eldiron/websites/tools/webhooks.nix new file mode 100644 index 0000000..337c8f8 --- /dev/null +++ b/systems/eldiron/websites/tools/webhooks.nix @@ -0,0 +1,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"; + }; + }; +}