1
Fork 0
satellite/modules/applications/postgres.nix

29 lines
819 B
Nix
Raw Permalink Normal View History

2020-05-09 23:38:47 +02:00
{ pkgs, lib, ... }: {
services.postgresql = {
enable = true;
package = pkgs.postgresql_10;
enableTCPIP = true;
authentication = lib.mkForce ''
# Generated file; do not edit!
# TYPE DATABASE USER ADDRESS METHOD
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
'';
2020-05-14 18:13:36 +02:00
initialScript = pkgs.writeText "backend-initScript" ''
2020-05-29 11:29:33 +02:00
CREATE ROLE adrielus WITH
LOGIN
SUPERUSER
INHERIT
CREATEDB
CREATEROLE
REPLICATION;
2020-05-14 18:13:36 +02:00
CREATE DATABASE lunarbox;
GRANT ALL PRIVILEGES ON DATABASE lunarbox TO adrielus;
'';
2020-05-09 23:38:47 +02:00
};
}