wrapperManagerLib.systemd
A fork of the NixOS systemd library from nixpkgs suited for wrapper-manager’s needs. The major reason it is forked instead of using it directly is because a lot of the functions is centered around NixOS' need (unsurprisingly) and it would require a LOT of adjusting otherwise so why not just fork it directly.
Unlike NixOS' version, wrapper-manager only cares about generating them unit
files so it won’t have additional options such as restartTriggers
and the
like. Thus, we have dropped several module options such as
systemd.units.<name>.enable
and systemd.units.<name>.overrideStrategy
.
Furthermore, we have added support for generating drop-in unit files by
"$UNITNAME/$OVERRIDE_NAME" where it should map to
$out/etc/systemd/$TYPEDIR/$UNITNAME.$UNITTYPE.d/$OVERRIDE_NAME.conf
.
It is meant to be composed alongside other packages of other environments
(e.g., systemd.packages
from NixOS) after all and several environment
implementation are already taking care of installing them properly such as
NixOS and home-manager.
wrapperManagerLib.systemd.intoUnit
Convert the given non-generic unit options into the generic units version.
For example, it converts programs.systemd.system.services.hello
suitable
for programs.systemd.system.units.hello
where it will be included in the
derivation.
For third-party module authors, it is recommended to set
programs.systemd.{system,user}.units
with this function.
wrapperManagerLib.systemd.generateUnits
Builder function for generating a set of systemd units expected to be from
programs.systemd.$VARIANT.units
.
wrapperManagerLib.systemd.splitUnitFilename
Given a string, split the unit name into the unit name and its drop-in, if there’s one.