Let's configure the db for gotosocial?

This commit is contained in:
Lillian Violet 2023-11-27 15:06:57 +01:00
parent c2d0ff412e
commit 7fa997ec94
4 changed files with 37 additions and 22 deletions

View file

@ -16,6 +16,7 @@
# You can also split up your configuration and import pieces of it here: # You can also split up your configuration and import pieces of it here:
# ./nvim.nix # ./nvim.nix
./hardware-configuration.nix ./hardware-configuration.nix
./postgres.nix
./nextcloud.nix ./nextcloud.nix
./mail-server.nix ./mail-server.nix
./gotosocial.nix ./gotosocial.nix

View file

@ -22,6 +22,7 @@
services.gotosocial = { services.gotosocial = {
enable = true; enable = true;
package = pkgs.gotosocial;
setupPostgresqlDB = true; setupPostgresqlDB = true;
settings = { settings = {
application-name = "gotosocial"; application-name = "gotosocial";
@ -41,4 +42,9 @@
smtp-from = "no-reply@social.gladtherescake.eu"; smtp-from = "no-reply@social.gladtherescake.eu";
}; };
}; };
systemd.services."gotosocial" = {
requires = ["postgresql.service"];
after = ["postgresql.service"];
};
} }

View file

@ -105,28 +105,6 @@
enable = true; enable = true;
}; };
# Enable PostgreSQL
services.postgresql = {
enable = true;
# Ensure the database, user, and permissions always exist
ensureDatabases = ["nextcloud" "onlyoffice" "akkoma"];
ensureUsers = [
{
name = "nextcloud";
ensurePermissions."DATABASE nextcloud" = "ALL PRIVILEGES";
}
{
name = "onlyoffice";
ensurePermissions."DATABASE onlyoffice" = "ALL PRIVILEGES";
}
{
name = "akkoma";
ensurePermissions."DATABASE akkoma" = "ALL PRIVILEGES";
}
];
};
services.aria2 = { services.aria2 = {
enable = true; enable = true;
rpcListenPort = 6969; rpcListenPort = 6969;

30
nixos/queen/postgres.nix Normal file
View file

@ -0,0 +1,30 @@
{
config,
pkgs,
...
}: {
services.postgresql = {
enable = true;
# Ensure the database, user, and permissions always exist
ensureDatabases = ["nextcloud" "onlyoffice" "akkoma"];
ensureUsers = [
{
name = "nextcloud";
ensurePermissions."DATABASE nextcloud" = "ALL PRIVILEGES";
}
{
name = "onlyoffice";
ensurePermissions."DATABASE onlyoffice" = "ALL PRIVILEGES";
}
{
name = "akkoma";
ensurePermissions."DATABASE akkoma" = "ALL PRIVILEGES";
}
{
name = "gotosocial";
ensurePermissions."DATABASE gotosocial" = "ALL PRIVILEGES";
}
];
};
}