nixos/hosts/homelab/vaultwarden.nix
2025-04-23 00:02:00 +02:00

24 lines
634 B
Nix

{config, ...}: let
domain = "bitwarden.nickolaj.com";
in {
services = {
vaultwarden = {
enable = true;
config = {
DOMAIN = "https://${domain}";
SIGNUPS_ALLOWED = false;
ROCKET_ADDRESS = "127.0.0.1";
ROCKET_PORT = 8222;
};
};
restic.backups.homelab.paths = ["/var/lib/vaultwarden"];
nginx.virtualHosts."${domain}" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://${toString config.services.vaultwarden.config.ROCKET_ADDRESS}:${toString config.services.vaultwarden.config.ROCKET_PORT}";
};
};
};
}