feat(server/databases): add postgresql

This commit is contained in:
Mohammad Rafiq 2025-06-12 12:32:58 +08:00
parent 93f0d568a1
commit a7cc5e4705
No known key found for this signature in database
3 changed files with 21 additions and 0 deletions

View file

@ -20,6 +20,7 @@
config = lib.mkMerge [
{
services.fwupd.enable = true;
environment.persistence."/persist".directories = lib.singleton "/var/lib/bluetooth";
hardware.bluetooth = {
enable = true;
settings.General.Experimental = true;

View file

@ -17,9 +17,28 @@ in
enable = lib.mkEnableOption "the MySQL server";
port = lib.pantheon.mkPortOption 3306;
};
postgresql = {
enable = lib.mkEnableOption "the postgresql server";
port = lib.pantheon.mkPortOption 5432;
};
};
config = lib.mkMerge [
(lib.mkIf cfg.postgresql.enable {
networking.firewall.allowedTCPPorts = lib.singleton cfg.postgresql.port;
services.postgresql = {
enable = true;
enableTCPIP = true;
inherit (cfg.postgresql) port;
authentication = lib.mkOverride 10 ''
#type database DBuser auth-method
local all all trust
# ipv4
host all all 0.0.0.0/32 trust
'';
};
})
(lib.mkIf cfg.mongodb.enable {
networking.firewall.allowedTCPPorts = [ cfg.mongodb.port ];
environment.persistence."/persist".directories = [