1
0
mirror of https://github.com/kmein/niveum synced 2026-03-20 03:51:07 +01:00

feat(postgresql): enable backup

This commit is contained in:
2022-12-03 08:25:47 +01:00
parent 72b48e90aa
commit f04ca9d1de
4 changed files with 19 additions and 3 deletions

View File

@@ -43,7 +43,7 @@ in {
passwordFile = toString <secrets/restic/password>; passwordFile = toString <secrets/restic/password>;
paths = [ paths = [
"/var/lib/codimd" "/var/lib/codimd"
"/var/lib/postgresql" config.services.postgresqlBackup.location
"/var/lib/weechat" "/var/lib/weechat"
"/var/lib/nextcloud" "/var/lib/nextcloud"
"/var/lib/grafana" "/var/lib/grafana"

View File

@@ -65,13 +65,18 @@ in {
} }
]; ];
services.postgresqlBackup = {
enable = true;
databases = [config.services.nextcloud.config.dbname];
};
services.postgresql = { services.postgresql = {
enable = true; enable = true;
ensureDatabases = ["nextcloud"]; ensureDatabases = [config.services.nextcloud.config.dbname];
ensureUsers = [ ensureUsers = [
{ {
name = "nextcloud"; name = "nextcloud";
ensurePermissions."DATABASE nextcloud" = "ALL PRIVILEGES"; ensurePermissions."DATABASE ${config.services.nextcloud.config.dbname}" = "ALL PRIVILEGES";
} }
]; ];
}; };

View File

@@ -1,6 +1,7 @@
{ {
pkgs, pkgs,
lib, lib,
config,
... ...
}: let }: let
domain = "feed.kmein.de"; domain = "feed.kmein.de";
@@ -17,6 +18,11 @@ in {
}; };
}; };
services.postgresqlBackup = {
enable = true;
databases = [config.services.tt-rss.database.name];
};
services.nginx.virtualHosts.${domain} = { services.nginx.virtualHosts.${domain} = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;

View File

@@ -14,6 +14,11 @@ in {
]; ];
}; };
services.postgresqlBackup = {
enable = true;
databases = ["atuin"];
};
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [
(tmpfilesConfig { (tmpfilesConfig {
type = "d"; type = "d";