From bfba8c005c9b9da825bbf13623fb834705e1d855 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Thu, 4 Feb 2021 18:28:05 +0100 Subject: [PATCH] services: add postgres-backup --- configuration.nix | 2 ++ services/default.nix | 1 + services/postgresql-backup.nix | 16 ++++++++++++++++ 3 files changed, 19 insertions(+) create mode 100644 services/postgresql-backup.nix diff --git a/configuration.nix b/configuration.nix index f6c1b79..d2649f9 100644 --- a/configuration.nix +++ b/configuration.nix @@ -93,6 +93,8 @@ }; # The whole *arr software suite pirate.enable = true; + # Regular backups + postgresql-backup.enable = true; # Usenet client sabnzbd.enable = true; # Torrent client and webui diff --git a/services/default.nix b/services/default.nix index 62205f4..eb63bc5 100644 --- a/services/default.nix +++ b/services/default.nix @@ -9,6 +9,7 @@ ./nextcloud.nix ./nginx.nix ./pirate.nix + ./postgresql-backup.nix ./sabnzbd.nix ./transmission.nix ]; diff --git a/services/postgresql-backup.nix b/services/postgresql-backup.nix new file mode 100644 index 0000000..9a60798 --- /dev/null +++ b/services/postgresql-backup.nix @@ -0,0 +1,16 @@ +# Backup your data, kids! +{ config, lib, ... }: +let + cfg = config.my.services.postgresql-backup; +in +{ + options.my.services.postgresql-backup = { + enable = lib.mkEnableOption "Backup SQL databases"; + }; + + config = lib.mkIf cfg.enable { + services.postgresqlBackup = { + enable = true; + }; + }; +}