* Synced with trunk @ 15391
svn path=/nixos/branches/modular-nixos/; revision=15612
This commit is contained in:
parent
48e4b8f573
commit
d44206d2c4
@ -61,6 +61,12 @@ let
|
|||||||
How to authorize users.
|
How to authorize users.
|
||||||
Note: ident needs absolute trust to all allowed client hosts.";
|
Note: ident needs absolute trust to all allowed client hosts.";
|
||||||
};
|
};
|
||||||
|
enableTCPIP = mkOption {
|
||||||
|
default = false;
|
||||||
|
description = "
|
||||||
|
Whether to run PostgreSQL with -i flag to enable TCP/IP connections.
|
||||||
|
";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -79,6 +85,8 @@ let
|
|||||||
|
|
||||||
run = "${pkgs.su}/bin/su -s ${pkgs.bash}/bin/sh postgres";
|
run = "${pkgs.su}/bin/su -s ${pkgs.bash}/bin/sh postgres";
|
||||||
|
|
||||||
|
flags = if cfg.enableTCPIP then ["-i"] else [];
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
mkIf config.services.postgresql.enable {
|
mkIf config.services.postgresql.enable {
|
||||||
@ -120,7 +128,7 @@ mkIf config.services.postgresql.enable {
|
|||||||
cp -f ${pkgs.writeText "pg_hba.conf" cfg.authentication} ${cfg.dataDir}/pg_hba.conf
|
cp -f ${pkgs.writeText "pg_hba.conf" cfg.authentication} ${cfg.dataDir}/pg_hba.conf
|
||||||
end script
|
end script
|
||||||
|
|
||||||
respawn ${run} -c '${postgresql}/bin/postgres -D ${cfg.dataDir}'
|
respawn ${run} -c '${postgresql}/bin/postgres -D ${cfg.dataDir} ${toString flags}'
|
||||||
'';
|
'';
|
||||||
}];
|
}];
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user