diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-09-25 22:01:30 +0200 |
---|---|---|
committer | Rory& <root@rory.gay> | 2024-06-05 17:25:16 +0200 |
commit | 6ad94061571c1abf39cb81903fefd773f8d8941c (patch) | |
tree | 70201c3d2d4721664e909f1a1462551e8aa83fc0 /host/Spacebar-nginx/containers/spacebar-server-dev-nix/services/postgres.nix | |
parent | Switch to nginx mainline (diff) | |
download | Spacebar-Open-Infrastructure-6ad94061571c1abf39cb81903fefd773f8d8941c.tar.xz |
Work on spacebar container
Squashed 36
Diffstat (limited to 'host/Spacebar-nginx/containers/spacebar-server-dev-nix/services/postgres.nix')
-rw-r--r-- | host/Spacebar-nginx/containers/spacebar-server-dev-nix/services/postgres.nix | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/host/Spacebar-nginx/containers/spacebar-server-dev-nix/services/postgres.nix b/host/Spacebar-nginx/containers/spacebar-server-dev-nix/services/postgres.nix new file mode 100644 index 0000000..97ea3e6 --- /dev/null +++ b/host/Spacebar-nginx/containers/spacebar-server-dev-nix/services/postgres.nix @@ -0,0 +1,30 @@ +{ config, pkgs, lib, ... }: + +{ + #systemd.tmpfiles.rules = [ "d /data/pg 0750 postgres postgres" ]; + + services.postgresql = { + enable = true; + package = pkgs.postgresql_15; + enableTCPIP = true; + authentication = pkgs.lib.mkOverride 10 '' + # TYPE, DATABASE, USER, ADDRESS, METHOD + local all all trust + host all all 127.0.0.1/32 trust + host all all ::1/128 trust + host all all 0.0.0.0/0 md5 + ''; + initialScript = pkgs.writeText "backend-initScript" '' + CREATE ROLE spacebar WITH LOGIN PASSWORD 'spacebar' CREATEDB; + CREATE DATABASE spacebar; + GRANT ALL PRIVILEGES ON DATABASE spacebar TO spacebar; + ''; + #dataDir = "/data/pg"; + settings = { + "max_connections" = "100"; + "shared_buffers" = "128MB"; + "max_wal_size" = "1GB"; + "min_wal_size" = "80MB"; + }; + }; +} \ No newline at end of file |