tsuki/vaultwarden: use socket activation

This commit is contained in:
Oystein Kristoffer Tveit 2023-10-06 13:42:11 +02:00
parent caedfe1810
commit aca2962eec
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146
2 changed files with 11 additions and 3 deletions

View File

@ -57,7 +57,7 @@
"pgadmin".servers."unix:${srv.uwsgi.instance.vassals.pgadmin.socket}" = { };
"plex".servers."localhost:${s ports.plex}" = { };
"proxmox".servers."${ips.px1}:${s ports.proxmox}" = { };
"vaultwarden".servers."localhost:${s srv.vaultwarden.config.ROCKET_PORT}" = { };
"vaultwarden".servers."unix:${sa.vaultwarden.newSocketAddress}" = { };
};
virtualHosts = let

View File

@ -1,5 +1,6 @@
{ pkgs, config, ... }:
{
{ config, pkgs, ... }: let
cfg = config.services.vaultwarden;
in {
services.vaultwarden = {
enable = true;
dbBackend = "postgresql";
@ -66,4 +67,11 @@
})
];
};
local.socketActivation.vaultwarden = {
enable = cfg.enable;
originalSocketAddress = "${cfg.config.ROCKET_ADDRESS}:${toString cfg.config.ROCKET_PORT}";
newSocketAddress = "/run/vaultwarden.sock";
privateNamespace = false;
};
}