]>
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 | 37 | hosts = ["dav.immae.eu" ]; |
f00e1c4b | 38 | root = "/run/current-system/webapps/_dav"; |
10889174 | 39 | extraConfig = [ |
452c2314 | 40 | infcloud.vhostConf |
10889174 IB |
41 | davical.apache.vhostConf |
42 | ]; | |
43 | }; | |
44 | ||
441da8aa IB |
45 | services.phpfpm.pools = { |
46 | davical = { | |
47 | listen = davical.phpFpm.socket; | |
48 | extraConfig = davical.phpFpm.pool; | |
49 | }; | |
10889174 IB |
50 | }; |
51 | ||
f00e1c4b | 52 | myServices.websites.webappDirs._dav = ./www; |
4288c2f2 IB |
53 | myServices.websites.webappDirs."${davical.apache.webappName}" = davical.webRoot; |
54 | myServices.websites.webappDirs."${infcloud.webappName}" = pkgs.webapps.infcloud; | |
10889174 IB |
55 | }; |
56 | } | |
57 |