ADD : databases : create load and configure postgresql
This commit is contained in:
parent
9724af4bde
commit
f2f069251c
|
@ -3,6 +3,7 @@
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./nextcloud.nix
|
./nextcloud.nix
|
||||||
./backup.nix
|
./backup.nix
|
||||||
|
./databases.nix
|
||||||
../modules/users.nix
|
../modules/users.nix
|
||||||
../modules/common.nix
|
../modules/common.nix
|
||||||
../modules/prometheus-node.nix
|
../modules/prometheus-node.nix
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
{config, pkgs, ...}:
|
||||||
|
{
|
||||||
|
|
||||||
|
networking.firewall.allowedTCPPorts = [ 5432 ];
|
||||||
|
# Enable PostgreSQL
|
||||||
|
services.postgresql = {
|
||||||
|
enable = true;
|
||||||
|
authentication = "host all all 192.168.0.0/16 trust";
|
||||||
|
|
||||||
|
# Ensure the database, user, and permissions always exist
|
||||||
|
ensureDatabases = [ "pizzajoffredb" ];
|
||||||
|
ensureUsers = [
|
||||||
|
{ name = "pizzajoffre";
|
||||||
|
ensurePermissions."DATABASE pizzajoffredb" = "ALL PRIVILEGES";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue