25 lines
697 B
Nix
25 lines
697 B
Nix
{ config, lib, pkgs, ... }:
|
|
{
|
|
imports = [ ./nginx ];
|
|
|
|
services = lib.mkIf config.services.mailserver.enable {
|
|
radicale = {
|
|
enable = true;
|
|
settings = {
|
|
auth = {
|
|
type = "htpasswd";
|
|
htpasswd_filename = let
|
|
mailAccounts = config.mailserver.loginAccounts;
|
|
htpasswd = with lib; pkgs.writeText "radicale.users" (concatStrings
|
|
(flip mapAttrsToList mailAccounts (mail: user:
|
|
mail + ":" + user.hashedPassword + "\n"
|
|
))
|
|
);
|
|
in "${htpasswd}";
|
|
htpasswd_encryption = "bcrypt";
|
|
};
|
|
};
|
|
};
|
|
cloudflare-dyndns.domains = [ "cal.nixfox.ca" ];
|
|
};
|
|
}
|