nixos/modules/homelab/vaultwarden.nix

36 lines
811 B
Nix
Raw Permalink Normal View History

{
config,
lib,
...
}:
lib.mkIf config.fireproof.homelab.enable (let
2025-03-09 20:30:33 +01:00
domain = "bitwarden.nickolaj.com";
in {
2025-04-23 00:02:00 +02:00
services = {
vaultwarden = {
enable = true;
config = {
DOMAIN = "https://${domain}";
SIGNUPS_ALLOWED = false;
ROCKET_ADDRESS = "127.0.0.1";
ROCKET_PORT = 8222;
};
2025-03-09 20:30:33 +01:00
};
2025-04-26 20:02:56 +02:00
restic.backups.homelab = {
paths = ["/var/lib/vaultwarden"];
exclude = [
"/var/lib/vaultwarden/icon_cache"
"/var/lib/vaultwarden/tmp"
];
};
2025-03-09 20:30:33 +01:00
2025-04-23 00:02:00 +02:00
nginx.virtualHosts."${domain}" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://${toString config.services.vaultwarden.config.ROCKET_ADDRESS}:${toString config.services.vaultwarden.config.ROCKET_PORT}";
};
2025-03-09 20:30:33 +01:00
};
};
})