nextcloud: Use a hardened systemd unit instead of a container

This commit is contained in:
Tristan Daniël Maat 2022-10-12 18:04:06 +01:00
parent 6a81ce4c1d
commit 3cedb9f978
Signed by: tlater
GPG key ID: 49670FD774E43268
4 changed files with 120 additions and 210 deletions
configuration/services

View file

@ -0,0 +1,31 @@
{pkgs, ...}: {
services.postgresql = {
package = pkgs.postgresql_14;
enable = true;
# Only enable connections via the unix socket, and check with the
# OS to make sure the user matches the database name.
#
# See https://www.postgresql.org/docs/current/auth-pg-hba-conf.html
authentication = ''
local sameuser all peer
'';
# Note: The following options with ensure.* are set-only; i.e.,
# when permissions/users/databases are removed from these lists,
# that operation needs to be performed manually on the system as
# well.
ensureUsers = [
{
name = "nextcloud";
ensurePermissions = {
"DATABASE nextcloud" = "ALL PRIVILEGES";
};
}
];
ensureDatabases = [
"nextcloud"
];
};
}