{ lib, stdenv, fetchurl, unzip, writeText, dos2unix, dataPath ? "/var/lib/rainloop", }: let common = { edition, sha256 }: stdenv.mkDerivation (rec { pname = "rainloop${lib.optionalString (edition != "") "-${edition}"}"; version = "1.16.0"; nativeBuildInputs = [ unzip dos2unix ]; unpackPhase = '' mkdir rainloop unzip -q -d rainloop $src ''; src = fetchurl { url = "https://github.com/RainLoop/rainloop-webmail/releases/download/v${version}/rainloop-${edition}${ lib.optionalString (edition != "") "-" }${version}.zip"; sha256 = sha256; }; prePatch = '' dos2unix ./rainloop/rainloop/v/1.16.0/app/libraries/MailSo/Base/HtmlUtils.php ''; patches = [ ./fix-cve-2022-29360.patch ]; postPatch = '' unix2dos ./rainloop/rainloop/v/1.16.0/app/libraries/MailSo/Base/HtmlUtils.php ''; includeScript = writeText "include.php" ''