1 { lib, stdenv, fetchurl, unzip, writeText, dos2unix, dataPath ? "/var/lib/rainloop" }: let
2 common = { edition, sha256 }:
3 stdenv.mkDerivation (rec {
4 pname = "rainloop${lib.optionalString (edition != "") "-${edition}"}";
7 nativeBuildInputs = [ unzip dos2unix ];
11 unzip -q -d rainloop $src
15 url = "https://github.com/RainLoop/rainloop-webmail/releases/download/v${version}/rainloop-${edition}${lib.optionalString (edition != "") "-"}${version}.zip";
20 dos2unix ./rainloop/rainloop/v/1.16.0/app/libraries/MailSo/Base/HtmlUtils.php
24 ./fix-cve-2022-29360.patch
28 unix2dos ./rainloop/rainloop/v/1.16.0/app/libraries/MailSo/Base/HtmlUtils.php
31 includeScript = writeText "include.php" ''
37 function __get_custom_data_full_path()
39 $v = getenv('RAINLOOP_DATA_DIR', TRUE);
40 return $v === FALSE ? '${dataPath}' : $v;
48 cp ${includeScript} $out/include.php
54 description = "Simple, modern & fast web-based email client";
55 homepage = "https://www.rainloop.net";
56 downloadPage = "https://github.com/RainLoop/rainloop-webmail/releases";
57 license = with licenses; if edition == "" then unfree else agpl3Only;
58 platforms = platforms.all;
59 maintainers = with maintainers; [ das_j ];
63 rainloop-community = common {
64 edition = "community";
65 sha256 = "sha256-25ScQ2OwSKAuqg8GomqDhpebhzQZjCk57h6MxUNiymc=";
67 rainloop-standard = common {
69 sha256 = "sha256-aYCwqFqhJEeakn4R0MUDGcSp+M47JbbCrbYaML8aeSs=";