1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
{ }: { serviceWithTimer = name: { Unit, Service, Timer, Install, ... }@config: { services.${name} = { inherit (config) Unit Service; }; timers.${name} = { inherit (config) Unit Install; Timer = config.Timer // { Unit = "${name}.service"; }; }; }; }