From 979ead7d355f0eec011f9a5f0a4a24fa02fc49f8 Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Mon, 24 Mar 2025 16:12:26 -0400 Subject: [PATCH] update to barcodebuddy --- modules/users/overseer/services/grocy.nix | 68 +++++++++++++---------- 1 file changed, 40 insertions(+), 28 deletions(-) diff --git a/modules/users/overseer/services/grocy.nix b/modules/users/overseer/services/grocy.nix index e47c5cc..2c615e1 100644 --- a/modules/users/overseer/services/grocy.nix +++ b/modules/users/overseer/services/grocy.nix @@ -1,31 +1,43 @@ -{ - lib, - config, - ... -}: -lib.mkIf config.user.overseer.enable { - services.nginx.virtualHosts = { - "grocy.wanderingcrow.net" = { - forceSSL = true; - useACMEHost = "grocy.wanderingcrow.net"; - }; - "barcodebuddy.grocy.wanderingcrow.net" = { - forceSSL = true; - useACMEHost = "barcodebuddy.grocy.wanderingcrow.net"; - locations."/" = { - proxyPass = "http://10.88.0.11:80"; +let + volumePath = "/overseer/services"; +in + { + lib, + config, + ... + }: + lib.mkIf config.user.overseer.enable { + systemd.tmpfiles.rules = [ + "d ${volumePath}/barcodebuddy" + ]; + + services.nginx.virtualHosts = { + "grocy.wanderingcrow.net" = { + forceSSL = true; + useACMEHost = "grocy.wanderingcrow.net"; + }; + "barcodebuddy.grocy.wanderingcrow.net" = { + forceSSL = true; + useACMEHost = "barcodebuddy.grocy.wanderingcrow.net"; + locations."/" = { + proxyPass = "http://10.88.0.11:80"; + proxyWebsockets = true; + }; + }; }; - }; - }; - services.grocy = { - enable = true; - hostName = "grocy.wanderingcrow.net"; - nginx.enableSSL = false; - }; + services.grocy = { + enable = true; + hostName = "grocy.wanderingcrow.net"; + nginx.enableSSL = false; + }; - virtualisation.oci-containers.containers.barcodebuddy = { - image = "f0rc3/barcodebuddy:latest"; - extraOptions = ["--ip=10.88.0.11"]; - }; -} + virtualisation.oci-containers.containers.barcodebuddy = { + image = "f0rc3/barcodebuddy:latest"; + volumes = ["${volumePath}/barcodebuddy:/config"]; + extraOptions = ["--ip=10.88.0.11"]; + environment = { + ATTACH_BARCODESCANNER = "true"; + }; + }; + }