]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - modules/private/websites/tools/im/default.nix
Add ejabberd service and website
[perso/Immae/Config/Nix.git] / modules / private / websites / tools / im / default.nix
1 { config, lib, ... }:
2 let
3 cfg = config.myServices.websites.tools.im;
4 in
5 {
6 options.myServices.websites.tools.im = {
7 enable = lib.mkEnableOption "enable im website";
8 };
9
10 config = lib.mkIf cfg.enable {
11 services.websites.env.tools.vhostConfs.im = {
12 certName = "eldiron";
13 addToCerts = true;
14 hosts = ["im.immae.fr"];
15 root = ./www;
16 extraConfig = [
17 ''
18 Alias /converse ${./www}/converse.html
19 ProxyPreserveHost On
20 <Location "/bosh">
21 ProxyPass http://localhost:5280/bosh
22 ProxyPassReverse http://localhost:5280/bosh
23 </Location>
24 <Location "/ws">
25 ProxyPass ws://localhost:5280/ws
26 </Location>
27 ProxyPass /upload http://localhost:5280/upload
28 ProxyPassReverse /upload http://localhost:5280/upload
29 ProxyPass /admin http://localhost:5280/admin
30 ProxyPassReverse /admin http://localhost:5280/admin
31 ProxyPass /api http://localhost:5280/api
32 ProxyPassReverse /api http://localhost:5280/api
33 ''
34 ];
35 };
36 };
37 }