depot/hosts/VEGAS/services/bitwarden/default.nix
2023-09-03 01:11:49 +02:00

27 lines
832 B
Nix

{ config, lib, depot, ... }:
with depot.lib.nginx;
{
links.bitwarden.protocol = "http";
services.nginx.virtualHosts = mappers.mapSubdomains {
keychain = vhosts.proxy config.links.bitwarden.url;
};
services.vaultwarden = {
enable = true;
backupDir = "/srv/storage/private/bitwarden/backups";
config = {
dataFolder = "/srv/storage/private/bitwarden/data";
rocketPort = config.links.bitwarden.port;
};
#environmentFile = ""; # TODO: agenix
};
systemd.services.vaultwarden.serviceConfig = {
ReadWriteDirectories = "/srv/storage/private/bitwarden";
};
systemd.services.backup-vaultwarden = {
environment.DATA_FOLDER = lib.mkForce config.services.vaultwarden.config.dataFolder;
serviceConfig = {
ReadWriteDirectories = "/srv/storage/private/bitwarden";
};
};
}