radicale: Configure backups

This commit is contained in:
SebastianStork 2025-09-02 21:42:24 +02:00
parent 5095577e3b
commit 28b72290a2
2 changed files with 8 additions and 0 deletions

View file

@ -45,6 +45,7 @@
radicale = {
enable = true;
doBackups = true;
domain = "calendar.${config.custom.services.tailscale.domain}";
};

View file

@ -11,6 +11,7 @@ in
{
options.custom.services.radicale = {
enable = lib.mkEnableOption "";
doBackups = lib.mkEnableOption "";
domain = lib.mkOption {
type = lib.types.nonEmptyStr;
default = "";
@ -92,6 +93,7 @@ in
runtimeInputs = [ pkgs.git ];
text = ''
cd ${config.services.radicale.settings.storage.filesystem_folder}
if [[ ! -e .git ]]; then
git init --initial-branch main
fi
@ -107,5 +109,10 @@ in
'';
}
);
custom.services.resticBackups.radicale = lib.mkIf cfg.doBackups {
conflictingService = "radicale.service";
paths = [ config.services.radicale.settings.storage.filesystem_folder ];
};
};
}