Enable postgres

This commit is contained in:
Ivan R. 2023-08-17 22:37:52 +05:00
parent 5d10dff0ad
commit bf58473ff4
No known key found for this signature in database
GPG key ID: 56C7BAAE859B302C
2 changed files with 21 additions and 0 deletions

View file

@ -9,6 +9,7 @@
./programs/nginx.nix
./programs/bash.nix
./programs/acme.nix
./programs/postgres.nix
];
# Enable flakes

View file

@ -0,0 +1,20 @@
{ config, pkgs, ... }:
{
config.services.postgresql = {
enable = true;
package = pkgs.postgresql_15;
ensureDatabases = [ "mastodon" "synapse" "nextcloud" ];
identMap = ''
# ArbitraryMapName systemUser DBUser
superuser_map root postgres
superuser_map postgres postgres
# Let other names login as themselves
superuser_map /^(.*)$ \1
'';
authentication = pkgs.lib.mkOverride 10 ''
#type database DBuser auth-method optional_ident_map
local sameuser all peer map=superuser_map
'';
};
}