From 8cf119c7a199ebe85e4466920a2788f3d494f613 Mon Sep 17 00:00:00 2001 From: Artturin Date: Fri, 27 Dec 2024 05:02:32 +0200 Subject: [PATCH] nixos/stalwart-mail: Fix creation of `dataDir` if not default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without these I got `mkdir: cannot create directory ‘/data/stalwart’: Read-only file system` --- nixos/modules/services/mail/stalwart-mail.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nixos/modules/services/mail/stalwart-mail.nix b/nixos/modules/services/mail/stalwart-mail.nix index d4e650de07db6..849661646977b 100644 --- a/nixos/modules/services/mail/stalwart-mail.nix +++ b/nixos/modules/services/mail/stalwart-mail.nix @@ -119,6 +119,10 @@ in }; }; + systemd.tmpfiles.rules = [ + "d '${cfg.dataDir}' - stalwart-mail stalwart-mail - -" + ]; + systemd = { packages = [ cfg.package ]; services.stalwart-mail = { @@ -147,6 +151,9 @@ in StandardOutput = "journal"; StandardError = "journal"; + ReadWritePaths = [ + cfg.dataDir + ]; CacheDirectory = "stalwart-mail"; StateDirectory = "stalwart-mail";