mirror of
https://codeberg.org/muon/home.git
synced 2025-12-06 16:17:46 +00:00
46 lines
1.1 KiB
Nix
46 lines
1.1 KiB
Nix
{ pkgs, lib, config, ... }:
|
|
let
|
|
cfg = config.mods.server.cal;
|
|
port = config.mods.server.nginx.ports.cal;
|
|
in with lib; {
|
|
options.mods.server = {
|
|
cal = {
|
|
enable = mkEnableOption {
|
|
default = false;
|
|
description = "enables radicale server";
|
|
};
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
services.radicale = {
|
|
enable = true;
|
|
settings = {
|
|
server = { hosts = [ "0.0.0.0:${toString port}" ]; };
|
|
auth = {
|
|
type = "htpasswd";
|
|
htpasswd_filename = "${toString config.sops.secrets.htpasswd.path}";
|
|
htpasswd_encryption = "bcrypt";
|
|
};
|
|
storage = { filesystem_folder = "/var/lib/radicale/collections"; };
|
|
};
|
|
rights = {
|
|
root = {
|
|
user = ".+";
|
|
collection = "";
|
|
permissions = "R";
|
|
};
|
|
principal = {
|
|
user = ".+";
|
|
collection = "{user}";
|
|
permissions = "RW";
|
|
};
|
|
calendars = {
|
|
user = ".+";
|
|
collection = "{user}/[^/]+";
|
|
permissions = "rw";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|