aboutsummaryrefslogtreecommitdiff
path: root/nixops
diff options
context:
space:
mode:
Diffstat (limited to 'nixops')
-rw-r--r--nixops/modules/websites/default.nix1
-rw-r--r--nixops/modules/websites/tools/tools/default.nix1
-rw-r--r--nixops/modules/websites/tools/tools/roundcubemail.nix134
3 files changed, 128 insertions, 8 deletions
diff --git a/nixops/modules/websites/default.nix b/nixops/modules/websites/default.nix
index 49dc5f7..ad97d7f 100644
--- a/nixops/modules/websites/default.nix
+++ b/nixops/modules/websites/default.nix
@@ -170,6 +170,7 @@ in
170 networking.firewall.allowedTCPPorts = [ 80 443 ]; 170 networking.firewall.allowedTCPPorts = [ 80 443 ];
171 171
172 nixpkgs.overlays = [ (self: super: rec { 172 nixpkgs.overlays = [ (self: super: rec {
173 #openssl = self.openssl_1_1;
173 php = php72; 174 php = php72;
174 php72 = (super.php72.override { 175 php72 = (super.php72.override {
175 mysql.connector-c = self.mariadb; 176 mysql.connector-c = self.mariadb;
diff --git a/nixops/modules/websites/tools/tools/default.nix b/nixops/modules/websites/tools/tools/default.nix
index 8edbdd9..aa59e28 100644
--- a/nixops/modules/websites/tools/tools/default.nix
+++ b/nixops/modules/websites/tools/tools/default.nix
@@ -129,6 +129,7 @@ in {
129 ]; 129 ];
130 }; 130 };
131 131
132 services.myPhpfpm.poolPhpConfigs.roundcubemail = roundcubemail.phpFpm.phpConfig;
132 services.myPhpfpm.poolConfigs = { 133 services.myPhpfpm.poolConfigs = {
133 adminer = adminer.phpFpm.pool; 134 adminer = adminer.phpFpm.pool;
134 ttrss = ttrss.phpFpm.pool; 135 ttrss = ttrss.phpFpm.pool;
diff --git a/nixops/modules/websites/tools/tools/roundcubemail.nix b/nixops/modules/websites/tools/tools/roundcubemail.nix
index 58a1be5..abd0387 100644
--- a/nixops/modules/websites/tools/tools/roundcubemail.nix
+++ b/nixops/modules/websites/tools/tools/roundcubemail.nix
@@ -1,7 +1,72 @@
1{ lib, env, writeText, stdenv, fetchurl, fetchedGithub }: 1{ lib, env, writeText, stdenv, fetchurl, fetchedGithub, phpPackages, apacheHttpd }:
2let 2let
3 roundcubemail = let 3 roundcubemail = let
4 plugins = {}; 4 defaultInstall = ''
5 mkdir -p $out
6 cp -R . $out/
7 cd $out
8 if [ -d skins -a -d skins/larry -a ! -d skins/elastic ]; then
9 ln -s larry skins/elastic
10 fi
11 '';
12 buildPlugin = { appName, version, url, sha256, installPhase ? defaultInstall }:
13 stdenv.mkDerivation rec {
14 name = "roundcube-${appName}-${version}";
15 inherit version;
16 phases = "unpackPhase installPhase";
17 inherit installPhase;
18 src = fetchurl { inherit url sha256; };
19 };
20 plugins = {
21 carddav = buildPlugin rec {
22 appName = "carddav";
23 version = "3.0.3";
24 url = "https://github.com/blind-coder/rcmcarddav/releases/download/v${version}/${appName}-${version}.tar.bz2";
25 sha256 = "0cf5rnqkhhag2vdy808zfpr4l5586fn43nvcia8ac1ha58azrxal";
26 };
27 contextmenu = buildPlugin rec {
28 appName = "contextmenu";
29 version = "2.3";
30 url = "https://github.com/johndoh/roundcube-${appName}/archive/${version}.tar.gz";
31 sha256 = "1rb8n821ylfniiiccfskc534vd6rczhk3g82455ks3m09q6l8hif";
32 };
33 contextmenu_folder = buildPlugin rec {
34 appName = "contextmenu_folder";
35 version = "1.3.3";
36 url = "https://github.com/random-cuber/${appName}/archive/${version}.tar.gz";
37 sha256 = "1ngfws1v8qrpa52rjh7kirc98alchk2vbqwra86h00agyjjlcc57";
38 };
39 automatic_addressbook = buildPlugin rec {
40 appName = "automatic_addressbook";
41 version = "0.4.3";
42 url = "https://github.com/sblaisot/${appName}/archive/${version}.tar.gz";
43 sha256 = "0bx5qjzp3a3wc72fr295bvgsy5n15949c041hq76n6c7sqdn7inc";
44 };
45 message_highlight = buildPlugin rec {
46 appName = "message_highlight";
47 version = "4.4";
48 url = "https://github.com/corbosman/${appName}/archive/${version}.tar.gz";
49 sha256 = "12c4x47y70xdl5pgm8csh5i4yiyhpi232lvjbixmca6di4lkhh9j";
50 };
51 thunderbird_labels = buildPlugin rec {
52 appName = "thunderbird_labels";
53 version = "v1.3.2";
54 url = "https://github.com/mike-kfed/roundcube-${appName}/archive/${version}.tar.gz";
55 sha256 = "1q4x30w66m02v3lw2n8020g0158rmyfzs6gydfk89pa1hs28k9bg";
56 };
57 html5_notifier = buildPlugin rec {
58 appName = "html5_notifier";
59 version = "v0.6.2";
60 url = "https://github.com/stremlau/${appName}/archive/${version}.tar.gz";
61 sha256 = "0s1wq9ira4bcd8jvhn93nhxiqzpp92i0za2kw37kf7ksyhr0xslq";
62 };
63 ident_switch = buildPlugin rec {
64 appName = "ident_switch";
65 version = "4.0.1";
66 url = "https://bitbucket.org/BoresExpress/${appName}/get/${version}.tar.gz";
67 sha256 = "1zyy40lfq2kn7hkghbl8lgp18fb634zr4fxmmxvb1wqyvqdpdpyk";
68 };
69 };
5 skins = {}; 70 skins = {};
6 in rec { 71 in rec {
7 varDir = "/var/lib/roundcubemail"; 72 varDir = "/var/lib/roundcubemail";
@@ -9,7 +74,7 @@ let
9 deps = [ "wrappers" ]; 74 deps = [ "wrappers" ];
10 text = '' 75 text = ''
11 install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir} \ 76 install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir} \
12 ${varDir}/cache 77 ${varDir}/cache ${varDir}/logs
13 install -m 0750 -o ${apache.user} -g ${apache.group} -d ${varDir}/phpSessions 78 install -m 0750 -o ${apache.user} -g ${apache.group} -d ${varDir}/phpSessions
14 ''; 79 '';
15 }; 80 };
@@ -27,7 +92,51 @@ let
27 92
28 $config['des_key'] = '${env.secret}'; 93 $config['des_key'] = '${env.secret}';
29 94
30 $config['plugins'] = array(); 95 $config['skin'] = 'elastic';
96 $config['plugins'] = array(
97 // 'acl',
98 // 'additional_message_headers',
99 // 'archive',
100 'attachment_reminder',
101 // 'autologon',
102 // 'database_attachments',
103 // 'debug_logger',
104 // 'emoticons',
105 // 'enigma',
106 // 'example_addressbook',
107 // 'filesystem_attachments',
108 // 'help',
109 // 'hide_blockquote',
110 // 'http_authentication',
111 // 'identicon',
112 // 'identity_select',
113 // 'jqueryui',
114 // 'krb_authentication',
115 // 'managesieve',
116 // 'markasjunk',
117 // 'new_user_dialog',
118 // 'new_user_identity',
119 // 'newmail_notifier',
120 // 'password',
121 // 'redundant_attachments',
122 // 'show_additional_headers',
123 // 'squirrelmail_usercopy',
124 // 'subscriptions_option',
125 // 'userinfo',
126 // 'vcard_attachments',
127 // 'virtuser_file',
128 // 'virtuser_query',
129 // 'zipdownload',
130
131 // 'automatic_addressbook',
132 // 'carddav',
133 // 'contextmenu',
134 // 'contextmenu_folder',
135 // 'html5_notifier',
136 // 'ident_switch',
137 // 'message_highlight',
138 // 'thunderbird_labels',
139 );
31 140
32 $config['language'] = 'fr_FR'; 141 $config['language'] = 'fr_FR';
33 142
@@ -40,19 +149,22 @@ let
40 $config['enable_installer'] = false; 149 $config['enable_installer'] = false;
41 $config['log_driver'] = 'stdout'; 150 $config['log_driver'] = 'stdout';
42 $config['temp_dir'] = '${varDir}/cache'; 151 $config['temp_dir'] = '${varDir}/cache';
43 $config['debug_level'] = 1; 152 $config['mime_types'] = '${apacheHttpd}/conf/mime.types';
44 ''; 153 '';
45 webRoot = stdenv.mkDerivation rec { 154 webRoot = stdenv.mkDerivation rec {
46 version = "1.3.8"; 155 version = "1.4-rc1";
47 name = "roundcubemail-${version}"; 156 name = "roundcubemail-${version}";
48 src= fetchurl { 157 src= fetchurl {
49 url = "https://github.com/roundcube/roundcubemail/releases/download/${version}/${name}-complete.tar.gz"; 158 url = "https://github.com/roundcube/roundcubemail/releases/download/${version}/${name}-complete.tar.gz";
50 sha256 = "018djad7ygfl9c9f2l2j42qkg31ml3hs2f01f0dk361zckwk77n4"; 159 sha256 = "0p18wffwi2prh6vxhx1bc69qd1vwybggm8gvg3shahfdknxci9i4";
51 }; 160 };
52 buildPhase = '' 161 buildPhase = ''
53 sed -i \ 162 sed -i \
54 -e "s|RCUBE_INSTALL_PATH . 'temp.*|'${varDir}/cache';|" \ 163 -e "s|RCUBE_INSTALL_PATH . 'temp.*|'${varDir}/cache';|" \
55 config/defaults.inc.php 164 config/defaults.inc.php
165 sed -i \
166 -e "s|RCUBE_INSTALL_PATH . 'logs.*|'${varDir}/logs';|" \
167 config/defaults.inc.php
56 ''; 168 '';
57 installPhase = '' 169 installPhase = ''
58 cp -a . $out 170 cp -a . $out
@@ -90,6 +202,10 @@ let
90 [ webRoot config varDir ] 202 [ webRoot config varDir ]
91 ++ lib.attrsets.mapAttrsToList (name: value: value) plugins 203 ++ lib.attrsets.mapAttrsToList (name: value: value) plugins
92 ++ lib.attrsets.mapAttrsToList (name: value: value) skins); 204 ++ lib.attrsets.mapAttrsToList (name: value: value) skins);
205 phpConfig = ''
206 date.timezone = 'CET'
207 extension=${phpPackages.imagick}/lib/php/extensions/imagick.so
208 '';
93 socket = "/var/run/phpfpm/roundcubemail.sock"; 209 socket = "/var/run/phpfpm/roundcubemail.sock";
94 pool = '' 210 pool = ''
95 listen = ${socket} 211 listen = ${socket}
@@ -103,7 +219,9 @@ let
103 219
104 ; Needed to avoid clashes in browser cookies (same domain) 220 ; Needed to avoid clashes in browser cookies (same domain)
105 php_value[session.name] = RoundcubemailPHPSESSID 221 php_value[session.name] = RoundcubemailPHPSESSID
106 php_admin_value[open_basedir] = "${basedir}:/tmp" 222 php_admin_value[upload_max_filesize] = 200M
223 php_admin_value[post_max_size] = 200M
224 php_admin_value[open_basedir] = "${basedir}:${apacheHttpd}/conf/mime.types:/tmp"
107 php_admin_value[session.save_path] = "${varDir}/phpSessions" 225 php_admin_value[session.save_path] = "${varDir}/phpSessions"
108 ''; 226 '';
109 }; 227 };