nixos-config/nixos/private/vaultwarden.nix

39 lines
954 B
Nix
Raw Normal View History

2024-05-10 16:58:48 +05:00
{ config, ... }:
{
services.vaultwarden = {
enable = true;
dbBackend = "postgresql";
environmentFile = "/var/lib/vaultwarden/.env";
2024-05-10 16:58:48 +05:00
config = {
DOMAIN = "https://vault.comfycamp.space";
2024-05-10 17:51:13 +05:00
LOG_LEVEL = "warn";
2024-05-10 16:58:48 +05:00
DATABASE_URL = "postgresql:///vaultwarden?host=/var/run/postgresql";
ROCKET_ADDRESS = "127.0.0.1";
ROCKET_PORT = 8222;
SMTP_HOST = "comfycamp.space";
SMTP_PORT = 465;
SMTP_SECURITY = "force_tls";
SMTP_FROM = "vaultwarden@comfycamp.space";
SMTP_FROM_NAME = "Vaultwarden";
SMTP_USERNAME = "vaultwarden@comfycamp.space";
2024-05-10 16:58:48 +05:00
};
};
services.nginx.virtualHosts."vault.comfycamp.space" = {
useACMEHost = "comfycamp.space";
forceSSL = true;
listenAddresses = [
"10.101.0.1"
2024-05-10 16:58:48 +05:00
];
locations."/" = {
proxyPass = "http://127.0.0.1:${toString config.services.vaultwarden.config.ROCKET_PORT}";
2024-05-10 17:49:08 +05:00
proxyWebsockets = true;
2024-05-10 16:58:48 +05:00
};
};
}