radicale-fix

This commit is contained in:
2026-04-14 15:13:39 +02:00
parent fa2c5b9139
commit 3630b9583b
+5 -4
View File
@@ -6,8 +6,9 @@
}:
let
cfg = config.mailserver;
hasMailDiscoveryConfig = cfg.enable && cfg.fqdn != null && cfg.domains != [ ];
in
lib.mkIf cfg.enable (
lib.mkIf hasMailDiscoveryConfig (
let
domain = builtins.head cfg.domains;
radicaleHost = "cal.${domain}";
@@ -22,9 +23,9 @@ lib.mkIf cfg.enable (
accountHash =
mail: account:
if account ? hashedPassword then
if account.hashedPassword != null then
account.hashedPassword
else if account ? hashedPasswordFile then
else if account.hashedPasswordFile != null then
lib.removeSuffix "\n" (builtins.readFile account.hashedPasswordFile)
else
throw "Radicale requires ${mail} to define hashedPassword or hashedPasswordFile";
@@ -57,7 +58,7 @@ lib.mkIf cfg.enable (
settings = {
auth = {
type = "htpasswd";
htpasswd_filename = htpasswd;
htpasswd_filename = "${htpasswd}";
htpasswd_encryption = "bcrypt";
};
};