I think I can just set
systemd.package = myAwesomeSystemd, the commit adding it indicates it’s there to make it ‘cheaper to test a new systemd’.
Thanks, that’s a good suggestion, and one that I didn’t give enough thought to, it is however not entirely entirely straightforward as there is no
This systemd ticket also has some useful information.
Looking through those tickets, the best solution might be to adopt the method used by TLP:
The next question is how to abort sleep (for example if an
rmmod is unsuccesful – else my laptop won’t wake from sleep). I think the exit code from scripts in
lib/systemd/system-sleep is able to do this… otherwise I’m not sure, perhaps I’d need to look at
Ultimately though, the idea of placing “local use only” scripts in
/usr/lib/systemd/system-sleep is a bit daft, and is perhaps more problematic on NixOS then elsewhere.
We could patch
systemd.pc.in? If you trace it through, the only place that
systemdsleepdir is used is here. Patching
systemd.pc.in is not without precedent as
NixOS/systemd has a patched
systemd.pc.in for similar reasons.
We could then add suitable options to the systemd module to allow setting your own sleep scripts.