From 046691a4997a9302ccf582c3bbcdf1dc0ce4ae80 Mon Sep 17 00:00:00 2001 From: Jonathan Davies Date: Tue, 30 Apr 2024 11:14:42 +0100 Subject: [PATCH] nixos/restic: Use cat config command in pre-start command for repo initialization check, per upstream recommendation in https://github.com/restic/restic/issues/1690 This is to prevent logs from becoming unwieldy with large repo listings. --- nixos/modules/services/backup/restic.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/backup/restic.nix b/nixos/modules/services/backup/restic.nix index 8b56636c7969..a00d865f06e4 100644 --- a/nixos/modules/services/backup/restic.nix +++ b/nixos/modules/services/backup/restic.nix @@ -346,7 +346,7 @@ in ${pkgs.writeScript "backupPrepareCommand" backup.backupPrepareCommand} ''} ${optionalString (backup.initialize) '' - ${resticCmd} snapshots || ${resticCmd} init + ${resticCmd} cat config > /dev/null || ${resticCmd} init ''} ${optionalString (backup.paths != null && backup.paths != []) '' cat ${pkgs.writeText "staticPaths" (concatStringsSep "\n" backup.paths)} >> ${filesFromTmpFile}