1{ stdenv, fetchurl, unzip, dataPath ? "/etc/rainloop" }: let
2 common = { edition, sha256 }:
3 stdenv.mkDerivation (rec {
4 name = "rainloop-${edition}-${version}";
5 version = "1.12.1";
6
7 buildInputs = [ unzip ];
8
9 unpackPhase = ''
10 mkdir rainloop
11 unzip -q -d rainloop $src
12 '';
13
14 src = fetchurl {
15 url = "https://github.com/RainLoop/rainloop-webmail/releases/download/v${version}/rainloop-${edition}${stdenv.lib.optionalString (edition != "") "-"}${version}.zip";
16 sha256 = sha256;
17 };
18
19 installPhase = ''
20 mkdir $out
21 cp -r rainloop/* $out
22 rm -rf $out/data
23 ln -s ${dataPath} $out/data
24 '';
25
26 meta = with stdenv.lib; {
27 description = "Simple, modern & fast web-based email client";
28 homepage = "https://www.rainloop.net";
29 downloadPage = https://github.com/RainLoop/rainloop-webmail/releases;
30 license = licenses.agpl3;
31 platforms = platforms.all;
32 maintainers = with maintainers; [ das_j ];
33 };
34 });
35 in {
36 rainloop-community = common {
37 edition = "community";
38 sha256 = "06w1vxqpcj2j8dzzjqh6azala8l46hzy85wcvqbjdlj5w789jzsx";
39 };
40 rainloop-standard = common {
41 edition = "";
42 sha256 = "1fbnpk7l2fbmzn31vx36caqg9xm40g4hh4mv3s8d70slxwhlscw0";
43 };
44 }