moved postgres to it's own file

This commit is contained in:
Nickiel12 2024-07-12 01:30:41 +00:00
parent 958128e86e
commit e18d2a06f7
3 changed files with 88 additions and 84 deletions

View file

@ -16,6 +16,7 @@
./modules/nginx.nix
./modules/nextcloud.nix
./modules/nicks_nextcould_integrations.nix
./modules/postgres.nix
./modules/protonvpn.nix
./modules/tailscale.nix
./modules/vaultwarden.nix

View file

@ -59,25 +59,6 @@
};
};
services.postgresql = {
enable = true;
enableTCPIP = true;
ensureDatabases = [ "nextcloud" ];
ensureUsers = [
{
name = "nextcloud";
ensureDBOwnership = true;
}
];
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
host all all 0.0.0.0/0 md5
''; # address is the computer you are connecting from
};
# Make sure PostSQL is running before nextcloud
systemd.services."nextcloud-setup" = {
requires = ["postgresql.service"];

View file

@ -0,0 +1,22 @@
{ config, lib, pkgs, ... }:
{
services.postgresql = {
enable = true;
enableTCPIP = true;
ensureDatabases = [ "nextcloud" ];
ensureUsers = [
{
name = "nextcloud";
ensureDBOwnership = true;
}
];
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
host all all 0.0.0.0/0 md5
''; # address is the computer you are connecting from
};
}