Hacker News new | ask | show | jobs
by drunner 12 days ago
Have you been defining them directly in your flake.nix file? I too am on nixos but I keep all my configurations in their native format and symlink them with nix, that way I can take and reuse that config on a non nixos system easily.

The problem I have found is that nixos doesn't seem to pickup and run systemd timers and services placed into the ~/.config/systems/user folder and additionally things like WantedBy=default.target have no effect.

So after I restart all my services manually on reboot I agree, systems timers are cool.

1 comments

I define all units in Nix because:

a) It is way nicer and you get decent validation at build time

b) A LLM can port units over if the need arises; it’s a very light abstraction around systemd syntax

c) I personally don’t see how I would ever move to another distro :)

b) Or you could take the compiled units from /etc/systemd and copy them wherever
I believe that probably won’t work unfortunately; the generated unit files have a bunch of hardcoded Nix store paths.
Yes, but I believe there is a symlink from /etc to the Nix store, so systemd can find them.