backup: assert that backups are on if a path is configured, don't create empty units
This commit is contained in:
parent
865a741401
commit
345b3a5a9d
|
@ -23,6 +23,11 @@ in
|
|||
};
|
||||
|
||||
config = {
|
||||
assertions = [ {
|
||||
assertion = cfg.paths != [ ] -> !cfg.enable;
|
||||
message = "Configuring backup services.backup.paths without enabling services.backup.enable is useless!";
|
||||
} ];
|
||||
|
||||
services = {
|
||||
postgresqlBackup = {
|
||||
inherit (config.services.postgresql) enable;
|
||||
|
@ -102,7 +107,7 @@ in
|
|||
ln -fs {,/home}/root/.ssh/config
|
||||
'';
|
||||
|
||||
systemd = {
|
||||
systemd = lib.mkIf cfg.enable {
|
||||
services = {
|
||||
restic-backups-server8.serviceConfig.Environment = "RESTIC_PROGRESS_FPS=0.016666";
|
||||
restic-backups-offsite.serviceConfig.Environment = "RESTIC_PROGRESS_FPS=0.016666";
|
||||
|
|
Loading…
Reference in New Issue