Nixos module service can't find 'typst'?

I’ve got a web server in rust that invokes the ‘typst’ executable to generate a pdf. Works in test, but when I run it as a nixos module typst is not found.

I’ve tried everything I can think of including putting typst into environment.systemPackages. My service runs as a systemuser normally, but I can make it isNormalUser and su into the account and run typst. But the web server still can’t kick off a typst process.

Is there something I’m missing about using package dependencies with a module?

sounds like you need systemd.services.foo.path

If I understand correctly, sounds like this one. Ifyou’re defining your own service, you need to refer to the binary via ${pkgs.typst}/bin/typst

In my systemd.services.<my-service> I added

  path = [ pkgs.typst ];

Then I was able to spawn a process using just “typst” as the executable name.