mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-29 11:36:16 +01:00
c1a727a699
Signed-off-by: Magic_RB <magic_rb@redalder.org>
59 lines
1.7 KiB
Nix
59 lines
1.7 KiB
Nix
{ makeSystem
|
|
, nixpkgs
|
|
}:
|
|
makeSystem {
|
|
system = "x86_64-linux";
|
|
name = "nixng-synapse-postgresql";
|
|
inherit nixpkgs;
|
|
config =
|
|
{ pkgs, config, ... }:
|
|
{
|
|
config = {
|
|
dumb-init = {
|
|
enable = true;
|
|
type.services = {};
|
|
};
|
|
services.postgresql = {
|
|
enable = true;
|
|
package = pkgs.postgresql_12;
|
|
|
|
initialScript = "/secrets/init.sql";
|
|
enableTCPIP = true;
|
|
|
|
authentication = "host all all all md5";
|
|
|
|
ensureDatabases = {
|
|
"synapse" = { ENCODING = "UTF8"; TEMPLATE = "template0"; };
|
|
"mautrix-facebook" = { ENCODING = "UTF8"; TEMPLATE = "template0"; };
|
|
"mautrix-signal" = { ENCODING = "UTF8"; TEMPLATE = "template0"; };
|
|
"mautrix-whatsapp" = { ENCODING = "UTF8"; TEMPLATE = "template0"; };
|
|
"mautrix-discord" = { ENCODING = "UTF8"; TEMPLATE = "template0"; };
|
|
};
|
|
ensureExtensions = {};
|
|
ensureUsers = [
|
|
{
|
|
name = "synapse";
|
|
ensurePermissions."DATABASE \"synapse\"" = "ALL PRIVILEGES";
|
|
}
|
|
{
|
|
name = "mautrix-facebook";
|
|
ensurePermissions."DATABASE \"mautrix-facebook\"" = "ALL PRIVILEGES";
|
|
}
|
|
{
|
|
name = "mautrix-signal";
|
|
ensurePermissions."DATABASE \"mautrix-signal\"" = "ALL PRIVILEGES";
|
|
}
|
|
{
|
|
name = "mautrix-whatsapp";
|
|
ensurePermissions."DATABASE \"mautrix-whatsapp\"" = "ALL PRIVILEGES";
|
|
}
|
|
{
|
|
name = "mautrix-discord";
|
|
ensurePermissions."DATABASE \"mautrix-discord\"" = "ALL PRIVILEGES";
|
|
}
|
|
];
|
|
};
|
|
};
|
|
};
|
|
}
|