|
14 | 14 | type = lib.types.str;
|
15 | 15 | default = "supabase_admin";
|
16 | 16 | };
|
| 17 | + settings = lib.mkOption { |
| 18 | + type = lib.types.attrs; |
| 19 | + default = { |
| 20 | + authentication_timeout = "1min"; |
| 21 | + "auto_explain.log_min_duration" = "10s"; |
| 22 | + checkpoint_completion_target = "0.5"; |
| 23 | + checkpoint_flush_after = "256kB"; |
| 24 | + cluster_name = "main"; |
| 25 | + "cron.database_name" = "postgres"; |
| 26 | + default_text_search_config = "pg_catalog.english"; |
| 27 | + effective_cache_size = "128MB"; |
| 28 | + extra_float_digits = "0"; |
| 29 | + include = "/etc/postgresql-custom/read-replica.conf"; |
| 30 | + jit = "off"; |
| 31 | + jit_provider = "llvmjit"; |
| 32 | + lc_messages = "en_US.UTF-8"; |
| 33 | + lc_monetary = "en_US.UTF-8"; |
| 34 | + lc_numeric = "en_US.UTF-8"; |
| 35 | + lc_time = "en_US.UTF-8"; |
| 36 | + listen_addresses = "*"; |
| 37 | + log_destination = "stderr"; |
| 38 | + log_line_prefix = "%h %m [%p] %q%u@%d "; |
| 39 | + log_statement = "ddl"; |
| 40 | + log_timezone = "UTC"; |
| 41 | + max_replication_slots = "5"; |
| 42 | + max_slot_wal_keep_size = "4096"; |
| 43 | + max_wal_senders = "10"; |
| 44 | + password_encryption = "scram-sha-256"; |
| 45 | + port = 5432; |
| 46 | + row_security = "on"; |
| 47 | + shared_buffers = "128MB"; |
| 48 | + ssl = "off"; |
| 49 | + ssl_ca_file = ""; |
| 50 | + ssl_cert_file = ""; |
| 51 | + ssl_ciphers = "HIGH:MEDIUM:+3DES:!aNULL"; |
| 52 | + ssl_crl_dir = ""; |
| 53 | + ssl_crl_file = ""; |
| 54 | + ssl_dh_params_file = ""; |
| 55 | + ssl_ecdh_curve = "prime256v1"; |
| 56 | + ssl_key_file = ""; |
| 57 | + ssl_max_protocol_version = ""; |
| 58 | + ssl_min_protocol_version = "TLSv1.2"; |
| 59 | + ssl_passphrase_command = ""; |
| 60 | + ssl_passphrase_command_supports_reload = "off"; |
| 61 | + ssl_prefer_server_ciphers = "on"; |
| 62 | + timezone = "UTC"; |
| 63 | + wal_level = "logical"; |
| 64 | + }; |
| 65 | + }; |
| 66 | + authentication = lib.mkOption { |
| 67 | + type = lib.types.lines; |
| 68 | + default = '' |
| 69 | + # trust local connections |
| 70 | + local all supabase_admin scram-sha-256 |
| 71 | + local all all peer map=supabase_map |
| 72 | + host all all 127.0.0.1/32 trust |
| 73 | + host all all ::1/128 trust |
| 74 | +
|
| 75 | + # IPv4 external connections |
| 76 | + host all all 10.0.0.0/8 scram-sha-256 |
| 77 | + host all all 172.16.0.0/12 scram-sha-256 |
| 78 | + host all all 192.168.0.0/16 scram-sha-256 |
| 79 | + host all all 0.0.0.0/0 scram-sha-256 |
| 80 | +
|
| 81 | + # IPv6 external connections |
| 82 | + host all all ::0/0 scram-sha-256 |
| 83 | + ''; |
| 84 | + }; |
17 | 85 | };
|
18 | 86 | };
|
19 | 87 | postgresqlVersion = lib.types.submodule {
|
|
24 | 92 | };
|
25 | 93 | supabaseSubmodule = lib.types.submodule {
|
26 | 94 | options = {
|
27 |
| - defaults = lib.mkOption { type = postgresqlDefaults; }; |
| 95 | + postgres.defaults = lib.mkOption { type = postgresqlDefaults; }; |
28 | 96 | supportedPostgresVersions = lib.mkOption {
|
29 | 97 | type = lib.types.attrsOf (lib.types.attrsOf postgresqlVersion);
|
30 | 98 | default = { };
|
|
38 | 106 | supabase = lib.mkOption { type = supabaseSubmodule; };
|
39 | 107 | };
|
40 | 108 | config.supabase = {
|
41 |
| - defaults = { }; |
| 109 | + postgres.defaults = { }; |
42 | 110 | supportedPostgresVersions = {
|
43 | 111 | postgres = {
|
44 | 112 | "15" = {
|
|
0 commit comments