How to write a universal module that can work on darwin (using nix-darwin) & NixOS

That’s correct, so I’m currently working on the Nix process management framework: GitHub - svanderburg/nix-processmgmt: Experimental Nix-based process management framework

The framework has a variety of purposes – one of them is targeting multiple process managers from the same declarative specification (e.g. sysvinit, systemd, launchd etc.) and it should work on other operating systems than Linux, including macOS and FreeBSD.

It also has some other objectives, such as the ability to construct multiple instances of the same proces configuration and a switch to disable user authentication so that an unprivileged Nix user can deploy services.

Although it is already somewhat usable, it is currently still an unfinished prototype. There are two more major features on the planning.

3 Likes