feat(postgresql): persist pgsql data directory
This commit is contained in:
parent
396925364b
commit
bd03642216
1 changed files with 8 additions and 1 deletions
|
@ -26,10 +26,17 @@ in
|
|||
config = lib.mkMerge [
|
||||
(lib.mkIf cfg.postgresql.enable {
|
||||
networking.firewall.allowedTCPPorts = lib.singleton cfg.postgresql.port;
|
||||
environment.persistence."/persist".directories = [
|
||||
{
|
||||
directory = builtins.toString config.services.postgresql.dataDir;
|
||||
user = "postgres";
|
||||
group = "postgres";
|
||||
}
|
||||
];
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
enableTCPIP = true;
|
||||
inherit (cfg.postgresql) port;
|
||||
settings = { inherit (cfg.postgresql) port; };
|
||||
authentication = lib.mkOverride 10 ''
|
||||
#type database DBuser auth-method
|
||||
local all all trust
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue