25 lines
737 B
Nix
25 lines
737 B
Nix
{ lib, config, ... }:
|
|
let
|
|
mkIf = lib.mkIf config.services.mysql.enable;
|
|
in
|
|
{
|
|
|
|
pbsds.backup.paths = mkIf [ config.mysqlBackup.location ]; # "/var/backup/postgresql"
|
|
|
|
services.mysqlBackup = mkIf {
|
|
enable = true;
|
|
databases = config.services.mysql.ensureDatabases;
|
|
# calendar = "*-*-* 01:15:00"; # nightly (default)
|
|
|
|
# there is now way to select no compression...
|
|
# should be trivial to fix ;)
|
|
# https://github.com/NixOS/nixpkgs/blob/89c2b2330e733d6cdb5eae7b899326930c2c0648/nixos/modules/services/backup/mysql-backup.nix#L23-L45
|
|
# https://github.com/NixOS/nixpkgs/pull/364630
|
|
# compressionAlg = "gzip";
|
|
# compressionAlg = "xz";
|
|
# compressionAlg = "zstd";
|
|
# compressionLevel = null;
|
|
};
|
|
|
|
}
|