Packaging umami analytics when build requires postgres (prisma ORM)

I am trying to build a nixos service for umami analytics

This is a yarn package whose build instructions depend on setting DB credentials and running a migration, then generating runtime code from the schema

I can think of three strategies:

  1. Use a mutable directory and propagate build tools, use yarn tooling to download deps, running the final build in service start
  2. Run a build in a development environment and include the generated files as a patch
  3. Run an ‘ephemeral’ postgres during the build

I’m pursuing 3 right now, but wow it seems like a lot of work

I believe umami: init at 2.17.0; nixos/umami: init by diogotcorreia · Pull Request #380249 · NixOS/nixpkgs · GitHub has already done the work of packaging umami

2 Likes