diff options
author | Alex Brandt <alunduil@gmail.com> | 2018-10-17 21:30:36 -0700 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2018-10-18 23:39:28 +0200 |
commit | 7575e119d68a415a4be62966acbd8970094d7b3e (patch) | |
tree | df81e809ce74db2405c7a552693065b134d5c7e0 | |
parent | 3b9b897af36c31ee67e848e6583598e5cb655b67 (diff) |
systemd: add more detail to user unit documentation
The current documentation does not provide guidance to users on how
systemd units are defined in Home Manager. A user may expect the
configuration to be similar to NixOS, when it actually differs.
Fixes #418
-rw-r--r-- | modules/systemd.nix | 54 |
1 files changed, 34 insertions, 20 deletions
diff --git a/modules/systemd.nix b/modules/systemd.nix index 74490691615..ed630b3618a 100644 --- a/modules/systemd.nix +++ b/modules/systemd.nix @@ -55,6 +55,30 @@ let merge = loc: foldl' (res: def: recursiveUpdate res def.value) {}; }; + unitDescription = type: '' + Definition of systemd per-user ${type} units. Attributes are + merged recursively. + </para><para> + Note that the attributes follow the capitalization and naming used + by systemd. More details can be found in + <citerefentry> + <refentrytitle>systemd.${type}</refentrytitle> + <manvolnum>5</manvolnum> + </citerefentry>. + ''; + + unitExample = type: literalExample '' + { + Unit = { + Description = "Example description"; + }; + + ${type} = { + … + }; + } + ''; + in { @@ -76,46 +100,36 @@ in services = mkOption { default = {}; type = attrsRecursivelyMerged; - description = '' - Definition of systemd per-user service units. Attributes are - merged recursively. - ''; + description = unitDescription "service"; + example = unitExample "Service"; }; sockets = mkOption { default = {}; type = attrsRecursivelyMerged; - description = '' - Definition of systemd per-user sockets. Attributes are - merged recursively. - ''; + description = unitDescription "socket"; + example = unitExample "Socket"; }; targets = mkOption { default = {}; type = attrsRecursivelyMerged; - description = '' - Definition of systemd per-user targets. Attributes are - merged recursively. - ''; + description = unitDescription "target"; + example = unitExample "Target"; }; timers = mkOption { default = {}; type = attrsRecursivelyMerged; - description = '' - Definition of systemd per-user timers. Attributes are merged - recursively. - ''; + description = unitDescription "timer"; + example = unitExample "Timer"; }; paths = mkOption { default = {}; type = attrsRecursivelyMerged; - description = '' - Definition of systemd per-user path units. Attributes are - merged recursively. - ''; + description = unitDescription "path"; + example = unitExample "Path"; }; startServices = mkOption { |