Moved postgresql to seperate file

This commit is contained in:
Nickiel12 2023-05-27 15:05:20 -07:00
parent 6ac280f0a2
commit 570ff894f8
2 changed files with 23 additions and 0 deletions

View file

@ -7,6 +7,7 @@
(import ./hardware-configuration.nix)
(import ./modules/nginx.nix)
(import ./modules/nextcloud.nix)
(import ./modules/postgresql.nix)
(import ./modules/msmtp.nix)
(import ./modules/forgejo.nix)
];

View file

@ -0,0 +1,22 @@
{ config, lib, pkgs, ... }:
{
services.postgresql = {
enable = true;
ensureDatabases = [ "nextcloud" ];
ensureUsers = [
{
name = "nextcloud";
ensurePermissions."DATABASE nextcloud" = "ALL PRIVILEGES";
}
];
authentication = lib.mkForce ''
# TYPE DATABASE USER ADDRESS METHOD
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
'';
};
}