11 cfg = config.services.alps;
14 options.services.alps = {
15 enable = mkEnableOption "alps";
21 TCP port the service should listen on.
29 The IP the service should listen on.
38 default = "sourcehut";
40 The frontend's theme to use.
49 The IMAPS server port.
56 example = "mail.example.org";
58 The IMAPS server address.
68 The SMTPS server port.
74 default = cfg.imaps.host;
75 defaultText = "services.alps.imaps.host";
76 example = "mail.example.org";
78 The SMTPS server address.
91 type = types.listOf types.str;
94 "${cfg.bindIP}:${toString cfg.port}"
97 "imaps://${cfg.imaps.host}:${toString cfg.imaps.port}"
98 "smtps://${cfg.smtps.host}:${toString cfg.smtps.port}"
103 config = mkIf cfg.enable {
104 systemd.services.alps = {
105 description = "alps is a simple and extensible webmail.";
106 documentation = [ "https://git.sr.ht/~migadu/alps" ];
107 wantedBy = [ "multi-user.target" ];
108 wants = [ "network-online.target" ];
111 "network-online.target"
115 ExecStart = "${cfg.package}/bin/alps ${escapeShellArgs cfg.args}";
116 AmbientCapabilities = "";
117 CapabilityBoundingSet = "";
119 LockPersonality = true;
120 MemoryDenyWriteExecute = true;
121 NoNewPrivileges = true;
122 PrivateDevices = true;
127 ProtectControlGroups = true;
129 ProtectHostname = true;
130 ProtectKernelLogs = true;
131 ProtectKernelModules = true;
132 ProtectKernelTunables = true;
133 ProtectProc = "invisible";
134 ProtectSystem = "strict";
136 RestrictAddressFamilies = [
140 RestrictNamespaces = true;
141 RestrictRealtime = true;
142 RestrictSUIDSGID = true;
143 SocketBindAllow = cfg.port;
144 SocketBindDeny = "any";
145 SystemCallArchitectures = "native";
148 "~@privileged @obsolete"