Go to file
Emery Hemingway 8c504a5f0d Add Synit overrides to depend on network milestone 2023-11-25 19:22:02 +02:00
example-deployments Propagate the correct variant of the Nix process management framework as a parameter 2021-04-23 22:26:13 +02:00
service-containers-agnostic Add container service for the simple PostgreSQL variant 2023-09-22 00:13:47 +02:00
services-agnostic Add Synit overrides to depend on network milestone 2023-11-25 19:22:02 +02:00
tests - Add missing name parameter to the test function 2023-09-20 18:36:47 +02:00
LICENSE Document the use cases of this services repository 2021-02-18 21:27:11 +01:00
README.md Add reverse proxy service with basic authentication 2021-03-05 22:11:09 +01:00
release.nix Propagate the correct variant of the Nix process management framework as a parameter 2021-04-23 22:26:13 +02:00

README.md

Nix-based process management framework service repository

This repository contains a collection of services that can be deployed with the experimental Nix process management framework.

You can deploy systems that are constructed from running process instances managed by a process manager of choice, use them as an unprivileged user, and run multiple process instances on the same machine.

Constructor functions

Process instances that are deployed by the Nix process management framework are typically constructed from constructor functions:

  • services-agnostic/ folder contains constructor functions for all kinds of commonly used services.
  • service-containers-agnostic/ extends a subset of the constructor functions with Dysnomia container configuration files so that these services can become containers (deployment targets) for Disnix deployments.

Example deployments

The example-deployments/ folder contains deployment specifications for example systems that consist of multiple processes:

  • services: demonstrates how to deploy many kinds of commonly used services: MySQL, PostgreSQL, Nginx, the Apache HTTP server, svnserve, Docker etc.
  • hydra: demonstrates how to deploy Hydra: the Nix-based continuous integration system
  • disnix demonstrates how to deploy Disnix including container provider services and the DisnixWebService providing remote deployment support via a web service.

Deploying the example systems

The above examples can be deployed by running any of the nixproc-*-switch tools provided by the Nix process management framework. Each process manager backend has its own implementation.

For example, to deploy the system as sysvinit scripts, use:

$ nixproc-sysvinit-switch processes.nix

The above command needs to be run as root user, so that unprivileged users can be created for each service.

To deploy a system as an unprivileged user, use:

$ nixproc-sysvinit-switch --state-dir $HOME/var --force-disable-user-change processes.nix

The above command-line parameters have the following purposes:

  • The --state-dir parameter changes the global state directory to the var folder in the user's home directory.
  • --force-disable-user-change disables all user operations (e.g. creating users, changing ownership), which an unprivileged user typically is not allowed to do.

To do a stateless deployment of the system with supervisord as an unprivileged user, use:

$ nixproc-supervisord-deploy-stateless --state-dir $HOME/var --force-disable-user-change processes.nix

The above command activates the system as a whole and keeps supervisord running in the foreground. Terminating supervisord causes the entire system to get deactivated.

License

The contents of this package is available under the same license as Nixpkgs -- the MIT license.