This repository has been archived on 2025-03-05. You can view files and clone it, but cannot push or open issues or pull requests.

23 lines
631 B
Nix
Raw Normal View History

2023-01-18 20:14:16 +01:00
{ pkgs, config, ... }:
{
services.postgresql = {
enable = true;
enableTCPIP = true;
package = pkgs.postgresql_15;
authentication = pkgs.lib.mkOverride 10 ''
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
host all all 10.88.0.1/16 trust
'';
initialScript = pkgs.writeText "backend-initScript" ''
CREATE USER baserow WITH ENCRYPTED PASSWORD 'baserow';
CREATE DATABASE baserow;
GRANT ALL PRIVILEGES ON DATABASE baserow TO baserow;
ALTER DATABASE baserow OWNER to baserow;
'';
};
# services.postgresqlBackup.enable = true;
}