vaultwarden and postgresql

This commit is contained in:
tristan 2025-05-24 23:03:40 -04:00
parent d0c72f5d3c
commit 55eb4f5ddc
10 changed files with 228 additions and 24 deletions

25
imports/postgres.nix Normal file
View file

@ -0,0 +1,25 @@
{ config, lib, pkgs, ... }:
{
services.postgresql = {
enable = true;
ensureDatabases = [ "vaultwarden" ];
authentication = pkgs.lib.mkOverride 10 ''
#type database DBuser auth-method
local all all trust
'';
# When removing users or removing permissions from users here, must also remove them manually
ensureUsers = [
{
name = "vaultwarden";
ensureDBOwnership = true;
}
];
settings = {
port = 5432;
};
};
}