]>
Commit | Line | Data |
---|---|---|
ab8f306d | 1 | { lib, pkgs, config, ... }: |
10889174 | 2 | let |
452c2314 IB |
3 | infcloud = rec { |
4 | webappName = "tools_infcloud"; | |
5 | root = "/run/current-system/webapps/${webappName}"; | |
6 | vhostConf = '' | |
7 | Alias /carddavmate ${root} | |
8 | Alias /caldavzap ${root} | |
9 | Alias /infcloud ${root} | |
10 | <Directory ${root}> | |
11 | AllowOverride All | |
12 | Options FollowSymlinks | |
13 | Require all granted | |
14 | DirectoryIndex index.html | |
15 | </Directory> | |
16 | ''; | |
17 | }; | |
9d90e7e2 | 18 | davical = pkgs.callPackage ./davical.nix { |
ab8f306d | 19 | env = config.myEnv.tools.davical; |
452c2314 | 20 | inherit (pkgs.webapps) davical awl; |
9d90e7e2 | 21 | }; |
10889174 | 22 | |
4288c2f2 | 23 | cfg = config.myServices.websites.tools.dav; |
10889174 | 24 | in { |
4288c2f2 | 25 | options.myServices.websites.tools.dav = { |
10889174 IB |
26 | enable = lib.mkEnableOption "enable dav website"; |
27 | }; | |
28 | ||
29 | config = lib.mkIf cfg.enable { | |
4288c2f2 | 30 | system.activationScripts.davical = davical.activationScript; |
1a718805 | 31 | secrets.keys = davical.keys; |
29f8cb85 | 32 | services.websites.env.tools.modules = davical.apache.modules; |
10889174 | 33 | |
29f8cb85 | 34 | services.websites.env.tools.vhostConfs.dav = { |
10889174 | 35 | certName = "eldiron"; |
7df420c2 | 36 | addToCerts = true; |
10889174 IB |
37 | hosts = ["dav.immae.eu" ]; |
38 | root = null; | |
39 | extraConfig = [ | |
452c2314 | 40 | infcloud.vhostConf |
10889174 IB |
41 | davical.apache.vhostConf |
42 | ]; | |
43 | }; | |
44 | ||
f40f5b23 | 45 | services.phpfpm.poolConfigs = { |
10889174 IB |
46 | davical = davical.phpFpm.pool; |
47 | }; | |
48 | ||
4288c2f2 IB |
49 | myServices.websites.webappDirs."${davical.apache.webappName}" = davical.webRoot; |
50 | myServices.websites.webappDirs."${infcloud.webappName}" = pkgs.webapps.infcloud; | |
10889174 IB |
51 | }; |
52 | } | |
53 |