From 0a3b3a9dee8fbec28fa441f4b7008b24531c2d0c Mon Sep 17 00:00:00 2001 From: Lukas Wurzinger Date: Wed, 13 Aug 2025 19:51:57 +0000 Subject: [PATCH] nixos/users-groups: fix assertion --- nixos/modules/config/users-groups.nix | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/nixos/modules/config/users-groups.nix b/nixos/modules/config/users-groups.nix index 0399962418ad..941012b659d8 100644 --- a/nixos/modules/config/users-groups.nix +++ b/nixos/modules/config/users-groups.nix @@ -1083,14 +1083,19 @@ in -> !cfg.allowNoPasswordLogin -> any id ( mapAttrsToList ( - name: cfg: - (name == "root" || cfg.group == "wheel" || elem "wheel" cfg.extraGroups) + name: user: + ( + name == "root" + || user.group == "wheel" + || elem "wheel" user.extraGroups + || elem name (cfg.groups.wheel.members or [ ]) + ) && ( - allowsLogin cfg.hashedPassword - || cfg.password != null - || cfg.hashedPasswordFile != null - || cfg.openssh.authorizedKeys.keys != [ ] - || cfg.openssh.authorizedKeys.keyFiles != [ ] + allowsLogin user.hashedPassword + || user.password != null + || user.hashedPasswordFile != null + || user.openssh.authorizedKeys.keys != [ ] + || user.openssh.authorizedKeys.keyFiles != [ ] ) ) cfg.users ++ [