diff --git a/modules/postgres.nix b/modules/postgres.nix index afa92501..b1e5f593 100644 --- a/modules/postgres.nix +++ b/modules/postgres.nix @@ -1,7 +1,23 @@ { pkgs, ... }: { - services.postgresql.enable = true; + services.postgresql = { + enable = true; + + ensureUsers = [ + { + name = "user"; + } + { + name = "cooldbname"; + ensureDBOwnership = true; + } + ]; + + ensureDatabases = [ + "cooldbname" + ]; + }; environment.systemPackages = with pkgs; [ pgcli