1 { config, pkgs, lib, ... }:
4 cfg = config.services.yggmail;
6 options.services.yggmail = {
7 enable = mkEnableOption "yggmail mailserver";
12 default = "tcp://127.0.0.1:6893";
13 example = "tcp://127.0.0.1:6893";
15 Connect to a specific Yggdrasil static peer
19 listenAddress = mkOption {
20 default = "localhost";
21 example = "127.0.0.1";
24 Interface address to listen on
29 default = "localhost:1143";
30 example = "localhost:1143";
38 default = "localhost:1025";
39 example = "localhost:1025";
46 config = mkIf cfg.enable {
47 systemd.services.yggmail = {
48 wantedBy = [ "multi-user.target" ];
49 after = [ "network.target" ];
50 description = "Start the yggmail daemon.";
53 #AmbientCapabilities = [ "CAP_NET_BIND_SERVICE" ];
54 #CapabilityBoundingSet = [ "CAP_NET_BIND_SERVICE" ];
55 ExecStart = ''${pkgs.nur.yggmail}/bin/yggmail -imap=${cfg.listenAddress}:${toString cfg.imapPort} -smtp=${cfg.listenAddress}:${toString cfg.smtpPort} -peer=${cfg.peer}'';
57 StateDirectory = "yggmail";
58 WorkingDirectory = "/var/lib/yggmail";