stalwart: add stalwart user

This commit is contained in:
Bloxx12 2025-05-22 22:43:04 +02:00
commit feb0f86e95
Signed by: faukah
SSH key fingerprint: SHA256:Uj2AXqvtdCA4hn5Hq0ZonhIAyUqI1q4w2sMG3Z1TH7E

View file

@ -13,6 +13,15 @@
in { in {
options.modules.system.services.stalwart.enable = mkEnableOption "stalwart"; options.modules.system.services.stalwart.enable = mkEnableOption "stalwart";
config = mkIf cfg.enable { config = mkIf cfg.enable {
# create the stallwart user
users.users.stalwart = {
home = "/var/lib/stalwart-mail";
useDefaultShell = true;
group = "stalwart";
isSystemUser = true;
};
users.groups.stalwart = {};
services.stalwart-mail = { services.stalwart-mail = {
enable = true; enable = true;
package = pkgs.stalwart-mail; package = pkgs.stalwart-mail;
@ -91,7 +100,7 @@ in {
}; };
}; };
store = { store = {
"postgresql" = { postgresql = {
# Specifies the database type, set to "postgresql" for PostgreSQL. # Specifies the database type, set to "postgresql" for PostgreSQL.
type = "postgresql"; type = "postgresql";
@ -102,11 +111,15 @@ in {
port = "5432"; port = "5432";
# Name of the database to connect to. # Name of the database to connect to.
# TODO: add this to PostgreSQL.
database = "stalwart"; database = "stalwart";
# The username used for authentication with the PostgreSQL server. # The username used for authentication with the PostgreSQL server.
# TODO: add this to PostgreSQL.
user = "stalwart"; user = "stalwart";
password = "";
# Enable TLS # Enable TLS
tls.enable = true; tls.enable = true;
}; };