From 84a49c43e26dd0133eff87464cada722980bc2fb Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Wed, 8 May 2024 03:40:59 -0400 Subject: [PATCH] Infini-DL360: use common domain config --- hosts/Infini-DL360/vaultwarden.nix | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/hosts/Infini-DL360/vaultwarden.nix b/hosts/Infini-DL360/vaultwarden.nix index 1ce91a2..5bb61c1 100644 --- a/hosts/Infini-DL360/vaultwarden.nix +++ b/hosts/Infini-DL360/vaultwarden.nix @@ -1,9 +1,11 @@ { config, lib, pkgs, ... }: - +let + domain = config.common.subdomain "bitwarden"; +in { persist.directories = [ config.services.vaultwarden.dataDir ]; - services.nginx.virtualHosts."bitwarden.inx.moe" = config.common.nginx.ssl // { + services.nginx.virtualHosts.${domain} = config.common.nginx.ssl // { locations."/" = { proxyPass = "http://127.0.0.1:${toString config.services.vaultwarden.config.ROCKET_PORT}"; }; @@ -13,8 +15,8 @@ enable = true; environmentFile = config.secrets."vaultwarden"; dataDir = "/srv/vaultwarden"; - config = { - DOMAIN = "https://bitwarden.inx.moe"; + config = with config.common.email; { + DOMAIN = "https://${domain}"; SIGNUPS_ALLOWED = false; ROCKET_ADDRESS = "127.0.0.1"; @@ -24,11 +26,11 @@ PUSH_ENABLED = true; PUSH_RELAY_URI = "https://push.bitwarden.com"; - SMTP_HOST = "smtp.purelymail.com"; - SMTP_FROM = "noreply+vaultwarden@inx.moe"; - SMTP_PORT = 465; + SMTP_HOST = smtp.address; + SMTP_PORT = smtp.SSLTLS; SMTP_SECURITY = "force_tls"; - SMTP_USERNAME = "noreply@inx.moe"; + SMTP_USERNAME = outgoing; + SMTP_FROM = withSubaddress "vaultwarden"; }; }; }