cachix / feedback

Feedback about https://cachix.org service
2 stars 2 forks source link

Can I use a pre-spawned service with cachix-action ? #10

Closed 573 closed 4 years ago

573 commented 4 years ago

Hopefully this question is cachix-related, else I can move the question over where it belonged.

The problem I recently faced is that I need a service process, redis-server in this case, to be spawned prior running cachix-action on github-CI. To be more clear the process would be spawned outside the default.nix declarations i. e. in the actions.yml file, so not in a pure sense be part of the build. Now my nix-build on github's CI system just doesn't seem to find that service (a ping per redis-cli seems to succeed though).

Would I need the service to be included directly in my default.nix or else and be pre-spawned there (default.nix) as well when using cachix-action ?

Thanks for the excellent work of yours which I already use with great joy.

domenkozar commented 4 years ago

For some reason I missed this question completely.

Nix builds are isolated with filesystem and networking, so you'd need redis to run within your nix-build.

There are a couple of ways of doing that, but most simple is just to spawn redis withing your build.

573 commented 4 years ago

@domenkozar Thanks for the explanation, I'll close that as resolved than. https://github.com/573/shorturls/tree/redis-haskell-connectivity has an example of how to do that.