helm/modules/services/bitwarden.nix
Henrik Lissner ffb097ce0c fail2ban: move maxretry default to jails
Throws a "option 'maxretry' in section 'DEFAULT' already exists" error
on startup otherwise.
2021-01-31 18:43:29 -05:00

31 lines
646 B
Nix

{ options, config, lib, pkgs, ... }:
with lib;
with lib.my;
let cfg = config.modules.services.bitwarden;
in {
options.modules.services.bitwarden = {
enable = mkBoolOpt false;
};
config = mkIf cfg.enable {
services.bitwarden_rs.enable = true;
user.extraGroups = [ "bitwarden_rs" ];
services.fail2ban.jails.bitwarden_rs = ''
enabled = true
filter = bitwarden_rs
port = 80,443,8002
maxretry = 5
'';
modules.backup.targets.bitwarden = {
baseDir = "/var/lib/bitwarden_rs";
owner = "bitwarden_rs";
targets = [ "*" ];
suspendServices = [ "bitwarden_rs" ];
};
};
}