commit
95c69d4c90
@ -153,6 +153,7 @@
|
|||||||
yandexdisk = 143;
|
yandexdisk = 143;
|
||||||
collectd = 144;
|
collectd = 144;
|
||||||
consul = 145;
|
consul = 145;
|
||||||
|
mailpile = 146;
|
||||||
|
|
||||||
# When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
|
# When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
|
||||||
|
|
||||||
@ -273,6 +274,7 @@
|
|||||||
riemann = 137;
|
riemann = 137;
|
||||||
riemanndash = 138;
|
riemanndash = 138;
|
||||||
uhub = 142;
|
uhub = 142;
|
||||||
|
mailpile = 146;
|
||||||
|
|
||||||
# When adding a gid, make sure it doesn't match an existing uid. And don't use gids above 399!
|
# When adding a gid, make sure it doesn't match an existing uid. And don't use gids above 399!
|
||||||
|
|
||||||
|
@ -232,6 +232,7 @@
|
|||||||
./services/networking/iodined.nix
|
./services/networking/iodined.nix
|
||||||
./services/networking/ircd-hybrid/default.nix
|
./services/networking/ircd-hybrid/default.nix
|
||||||
./services/networking/kippo.nix
|
./services/networking/kippo.nix
|
||||||
|
./services/networking/mailpile.nix
|
||||||
./services/networking/minidlna.nix
|
./services/networking/minidlna.nix
|
||||||
./services/networking/murmur.nix
|
./services/networking/murmur.nix
|
||||||
./services/networking/nat.nix
|
./services/networking/nat.nix
|
||||||
|
76
nixos/modules/services/networking/mailpile.nix
Normal file
76
nixos/modules/services/networking/mailpile.nix
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
cfg = config.services.mailpile;
|
||||||
|
|
||||||
|
hostname = cfg.hostname;
|
||||||
|
port = cfg.port;
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
###### interface
|
||||||
|
|
||||||
|
options = {
|
||||||
|
|
||||||
|
services.mailpile = {
|
||||||
|
enable = mkOption {
|
||||||
|
default = false;
|
||||||
|
description = "
|
||||||
|
Whether to enable Mailpile the mail client.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
hostname = mkOption {
|
||||||
|
default = "localhost";
|
||||||
|
description = "Listen to this hostname or ip.";
|
||||||
|
};
|
||||||
|
port = mkOption {
|
||||||
|
default = "33411";
|
||||||
|
description = "Listen on this port.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
###### implementation
|
||||||
|
|
||||||
|
config = mkIf config.services.mailpile.enable {
|
||||||
|
|
||||||
|
users.extraUsers.mailpile =
|
||||||
|
{ uid = config.ids.uids.mailpile;
|
||||||
|
description = "Mailpile user";
|
||||||
|
createHome = true;
|
||||||
|
home = "/var/lib/mailpile";
|
||||||
|
};
|
||||||
|
|
||||||
|
users.extraGroups.mailpile =
|
||||||
|
{ gid = config.ids.gids.mailpile;
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.mailpile =
|
||||||
|
{
|
||||||
|
description = "Mailpile server.";
|
||||||
|
after = [ "network.target" ];
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
User = "mailpile";
|
||||||
|
ExecStart = "${pkgs.mailpile}/bin/mailpile --www ${hostname}:${port} --wait";
|
||||||
|
# mixed - first send SIGINT to main process,
|
||||||
|
# then after 2min send SIGKILL to whole group if neccessary
|
||||||
|
KillMode = "mixed";
|
||||||
|
KillSignal = "SIGINT"; # like Ctrl+C - safe mailpile shutdown
|
||||||
|
TimeoutSec = 120; # wait 2min untill SIGKILL
|
||||||
|
};
|
||||||
|
environment.MAILPILE_HOME = "/var/lib/mailpile/.local/share/Mailpile";
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = [ pkgs.mailpile ];
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
@ -1,12 +1,13 @@
|
|||||||
{ stdenv, fetchurl, pythonPackages, gnupg1orig, makeWrapper }:
|
{ stdenv, fetchgit, pythonPackages, gnupg1orig, makeWrapper, openssl }:
|
||||||
|
|
||||||
pythonPackages.buildPythonPackage rec {
|
pythonPackages.buildPythonPackage rec {
|
||||||
name = "mailpile-${version}";
|
name = "mailpile-${version}";
|
||||||
version = "0.4.0";
|
version = "0.4.0";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchgit {
|
||||||
url = "https://github.com/pagekite/Mailpile/archive/${version}.zip";
|
url = "git://github.com/pagekite/Mailpile";
|
||||||
sha256 = "1di859lnhmlih4byfpsj8x6wjvzrddw0ng0w69bsj5f9bdy4rgq4";
|
rev = "af3e2554dcef892cc44e044ce61e1693f09228c0";
|
||||||
|
sha256 = "0p8j5w5281rjl0nigsw7glfp7inz13p6iqlr9g3m3vh72i9pvl7h";
|
||||||
};
|
};
|
||||||
|
|
||||||
patchPhase = ''
|
patchPhase = ''
|
||||||
@ -19,7 +20,8 @@ pythonPackages.buildPythonPackage rec {
|
|||||||
];
|
];
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
wrapProgram $out/bin/mailpile --prefix PATH ":" "${gnupg1orig}/bin"
|
wrapProgram $out/bin/mailpile \
|
||||||
|
--prefix PATH ":" "${gnupg1orig}/bin:${openssl}/bin"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user