radicale-fix
This commit is contained in:
@@ -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";
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user