Skip to content
Permalink
Browse files

rainloop: fix naming

  • Loading branch information
peterhoeg committed Aug 26, 2019
1 parent 4ca0df1 commit 2d93c28e8afffc5144265a38b862c01db0031a46
Showing with 45 additions and 41 deletions.
  1. +45 −41 pkgs/servers/rainloop/default.nix
@@ -1,44 +1,48 @@
{ stdenv, fetchurl, unzip, dataPath ? "/etc/rainloop" }: let
common = { edition, sha256 }:
stdenv.mkDerivation (rec {
name = "rainloop-${edition}-${version}";
version = "1.13.0";

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;
};

installPhase = ''
mkdir $out
cp -r rainloop/* $out
rm -rf $out/data
ln -s ${dataPath} $out/data
'';

meta = with stdenv.lib; {
description = "Simple, modern & fast web-based email client";
homepage = "https://www.rainloop.net";
downloadPage = https://github.com/RainLoop/rainloop-webmail/releases;
license = licenses.agpl3;
platforms = platforms.all;
maintainers = with maintainers; [ das_j ];
};
});
in {
rainloop-community = common {
edition = "community";
sha256 = "1skwq6bn98142xf8r77b818fy00nb4x0s1ii3mw5849ih94spx40";

common = { edition, sha256 }: let
edition' = if (edition != "") then "-${edition}" else "";

in stdenv.mkDerivation rec {
pname = "rainloop${edition'}";
version = "1.13.0";

nativeBuildInputs = [ unzip ];

sourceRoot = "rainloop";

src = fetchurl {
url = "https://github.com/RainLoop/rainloop-webmail/releases/download/v${version}/rainloop${edition'}-${version}.zip";
inherit sha256;
};
rainloop-standard = common {
edition = "";
sha256 = "e3ec8209cb3b9f092938a89094e645ef27659763432bedbe7fad4fa650554222";

installPhase = ''
runHook preInstall
mkdir -p $out/rainloop
cp -r * $out/rainloop/
ln -s ${dataPath} $out/data
runHook postInstall
'';

meta = with stdenv.lib; {
description = "Simple, modern & fast web-based email client";
downloadPage = "https://github.com/RainLoop/rainloop-webmail/releases";
homepage = "https://www.rainloop.net";
license = licenses.agpl3;
maintainers = with maintainers; [ das_j ];
platforms = platforms.all;
};
}
};

in {
rainloop-community = common {
edition = "community";
sha256 = "1skwq6bn98142xf8r77b818fy00nb4x0s1ii3mw5849ih94spx40";
};
rainloop-standard = common {
edition = "";
sha256 = "e3ec8209cb3b9f092938a89094e645ef27659763432bedbe7fad4fa650554222";
};
}

0 comments on commit 2d93c28

Please sign in to comment.
You can’t perform that action at this time.