nixos: flip && to prevent recursion errors

The recent change to add the ability to use systemd units for users made it so configs with home-manager.users dependent on config.users.users failed with recursion errors. Simply flipping the &&s so it avoids running the check if the feature is disabled fixes this.
This commit is contained in:
Vidhan Bhatt 2026-01-14 17:35:15 -05:00 committed by GitHub
parent 57e99ed4a1
commit e8e0f53079
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -89,7 +89,7 @@ in
};
}
(mkIf (cfg.users != { } && !cfg.startAsUserService) {
(mkIf (!cfg.startAsUserService && cfg.users != { }) {
systemd.services = lib.mapAttrs' (
_: usercfg:
let
@ -140,7 +140,7 @@ in
) cfg.users;
})
(mkIf (cfg.users != { } && cfg.startAsUserService) {
(mkIf (cfg.startAsUserService && cfg.users != { }) {
systemd.user.services.home-manager = baseUnit "%u" // {
# this _should_ depend on nix-daemon.socket, as the system-service
# version of this unit does, but systemd doesn't allow user units