I’m currently evaluating several services for my home-cloud setup. So I’m entering new NixOS grounds, as so far I’ve only used it for Desktops.
I just realized that several services, though not running as my user, only run after I login to KDE Plasma. They don’t stop when I log out. But I’d rather have it such that my gf just has to hit the power button when I’m not home, and everything comes up.
So I wonder if there are config options for nextcloud and syncthing in particular, or “services” in general, to make them start before anybody logs in to the graphical user interface. I would have expected this to be the default (who expects a cloud service to wait for some “random” login?!), but apparently, it’s not so. Why?
Are you not using the nixos options for those services? A nixos module generally will add wantedBy = ["multi-user.target"];, like syncthing does here. And more importantly, it does not make sense that they would start later, like after you log in; there’s nothing that would start it at all other than something like wantedBy = ["multi-user.target"];
My experience is that, no, nextcloud and syncthing does not start at boot. The do if I add the multi-user.target. Unless something freakish got into my way
You’re right. It seems it’s flaky. I’ve removed my extra config, and right now it works after boot without login. Before, even with my changes, it wasn’t working. Even ssh wasn’t there. I’ll monitor this
Holy crap. The services are stopped when I close the laptop lid. Or firewall comes up. Not sure. Anyway, that happens without the device going to sleep