my over complex system configurations dotfiles.isabelroses.com/
nixos nix flake dotfiles linux

nixos/services/postgresql: add borgbackup

+13 -2
+13 -2
modules/nixos/services/postgresql.nix
··· 6 6 ... 7 7 }: 8 8 let 9 - inherit (lib.modules) mkIf; 10 - inherit (self.lib.services) mkServiceOption; 9 + inherit (lib) mkIf; 10 + inherit (self.lib) mkSecret mkServiceOption; 11 11 12 12 cfg = config.garden.services; 13 13 in ··· 19 19 mode = "0755"; 20 20 user = "postgres"; 21 21 group = "postgres"; 22 + }; 23 + 24 + garden.services.borgbackup.jobs.postgresql = { 25 + paths = [ config.services.postgresql.dataDir ]; 26 + repo = "postgresql"; 27 + passkeyFile = config.sops.secrets.borg-postgresql-pass.path; 28 + }; 29 + 30 + sops.secrets.borg-postgresql-pass = mkSecret { 31 + file = "borg"; 32 + key = "postgresql-passphrase"; 22 33 }; 23 34 24 35 services.postgresql = {