feat(vaultwarden): init
This commit is contained in:
@@ -66,6 +66,7 @@
|
||||
# umurmur.enable = true;
|
||||
murmur.enable = true;
|
||||
anki-sync-server.enable = true;
|
||||
vaultwarden.enable = true;
|
||||
servarr = {
|
||||
enable = true;
|
||||
prowlarr.enable = true;
|
||||
|
||||
45
modules/nixos/deertopia/vaultwarden.nix
Normal file
45
modules/nixos/deertopia/vaultwarden.nix
Normal file
@@ -0,0 +1,45 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let cfg = config.sydnix.deertopia.vaultwarden;
|
||||
in {
|
||||
options.sydnix.deertopia.vaultwarden = {
|
||||
enable = lib.mkEnableOption "Vaultwarden";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.vaultwarden = {
|
||||
enable = true;
|
||||
config = {
|
||||
ROCKET_ADDRESS = "127.0.0.1";
|
||||
ROCKET_PORT = 8222;
|
||||
DOMAIN = "https://vault.deertopia.net";
|
||||
};
|
||||
};
|
||||
|
||||
sydnix.impermanence.directories = [
|
||||
"/var/backup/vaultwarden"
|
||||
];
|
||||
|
||||
services.nginx.upstreams.vaultwarden.servers =
|
||||
let port = toString config.services.vaultwarden.config.ROCKET_PORT;
|
||||
in {
|
||||
"127.0.0.1:${port}" = { };
|
||||
};
|
||||
|
||||
sydnix.deertopia.nginx.vhosts."vault".vhost = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations = {
|
||||
"/".proxyPass = "http://vaultwarden";
|
||||
"= /notifications/anonymous-hub" = {
|
||||
proxyPass = "http://vaultwarden";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
"= /notifications/hub" = {
|
||||
proxyPass = "http://vaultwarden";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user