Merge pull request #330634 from r-ryantm/auto-update/circumflex
[NixPkgs.git] / pkgs / servers / snappymail / default.nix
blobfa90943d1ce12b6ae10412cf252f812a867afe9e
1 { lib
2 , stdenv
3 , fetchurl
4 , writeText
5 , dataPath ? "/var/lib/snappymail"
6 }:
8 stdenv.mkDerivation rec {
9   pname = "snappymail";
10   version = "2.36.4";
12   src = fetchurl {
13     url = "https://github.com/the-djmaze/snappymail/releases/download/v${version}/snappymail-${version}.tar.gz";
14     sha256 = "sha256-pKOYyEiVszbZM1iDe8e6YgaNPB6MoiAc24e06Nyeeb0=";
15   };
17   sourceRoot = "snappymail";
19   includeScript = writeText "include.php" ''
20     <?php
22     # the trailing `/` is important here
23     define('APP_DATA_FOLDER_PATH', '${dataPath}/');
24   '';
26   installPhase = ''
27     mkdir $out
28     cp -r ../* $out
29     rm -rf $out/{data,env-vars,_include.php}
30     cp ${includeScript} $out/include.php
31   '';
33   meta = with lib; {
34     description = "Simple, modern & fast web-based email client";
35     homepage = "https://snappymail.eu";
36     changelog = "https://github.com/the-djmaze/snappymail/blob/v${version}/CHANGELOG.md";
37     downloadPage = "https://github.com/the-djmaze/snappymail/releases";
38     license = licenses.agpl3Only;
39     platforms = platforms.all;
40     maintainers = with maintainers; [ mic92 ];
41   };