2020-02-23 20:18:49 +00:00
|
|
|
{ stdenv, fetchurl, unzip, pkgs, dataPath ? "/var/lib/rainloop" }: let
|
2018-06-28 19:54:44 +00:00
|
|
|
common = { edition, sha256 }:
|
|
|
|
stdenv.mkDerivation (rec {
|
2019-11-23 14:36:28 +00:00
|
|
|
pname = "rainloop${stdenv.lib.optionalString (edition != "") "-${edition}"}";
|
2020-02-23 20:18:49 +00:00
|
|
|
version = "1.14.0";
|
2018-06-28 19:54:44 +00:00
|
|
|
|
|
|
|
buildInputs = [ unzip ];
|
|
|
|
|
|
|
|
unpackPhase = ''
|
|
|
|
mkdir rainloop
|
|
|
|
unzip -q -d rainloop $src
|
|
|
|
'';
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/RainLoop/rainloop-webmail/releases/download/v${version}/rainloop-${edition}${stdenv.lib.optionalString (edition != "") "-"}${version}.zip";
|
|
|
|
sha256 = sha256;
|
|
|
|
};
|
|
|
|
|
2020-02-23 20:18:49 +00:00
|
|
|
includeScript = pkgs.writeText "include.php" ''
|
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
function __get_custom_data_full_path()
|
|
|
|
{
|
|
|
|
return '${dataPath}'; // custom data folder path
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
|
2018-06-28 19:54:44 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir $out
|
|
|
|
cp -r rainloop/* $out
|
|
|
|
rm -rf $out/data
|
2020-02-23 20:18:49 +00:00
|
|
|
cp ${includeScript} $out/include.php
|
2018-06-28 19:54:44 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Simple, modern & fast web-based email client";
|
|
|
|
homepage = "https://www.rainloop.net";
|
2019-11-23 14:36:28 +00:00
|
|
|
downloadPage = "https://github.com/RainLoop/rainloop-webmail/releases";
|
|
|
|
license = with licenses; if edition == "" then unfree else agpl3;
|
2018-06-28 19:54:44 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ das_j ];
|
|
|
|
};
|
|
|
|
});
|
|
|
|
in {
|
|
|
|
rainloop-community = common {
|
|
|
|
edition = "community";
|
2020-02-23 20:18:49 +00:00
|
|
|
sha256 = "0a8qafm4khwj8cnaiaxvjb9073w6fr63vk1b89nks4hmfv10jn6y";
|
2018-06-28 19:54:44 +00:00
|
|
|
};
|
|
|
|
rainloop-standard = common {
|
|
|
|
edition = "";
|
2020-02-23 20:18:49 +00:00
|
|
|
sha256 = "0961g4mci080f7y98zx9r4qw620l4z3na1ivvlyhhr1v4dywqvch";
|
2018-06-28 19:54:44 +00:00
|
|
|
};
|
|
|
|
}
|