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 = { radicale = {
enable = true; enable = true;
doBackups = true;
domain = "calendar.${config.custom.services.tailscale.domain}"; domain = "calendar.${config.custom.services.tailscale.domain}";
}; };

View file

@ -11,6 +11,7 @@ in
{ {
options.custom.services.radicale = { options.custom.services.radicale = {
enable = lib.mkEnableOption ""; enable = lib.mkEnableOption "";
doBackups = lib.mkEnableOption "";
domain = lib.mkOption { domain = lib.mkOption {
type = lib.types.nonEmptyStr; type = lib.types.nonEmptyStr;
default = ""; default = "";
@ -92,6 +93,7 @@ in
runtimeInputs = [ pkgs.git ]; runtimeInputs = [ pkgs.git ];
text = '' text = ''
cd ${config.services.radicale.settings.storage.filesystem_folder} cd ${config.services.radicale.settings.storage.filesystem_folder}
if [[ ! -e .git ]]; then if [[ ! -e .git ]]; then
git init --initial-branch main git init --initial-branch main
fi 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 ];
};
}; };
} }