-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvaultwarden.nix
More file actions
41 lines (39 loc) · 943 Bytes
/
vaultwarden.nix
File metadata and controls
41 lines (39 loc) · 943 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{
config,
lib,
...
}:
with lib;
let
cfg = config.hosts.vaultwarden;
backupDir = "/var/lib/vaultwarden/backup";
in
{
options.hosts.vaultwarden = {
enable = mkEnableOption "Enable vaultwarden";
};
config = mkIf cfg.enable {
services.caddy.virtualHosts."vaultwarden.thuis".extraConfig = ''
import headscale
import mtls
handle @internal {
reverse_proxy http://localhost:${toString config.services.vaultwarden.config.rocketPort}
}
respond 403
'';
services.borgbackup.jobs.default.paths = [ backupDir ];
services.vaultwarden = {
enable = true;
dbBackend = "sqlite";
inherit backupDir;
config = {
domain = "https://vaultwarden.thuis";
signupsAllowed = false;
invitationsAllowed = false;
rocketPort = 3011;
websocketEnabled = false;
experimentalClientFeatureFlags = "mutual-tls";
};
};
};
}