mirror of
https://github.com/phfroidmont/self-hosting.git
synced 2025-12-25 05:36:59 +01:00
Update PostgreSQL to 15
This commit is contained in:
parent
68369de7b7
commit
c513a7a0f4
2 changed files with 44 additions and 48 deletions
|
|
@ -1,9 +1,8 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
{ config, lib, pkgs, ... }: {
|
||||
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
package = pkgs.postgresql_12;
|
||||
package = pkgs.postgresql_15;
|
||||
enableTCPIP = true;
|
||||
identMap = ''
|
||||
root_as_others root postgres
|
||||
|
|
@ -42,15 +41,12 @@
|
|||
};
|
||||
};
|
||||
|
||||
systemd.services.postgresql-setup = let pgsql = config.services.postgresql; in
|
||||
{
|
||||
systemd.services.postgresql-setup = let pgsql = config.services.postgresql;
|
||||
in {
|
||||
after = [ "postgresql.service" ];
|
||||
bindsTo = [ "postgresql.service" ];
|
||||
wantedBy = [ "postgresql.service" ];
|
||||
path = [
|
||||
pgsql.package
|
||||
pkgs.util-linux
|
||||
];
|
||||
path = [ pgsql.package pkgs.util-linux ];
|
||||
script = ''
|
||||
set -u
|
||||
PSQL() {
|
||||
|
|
|
|||
|
|
@ -25,10 +25,10 @@
|
|||
repoName = "db1";
|
||||
readWritePaths = [ "/nix/var/data/postgresql" "/nix/var/data/backup/" ];
|
||||
preHook = ''
|
||||
${pkgs.postgresql_12}/bin/pg_dump -U synapse synapse > /nix/var/data/postgresql/synapse.dmp
|
||||
${pkgs.postgresql_12}/bin/pg_dump -U nextcloud nextcloud > /nix/var/data/postgresql/nextcloud.dmp
|
||||
${pkgs.postgresql_12}/bin/pg_dump -U roundcube roundcube > /nix/var/data/postgresql/roundcube.dmp
|
||||
${pkgs.postgresql_12}/bin/pg_dump -U mastodon mastodon > /nix/var/data/postgresql/mastodon.dmp
|
||||
${config.services.postgresql.package}/bin/pg_dump -U synapse synapse > /nix/var/data/postgresql/synapse.dmp
|
||||
${config.services.postgresql.package}/bin/pg_dump -U nextcloud nextcloud > /nix/var/data/postgresql/nextcloud.dmp
|
||||
${config.services.postgresql.package}/bin/pg_dump -U roundcube roundcube > /nix/var/data/postgresql/roundcube.dmp
|
||||
${config.services.postgresql.package}/bin/pg_dump -U mastodon mastodon > /nix/var/data/postgresql/mastodon.dmp
|
||||
'';
|
||||
startAt = "03:00";
|
||||
sshKey = config.sops.secrets.borgSshKey.path;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue