depot/hosts/VEGAS/services/bitwarden/default.nix

28 lines
828 B
Nix
Raw Permalink Normal View History

2021-10-16 20:34:42 +03:00
{ config, lib, tools, ... }:
with tools.nginx;
{
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
}