backups: allow extraFiles to override default settings

By moving them to the top they take precedence over the remaining
filelist entries.
This commit is contained in:
Erik Arvstedt 2021-10-05 21:44:58 +02:00
parent 0c45415c86
commit 6d694a6269
No known key found for this signature in database
GPG Key ID: 33312B944DD97846

View File

@ -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
- /
'';