From e8e0f530791a71d8adf73b5db392b1bd5ceeb458 Mon Sep 17 00:00:00 2001 From: Vidhan Bhatt Date: Wed, 14 Jan 2026 17:35:15 -0500 Subject: [PATCH] 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. --- nixos/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/default.nix b/nixos/default.nix index a2535dc2..9d6dc7ce 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -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