diff --git a/modules/systemd.nix b/modules/systemd.nix index 744906916..ed630b361 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. + + Note that the attributes follow the capitalization and naming used + by systemd. More details can be found in + + systemd.${type} + 5 + . + ''; + + 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 {