From 01219383bbbd258c588f1e1b47e316bbbb36418a Mon Sep 17 00:00:00 2001 From: arcnmx Date: Wed, 3 Apr 2024 13:38:43 -0700 Subject: [PATCH] chore(grocy): shared data --- nixos/grocy.nix | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/nixos/grocy.nix b/nixos/grocy.nix index 473c67c8..1f8246e9 100644 --- a/nixos/grocy.nix +++ b/nixos/grocy.nix @@ -1,8 +1,5 @@ {config, lib, ...}: let inherit (lib.modules) mkIf mkDefault mkAfter; - inherit (lib.strings) escapeRegex; - inherit (config.services) nginx; - inherit (config) networking; cfg = config.services.grocy; in { config = { @@ -70,5 +67,21 @@ in { users.users.grocy = mkIf cfg.enable { uid = 911; }; + systemd.services = let + BindPaths = [ + "/mnt/shared/grocy:${cfg.dataDir}" + ]; + in mkIf cfg.enable { + grocy-setup = { + serviceConfig = { + inherit BindPaths; + }; + }; + phpfpm-grocy = { + serviceConfig = { + inherit BindPaths; + }; + }; + }; }; }