From 6d694a6269ccc00f50f31788dfd47dff7102e061 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Tue, 5 Oct 2021 21:44:58 +0200 Subject: [PATCH] backups: allow extraFiles to override default settings By moving them to the top they take precedence over the remaining filelist entries. --- modules/backups.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/backups.nix b/modules/backups.nix index 7731638..8b140cf 100644 --- a/modules/backups.nix +++ b/modules/backups.nix @@ -40,7 +40,12 @@ let cfg = config.services.backups; - filelist = pkgs.writeText "filelist.txt" '' + # Potential backup file paths are are matched against filelist + # entries from top to bottom. + # The first match determines inclusion or exclusion. + filelist = builtins.toFile "filelist.txt" '' + ${builtins.concatStringsSep "\n" cfg.extraFiles} + ${optionalString (!cfg.with-bulk-data) '' - ${config.services.bitcoind.dataDir}/blocks - ${config.services.bitcoind.dataDir}/chainstate @@ -65,9 +70,6 @@ let ${builtins.concatStringsSep "\n" postgresqlBackupPaths} - # Extra files - ${builtins.concatStringsSep "\n" cfg.extraFiles} - # Exclude all unspecified files and directories - / '';