Stream: services-flake

Topic: custom local service


view this post on Zulip Bruno Bigras (May 24 2024 at 16:42):

Is there a simple way to run a service by only adding something to my flake.nix file without having to upstream it? I guess I'm interested in both knowing how to import a service file that uses the same format as upstream and a way to set up a service with just a command (like nats-server --js.

view this post on Zulip Shivaraj B H (May 25 2024 at 06:06):

Yes, there is. See the pgweb service here: https://github.com/juspay/services-flake/blob/5ffae902f78b8f31416e5667ab95c40ee7a5ebef/example/simple/flake.nix#L42-L61

view this post on Zulip Shivaraj B H (May 25 2024 at 06:10):

And here’s an example of a service that doesn’t exist upstream but is only specific to the project: https://github.com/nammayatri/nammayatri/blob/main/Backend/nix/services/postgres-with-replica.nix

And one more example: https://github.com/nammayatri/passetto/blob/nixify/process-compose.nix. This service is imported in nammayatri: https://github.com/nammayatri/nammayatri/blob/e8032f1fac3581b9062e2469dfc778d2913d3665/Backend/nix/services/nammayatri.nix#L32

and it is configured like: https://github.com/nammayatri/nammayatri/blob/e8032f1fac3581b9062e2469dfc778d2913d3665/Backend/nix/services/nammayatri.nix#L285-L297


Last updated: Oct 12 2024 at 21:16 UTC