mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 17:31:34 +01:00
radicale: Configure backups
This commit is contained in:
parent
5095577e3b
commit
28b72290a2
2 changed files with 8 additions and 0 deletions
|
|
@ -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}";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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 ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue