Currently, CUPS always starts up when configured and the machine powers up. After a while a number of the various daemons will auto-exit due to inactivity, but we don’t actually have to start them in the first place. We can simply use systemd’s support for socket activation and only start things if you’re trying to print something. Of course, when advertising things on the local network, it may get a little trickier (I need to see if we can just advertise it via avahi and then still only start the services when something tries to connect to it), but the case of advertising printers is most likely for when you’re running a print server, in which case you’re probably fine having everything run all the time.
This issue is still current, at least on my machine with nixos-version = 23.11.20230603.9dd2595 (Tapir) and judging by this conversation, possibly because the logic to actually update the JobHistoryUpdate variable called by cupsdCleanJobs is never satisfied. This bug may already have been fixed upstream, but until the fix is received, rather than disable avahi, I’ve found that one solution is to simply restart cups.service. Thereafter, my log will periodically contain the “Expiring subscriptions…” message, but no longer at a 1 Hz frequency .