depot/cluster/services/bitwarden/host.nix

28 lines
832 B
Nix
Raw Normal View History

2023-08-31 01:55:45 +03:00
{ config, lib, depot, ... }:
with depot.lib.nginx;
2021-10-16 20:34:42 +03:00
{
2022-06-18 03:44:51 +03:00
links.bitwarden.protocol = "http";
2021-11-29 02:38:59 +02:00
2021-10-16 20:34:42 +03:00
services.nginx.virtualHosts = mappers.mapSubdomains {
2022-06-18 03:44:51 +03:00
keychain = vhosts.proxy config.links.bitwarden.url;
2021-10-16 20:34:42 +03:00
};
services.vaultwarden = {
2021-10-16 20:34:42 +03:00
enable = true;
backupDir = "/srv/storage/private/bitwarden/backups";
config = {
dataFolder = "/srv/storage/private/bitwarden/data";
2022-06-18 03:44:51 +03:00
rocketPort = config.links.bitwarden.port;
2021-10-16 20:34:42 +03:00
};
#environmentFile = ""; # TODO: agenix
};
systemd.services.vaultwarden.serviceConfig = {
2021-10-16 20:34:42 +03:00
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";
};
};
2021-10-16 20:34:42 +03:00
}