feat: adds vaultwarden configuration

This commit is contained in:
Ahwx 2025-07-30 13:38:07 +02:00
parent 783b52e681
commit d8d6bc67d8

View file

@ -0,0 +1,34 @@
{ config, ... }:
{
services.vaultwarden = {
enable = true;
dbBackend = "sqlite";
config = {
SIGNUPS_ALLOWED = false;
ENABLE_WEBSOCKET = true;
SENDS_ALLOWED = true;
INVITATIONS_ENABLED = true;
EMERGENCY_ACCESS_ALLOWED = true;
EMAIL_ACCESS_ALLOWED = true;
DOMAIN = "https://passwords.liv.town";
ROCKET_ADDRESS = "0.0.0.0";
ROCKET_PORT = 8003;
};
};
services.nginx = {
enable = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts = {
"passwords.liv.town" = {
forceSSL = true;
sslCertificate = "/var/lib/acme/liv.town/cert.pem";
sslCertificateKey = "/var/lib/acme/liv.town/key.pem";
locations."/" = {
proxyPass = "http://127.0.0.1:${toString config.services.vaultwarden.config.ROCKET_PORT}/";
proxyWebsockets = true;
};
};
};
};
}