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 [
|
config = lib.mkMerge [
|
||||||
(lib.mkIf cfg.postgresql.enable {
|
(lib.mkIf cfg.postgresql.enable {
|
||||||
networking.firewall.allowedTCPPorts = lib.singleton cfg.postgresql.port;
|
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 = {
|
services.postgresql = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableTCPIP = true;
|
enableTCPIP = true;
|
||||||
inherit (cfg.postgresql) port;
|
settings = { inherit (cfg.postgresql) port; };
|
||||||
authentication = lib.mkOverride 10 ''
|
authentication = lib.mkOverride 10 ''
|
||||||
#type database DBuser auth-method
|
#type database DBuser auth-method
|
||||||
local all all trust
|
local all all trust
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue