pytrainer: unpin python 3.10
[NixPkgs.git] / pkgs / servers / snappymail / default.nix
blob4860dc51f63c34fbe0397fb75f763a566108e652
1 { lib
2 , stdenv
3 , fetchurl
4 , writeText
5 , dataPath ? "/var/lib/snappymail"
6 }:
8 stdenv.mkDerivation rec {
9   pname = "snappymail";
10   version = "2.38.1";
12   src = fetchurl {
13     url = "https://github.com/the-djmaze/snappymail/releases/download/v${version}/snappymail-${version}.tar.gz";
14     sha256 = "sha256-43mmsnK+eBFu+z5DKUxu5NBiS3ktn7uzetg+BHWxSTI=";
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   };