PostgreSQLSource:modules/services/databases/postgresql.nixUpstream documentation:PostgreSQL is an advanced, free relational database.ConfiguringTo enable PostgreSQL, add the following to your
configuration.nix:
services.postgresql.enable = true;
services.postgresql.package = pkgs.postgresql93;
Note that you are required to specify the desired version of
PostgreSQL (e.g. pkgs.postgresql93). Since
upgrading your PostgreSQL version requires a database dump and reload
(see below), NixOS cannot provide a default value for
such as the most recent
release of PostgreSQL.By default, PostgreSQL stores its databases in
/var/db/postgresql. You can override this using
, e.g.
services.postgresql.dataDir = "/data/postgresql";
UpgradingFIXME: document dump/upgrade/load cycle.OptionsFIXME: auto-generated list of module options.