I'd like to start organizing some of the nixos services into systemd slices.
According to the systemd.slice docs, A slice unit is a concept for hierarchically managing resources of a group of processes. There are quite a few modules that split up their services into several systemd units, which I think makes sense to collect into a slice.
Some of the benefits of creating such slices would be:
Easier for the user to configure resource limits for a system of services, e.g. nix hydra or prometheus with exporters.
Cleaner and more organized output of systemctl status, indenting slice contents in subtrees
Possibility to view interlaced logs from all units, using journalctl -u <slicename>.slice
Easily declare dependencies for all units (e.g. when all workers of a service depend on something like postgres)
As a side note, I also think most slices should be prefixed with system- if there's not a good reason not to. By default, service and scope units are placed in system.slice. This would be in contrast to something like how php-fpm is currently put in a top-level slice (planning to move this as part of this tracking issue).
TODO
[ ] services/backup/bacula.nix
[x] services/continuous-integration/hydra
[ ] services/desktops/cpupower-gui.nix
[ ] hardware/video/nvidia.nix
[ ] services/mail/sympa.nix
[ ] services/misc/gitlab.nix
[ ] services/misc/paperless.nix (#341278)
[ ] services/misc/sourcehut/default.nix
[ ] services/matrix/synapse.nix
[ ] services/monitoring/cockpit.nix
[ ] services/monitoring/graphite.nix
[ ] services/monitoring/prometheus and services/monitoring/prometheus/exporters
Issue description
I'd like to start organizing some of the nixos services into systemd slices.
According to the
systemd.slice
docs, A slice unit is a concept for hierarchically managing resources of a group of processes. There are quite a few modules that split up their services into several systemd units, which I think makes sense to collect into a slice.Some of the benefits of creating such slices would be:
systemctl status
, indenting slice contents in subtreesjournalctl -u <slicename>.slice
As a side note, I also think most slices should be prefixed with
system-
if there's not a good reason not to. By default, service and scope units are placed insystem.slice
. This would be in contrast to something like how php-fpm is currently put in a top-level slice (planning to move this as part of this tracking issue).TODO
services/backup/bacula.nix
services/continuous-integration/hydra
services/desktops/cpupower-gui.nix
hardware/video/nvidia.nix
services/mail/sympa.nix
services/misc/gitlab.nix
services/misc/paperless.nix
(#341278)services/misc/sourcehut/default.nix
services/matrix/synapse.nix
services/monitoring/cockpit.nix
services/monitoring/graphite.nix
services/monitoring/prometheus
andservices/monitoring/prometheus/exporters
services/monitoring/ups.nix
services/networking/jibri/default.nix
services/networking/nncp.nix
services/networking/softether.nix
services/networking/wireguard.nix
services/network-filesystems/moosefs.nix
services/network-filesystems/samba.nix
(#279917)services/security/clamav.nix
services/security/esdm.nix
services/security/kanidm.nix
services/security/shibboleth-sp.nix
services/system/cloud-init.nix
services/system/kerberos/heimdal.nix
services/web-servers/phpfpm
, prefix slice withsystem-
tasks/filesystems/zfs.nix
virtualisation/digital-ocean-config.nix
virtualisation/libvirtd.nix
virtualisation/parallels-guest.nix
virtualisation/vmware-host.nix