Configure max_connections for PostgreSQL using nix

How to configure max_connections value for PostgreSQL using nix

The default value of max_connections is 100, and if you ever wanted to configure it for a higher limit, it can be done so by updating the following:

{ pkgs, ... }:
{
  services.postgresql = {
    enable = true;
    package = pkgs.postgresql_14;
    dataDir = "/usr/local/var/postgres";
    + extraConfig = ''
    +  max_connections = 1000
    + '';
  };
}