Files
sydnix/modules/nixos/deertopia/vaultwarden.nix
Madeleine Sydney Ślaga 70068bf0d9
All checks were successful
build / build-sydpc (push) Successful in 1m52s
build / build-fruitbook (push) Successful in 23s
build / build-deertopia (push) Successful in 49s
feat(vaultwarden): init
2026-03-03 21:42:02 -07:00

46 lines
1.1 KiB
Nix

{ config, lib, pkgs, ... }:
let cfg = config.sydnix.deertopia.vaultwarden;
in {
options.sydnix.deertopia.vaultwarden = {
enable = lib.mkEnableOption "Vaultwarden";
};
config = lib.mkIf cfg.enable {
services.vaultwarden = {
enable = true;
config = {
ROCKET_ADDRESS = "127.0.0.1";
ROCKET_PORT = 8222;
DOMAIN = "https://vault.deertopia.net";
};
};
sydnix.impermanence.directories = [
"/var/backup/vaultwarden"
];
services.nginx.upstreams.vaultwarden.servers =
let port = toString config.services.vaultwarden.config.ROCKET_PORT;
in {
"127.0.0.1:${port}" = { };
};
sydnix.deertopia.nginx.vhosts."vault".vhost = {
forceSSL = true;
enableACME = true;
locations = {
"/".proxyPass = "http://vaultwarden";
"= /notifications/anonymous-hub" = {
proxyPass = "http://vaultwarden";
proxyWebsockets = true;
};
"= /notifications/hub" = {
proxyPass = "http://vaultwarden";
proxyWebsockets = true;
};
};
};
};
}