helm/modules/services/bitwarden.nix
Henrik Lissner c883524efc Replace backup module with built-in solutions
May not be as universal, but is more certain to work correctly than my
hacked up version that I'm not so invested in.
2021-02-22 10:40:22 -05:00

27 lines
521 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;
backupDir = "/run/backups/bitwarden_rs";
};
user.extraGroups = [ "bitwarden_rs" ];
services.fail2ban.jails.bitwarden_rs = ''
enabled = true
filter = bitwarden_rs
port = 80,443,8002
maxretry = 5
'';
};
}