gerd.postgresql: initial add
This commit is contained in:
parent
b9163999bb
commit
84a3027d0c
3 changed files with 55 additions and 0 deletions
20
shared/applications/state/postgresql.nix
Normal file
20
shared/applications/state/postgresql.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{ config, ... }:
|
||||
|
||||
let
|
||||
stateDir= config.mine.zfsMounts."rpool/safe/svcs/postgresql";
|
||||
backupDir = config.mine.zfsMounts."rpool/backup/postgresql";
|
||||
|
||||
postgresql_user = config.systemd.services.postgresql.serviceConfig.User;
|
||||
postgresql_group = config.systemd.services.postgresql.serviceConfig.Group;
|
||||
in {
|
||||
services.postgresql.dataDir = stateDir;
|
||||
|
||||
# backup postgresql databases (everything in ensuredatabases)
|
||||
services.postgresqlBackup.location = backupDir;
|
||||
|
||||
# ensure correct permissions for postgresql and postgresql backup
|
||||
systemd.tmpfiles.rules = [
|
||||
"Z ${stateDir} 0770 ${postgresql_user} ${postgresql_group} -"
|
||||
"Z ${backupDir} 0770 ${postgresql_user} ${postgresql_group} -"
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue