- # FIXME: initial sync
- # FIXME: backup
- # FIXME: ssl
- services.postgresql = rec {
- enable = true;
- package = pkgs.postgresql100.overrideAttrs(old: rec {
- passthru = old.passthru // { psqlSchema = "11.0"; };
- name = "postgresql-11.1";
- src = pkgs.fetchurl {
- url = "mirror://postgresql/source/v11.1/${name}.tar.bz2";
- sha256 = "026v0sicsh7avzi45waf8shcbhivyxmi7qgn9fd1x0vl520mx0ch";
- };
- });
- enableTCPIP = true;
- extraConfig = ''
- max_connections = 100
- wal_level = logical
- shared_buffers = 128MB
- max_wal_size = 1GB
- min_wal_size = 80MB
- log_timezone = 'Europe/Paris'
- datestyle = 'iso, mdy'
- timezone = 'Europe/Paris'
- lc_messages = 'en_US.UTF-8'
- lc_monetary = 'en_US.UTF-8'
- lc_numeric = 'en_US.UTF-8'
- lc_time = 'en_US.UTF-8'
- default_text_search_config = 'pg_catalog.english'
- # ssl = on
- # ssl_cert_file = '/var/lib/acme/eldiron/fullchain.pem'
- # ssl_key_file = '/var/lib/acme/eldiron/key.pem'
- '';
- authentication = ''
- local all postgres ident
- local all all md5
- host all all 178.33.252.96/32 md5
- host all all 188.165.209.148/32 md5
- #host all all all pam
- '';
+ wantedBy = [ "multi-user.target" ];
+ requires = ["postgresql.service"];
+ after = ["network.target" "postgresql.service"];