2023-10-02 03:08:24 +01:00
|
|
|
{
|
|
|
|
self,
|
|
|
|
hostPath,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
wireguardData = import "${self}/data/wireguard/chaosInternalWireGuard.nix";
|
|
|
|
wireguardHosts = wireguardData.hosts;
|
|
|
|
|
|
|
|
localContainersAddresses = import "${hostPath}/data/containerAddresses.nix";
|
|
|
|
in {
|
|
|
|
services.postgresql = {
|
|
|
|
enable = true;
|
|
|
|
enableTCPIP = true;
|
|
|
|
ensureDatabases = [
|
|
|
|
"gotosocial"
|
|
|
|
"quassel"
|
|
|
|
];
|
|
|
|
ensureUsers = [
|
|
|
|
{
|
|
|
|
name = "gotosocial";
|
2024-01-25 11:53:48 +00:00
|
|
|
ensureDBOwnership = true;
|
|
|
|
}
|
2023-10-02 03:08:24 +01:00
|
|
|
{
|
|
|
|
name = "quassel";
|
2024-01-25 11:53:48 +00:00
|
|
|
ensureDBOwnership = true;
|
2023-10-02 03:08:24 +01:00
|
|
|
}
|
|
|
|
];
|
|
|
|
# If the host is a local container then use the container's IP
|
|
|
|
# otherwise use the host's IP
|
|
|
|
authentication = ''
|
|
|
|
host gotosocial gotosocial ${localContainersAddresses.containers."social"}/32 trust
|
|
|
|
host quassel quassel ${localContainersAddresses.containers."quassel"}/32 trust
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|