Building a model where model parameter depends on independent data

Distributions do accept arrays as input, so your example should works.

A more formal way to do so is to model the covariates as coming from some distribution as well. You can have a look at this for an example: Motif of the Mind | Junpeng Lao, PhD