2022-08-26 10:21:05 +00:00
|
|
|
{ pkgs, lib, config, ... }:
|
2021-11-15 10:02:05 +00:00
|
|
|
let
|
|
|
|
cfg = config.services.userdata;
|
|
|
|
in
|
|
|
|
{
|
2022-08-26 10:21:05 +00:00
|
|
|
fileSystems = lib.mkIf cfg.useBinds {
|
|
|
|
"/var/lib/bitwarden" = {
|
|
|
|
device = "/volumes/${cfg.bitwarden.location}/bitwarden";
|
|
|
|
options = [ "bind" ];
|
|
|
|
};
|
|
|
|
"/var/lib/bitwarden_rs" = {
|
|
|
|
device = "/volumes/${cfg.bitwarden.location}/bitwarden_rs";
|
|
|
|
options = [ "bind" ];
|
|
|
|
};
|
|
|
|
};
|
2022-07-19 12:18:46 +00:00
|
|
|
services.vaultwarden = {
|
2021-11-15 10:02:05 +00:00
|
|
|
enable = cfg.bitwarden.enable;
|
|
|
|
dbBackend = "sqlite";
|
2021-11-17 08:54:36 +00:00
|
|
|
backupDir = "/var/lib/bitwarden/backup";
|
2021-11-15 10:02:05 +00:00
|
|
|
config = {
|
|
|
|
domain = "https://password.${cfg.domain}/";
|
|
|
|
signupsAllowed = true;
|
|
|
|
rocketPort = 8222;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|