diff --git a/modules/openclaw.nix b/modules/openclaw.nix index 594bc0b..d143025 100644 --- a/modules/openclaw.nix +++ b/modules/openclaw.nix @@ -88,6 +88,8 @@ in "OPENCLAW_WORKSPACE_DIR=${workspaceDir}" ]; + EnvironmentFile = lib.mkIf (cfg.environmentFile != null) cfg.environmentFile; + ExecStartPre = [ "${pkgs.coreutils}/bin/mkdir -p ${configDir} ${dataDir} ${workspaceDir}" "${pkgs.coreutils}/bin/cp -n /etc/openclaw/openclaw.json ${configDir}/ || true" @@ -104,8 +106,6 @@ in ReadWritePaths = [ configDir dataDir workspaceDir ]; NoNewPrivileges = true; }; - } // lib.optionalAttrs (cfg.environmentFile != null) { - serviceConfig.EnvironmentFile = cfg.environmentFile; }; }; }