Skip to content

Instantly share code, notes, and snippets.

@colonelpanic8
Created April 23, 2024 20:58
Show Gist options
  • Save colonelpanic8/64edc80fa7c100d506f37960644305d8 to your computer and use it in GitHub Desktop.
Save colonelpanic8/64edc80fa7c100d506f37960644305d8 to your computer and use it in GitHub Desktop.
services.postgresql = {
enable = true;
package = pkgs.postgresql_15;
ensureDatabases = [ "railbird" "public" ];
authentication = pkgs.lib.mkOverride 10 ''
#type database DBuser CIDR-ADDRESS auth-method
local all all trust
host all all 0.0.0.0/0 trust
host all all ::1/128 trust
'';
ensureUsers = map (username: {
name = username;
ensureClauses = {
superuser = true;
createrole = true;
createdb = true;
};
}) ["nixos"];
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment