mirror of
https://github.com/ordinary-dev/nixos-config.git
synced 2024-09-19 19:30:28 +05:00
Enable postgres
This commit is contained in:
parent
5d10dff0ad
commit
bf58473ff4
|
@ -9,6 +9,7 @@
|
|||
./programs/nginx.nix
|
||||
./programs/bash.nix
|
||||
./programs/acme.nix
|
||||
./programs/postgres.nix
|
||||
];
|
||||
|
||||
# Enable flakes
|
||||
|
|
20
nixos/programs/postgres.nix
Normal file
20
nixos/programs/postgres.nix
Normal 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
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue