From 19e082d3f12712f68c24dfdb46d44a20ffb7bd15 Mon Sep 17 00:00:00 2001 From: tdback Date: Sat, 23 Nov 2024 15:45:19 -0500 Subject: [PATCH] cleanup vaultwarden container --- containers/vaultwarden/default.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/containers/vaultwarden/default.nix b/containers/vaultwarden/default.nix index ee5cc5e..ba7ed30 100644 --- a/containers/vaultwarden/default.nix +++ b/containers/vaultwarden/default.nix @@ -1,13 +1,13 @@ -{ ... }: +{ lib, ... }: let - directories = [ - "/opt/vaultwarden" - ]; domain = "crypt.tdback.net"; port = "11001"; + directory = "/opt/vaultwarden"; in { - systemd.tmpfiles.rules = map (x: "d ${x} 0755 share share - -") directories; + systemd.tmpfiles.rules = + map (x: "d ${x} 0755 share share - -") (lib.lists.singleton directory); + virtualisation.oci-containers.containers.vaultwarden = { image = "vaultwarden/server:latest"; autoStart = true; @@ -15,7 +15,7 @@ in "${port}:80" ]; volumes = [ - "/opt/vaultwarden/data:/data" + "${directory}/data:/data" ]; environment = { DOMAIN = domain; @@ -25,7 +25,7 @@ in }; }; - services.caddy.virtualHosts."${domain}".extraConfig = '' + services.caddy.virtualHosts.${domain}.extraConfig = '' encode zstd gzip reverse_proxy http://localhost:${port} { header_up X-Real-IP {remote_host}