X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=nixops%2Fmodules%2Fdatabases%2Fdefault.nix;h=32001810475af4b5e71f8276b11dc972ccd67283;hb=18fdf47041026412e365224f21c258b436ceda18;hp=d86373ade13f9fe71d02db895856ca2125ba8842;hpb=7ebcaad53a3261d8a4aefd8a64c5c7d9d8ac2fa0;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/nixops/modules/databases/default.nix b/nixops/modules/databases/default.nix index d86373a..3200181 100644 --- a/nixops/modules/databases/default.nix +++ b/nixops/modules/databases/default.nix @@ -2,6 +2,9 @@ let cfg = config.services.myDatabases; in { + imports = [ + ./openldap.nix + ]; options.services.myDatabases = { enable = lib.mkEnableOption "my databases service"; postgresql = { @@ -105,7 +108,8 @@ in { extraConfig = '' max_connections = 100 wal_level = logical - shared_buffers = 128MB + shared_buffers = 512MB + work_mem = 10MB max_wal_size = 1GB min_wal_size = 80MB log_timezone = 'Europe/Paris' @@ -123,7 +127,9 @@ in { authentication = '' local all postgres ident local all all md5 - hostssl all all all pam + hostssl all all 188.165.209.148/32 md5 + hostssl all all 178.33.252.96/32 md5 + hostssl all all all pam hostssl replication backup-1 2001:41d0:302:1100::9:e5a9/128 pam pamservice=postgresql_replication hostssl replication backup-1 54.37.151.137/32 pam pamservice=postgresql_replication ''; @@ -182,6 +188,10 @@ in { } ]; + ids.uids.redis = myconfig.env.users.redis.uid; + ids.gids.redis = myconfig.env.users.redis.gid; + users.users.redis.uid = config.ids.uids.redis; + users.groups.redis.gid = config.ids.gids.redis; services.redis = rec { enable = config.services.myDatabases.redis.enable; bind = "127.0.0.1"; @@ -195,5 +205,6 @@ in { mkdir -p $(dirname ${myconfig.env.databases.redis.socket}) chown redis $(dirname ${myconfig.env.databases.redis.socket}) ''; + }; }