mirror of
https://github.com/donovanglover/nix-config.git
synced 2025-07-12 12:15:30 +02:00
postgres: Ensure creation of database users
This is just a proof of concept that I plan to integrate into NixOS containers running specific users. The ensureDBOwnership part would no longer be needed since each database would receive its own container and consequently user.
This commit is contained in:
@ -1,7 +1,23 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
services.postgresql.enable = true;
|
services.postgresql = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
ensureUsers = [
|
||||||
|
{
|
||||||
|
name = "user";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "cooldbname";
|
||||||
|
ensureDBOwnership = true;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
ensureDatabases = [
|
||||||
|
"cooldbname"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
pgcli
|
pgcli
|
||||||
|
Reference in New Issue
Block a user