[Nix-dev] hotswappable self managing services in nix

Игорь Пашев pashev.igor at gmail.com
Mon Nov 28 18:18:43 CET 2016


2016-11-27 4:53 GMT+03:00 stewart mackenzie <setori88 at gmail.com>:
> Now say my service code is smart enough to do hot swapping of
> components al a Erlang style. Is it possible to tell nix not to
> restart the service but instead give the running executable a long
> string and let the executable be responsible for making changes to
> it's environment in a declarative manner?


Sure, why not. You start a dumb service which is unlikely to change.
This service read/watch some file or directory.

Then you have another service which put the file or directory in place.
This service restarts on each update and "notifies" the first service.

This approach works, for example, with mysql or postgres: updating
users or some dynamic options.


More information about the nix-dev mailing list