System.timers unable to set multiple "OnCalendar" fields

error: attribute 'OnCalendar' already defined during rebuild.

According to this link: “May be specified more than once, in which case the timer unit will trigger whenever any of the specified expressions elapse.”

Setting an attribute multiple times with the NixOS module requires using a list:

systemd.timers.something.OnCalendar = [

NixOS won’t let you write to a single-value attribute multiple times, because that’s ambiguous. So the systemd module needed to use lists to allow you to write multiple attributes, because systemd does permit that.

1 Like