]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - modules/private/websites/tools/dav/default.nix
Add chatons infos
[perso/Immae/Config/Nix.git] / modules / private / websites / tools / dav / default.nix
1 { lib, pkgs, config, ... }:
2 let
3 infcloud = rec {
4 root = pkgs.webapps.infcloud;
5 vhostConf = ''
6 Alias /carddavmate ${root}
7 Alias /caldavzap ${root}
8 Alias /infcloud ${root}
9 <Directory ${root}>
10 AllowOverride All
11 Options FollowSymlinks
12 Require all granted
13 DirectoryIndex index.html
14 </Directory>
15 '';
16 };
17 davical = pkgs.callPackage ./davical.nix {
18 env = config.myEnv.tools.davical;
19 inherit (pkgs.webapps) davical awl;
20 inherit config;
21 };
22
23 cfg = config.myServices.websites.tools.dav;
24 in {
25 options.myServices.websites.tools.dav = {
26 enable = lib.mkEnableOption "enable dav website";
27 };
28
29 config = lib.mkIf cfg.enable {
30 myServices.chatonsProperties.services = {
31 davical = {
32 file.datetime = "2022-08-21T01:33:00";
33 service = {
34 name = "Davical";
35 description = "DAViCal is a server for calendar sharing";
36 website = "https://dav.immae.eu";
37 logo = "https://www.davical.org/images/logo.gif";
38 status.level = "OK";
39 status.description = "OK";
40 registration."" = ["MEMBER" "CLIENT"];
41 registration.load = "OPEN";
42 install.type = "PACKAGE";
43 };
44 software = {
45 name = "Davical";
46 website = "https://www.davical.org/";
47 license.url = "https://gitlab.com/davical-project/davical/-/blob/master/COPYING";
48 license.name = "GNU General Public License Version 2";
49 version = pkgs.webapps.davical.version;
50 source.url = "https://gitlab.com/davical-project/davical/";
51 modules = "infcloud";
52 };
53 };
54 #calendar = {
55 # file.datetime = "2022-08-22T00:00:00";
56 # service = {
57 # name = "Calendar";
58 # description = "Opensource CalDAV web client";
59 # website = "https://dav.immae.eu/caldavzap/";
60 # logo = "https://dav.immae.eu/caldavzap/images/infcloud_logo.svg";
61 # status.level = "OK";
62 # status.description = "OK";
63 # registration."" = ["MEMBER" "CLIENT"];
64 # registration.load = "OPEN";
65 # install.type = "PACKAGE";
66 # };
67 # software = {
68 # name = "InfCloud";
69 # website = "https://inf-it.com/open-source/clients/infcloud/";
70 # license.url = "https://www.gnu.org/licenses/agpl-3.0.en.html";
71 # license.name = "GNU Affero General Public License (version 3.0)";
72 # version = pkgs.webapps.infcloud.version;
73 # source.url = "https://inf-it.com/open-source/clients/infcloud/";
74 # };
75 #};
76 #contacts = {
77 # file.datetime = "2022-08-22T00:00:00";
78 # service = {
79 # name = "Contacts";
80 # description = "Opensource Carddav web client";
81 # website = "https://dav.immae.eu/carddavmate/";
82 # logo = "https://dav.immae.eu/caldavzap/images/infcloud_logo.svg";
83 # status.level = "OK";
84 # status.description = "OK";
85 # registration."" = ["MEMBER" "CLIENT"];
86 # registration.load = "OPEN";
87 # install.type = "PACKAGE";
88 # };
89 # software = {
90 # name = "InfCloud";
91 # website = "https://inf-it.com/open-source/clients/infcloud/";
92 # license.url = "https://www.gnu.org/licenses/agpl-3.0.en.html";
93 # license.name = "GNU Affero General Public License (version 3.0)";
94 # version = pkgs.webapps.infcloud.version;
95 # source.url = "https://inf-it.com/open-source/clients/infcloud/";
96 # };
97 #};
98 };
99 system.activationScripts.davical = davical.activationScript;
100 secrets.keys = davical.keys;
101 services.websites.env.tools.modules = davical.apache.modules;
102
103 services.websites.env.tools.vhostConfs.dav = {
104 certName = "eldiron";
105 addToCerts = true;
106 hosts = ["dav.immae.eu" ];
107 root = ./www;
108 extraConfig = [
109 infcloud.vhostConf
110 (davical.apache.vhostConf config.services.phpfpm.pools.davical.socket)
111 ];
112 };
113
114 services.phpfpm.pools = {
115 davical = {
116 user = config.services.httpd.Tools.user;
117 group = config.services.httpd.Tools.group;
118 settings = davical.phpFpm.pool;
119 phpPackage = pkgs.php72;
120 };
121 };
122 };
123 }
124