Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inscrutable error after "nixos/users:added users.allowLoginless" #158279

Closed
SFrijters opened this issue Feb 5, 2022 · 0 comments · Fixed by #158281
Closed

Inscrutable error after "nixos/users:added users.allowLoginless" #158279

SFrijters opened this issue Feb 5, 2022 · 0 comments · Fixed by #158281

Comments

@SFrijters
Copy link
Member

Describe the bug

After updating my system configuration flake I'm getting the rather inscrutable error:

building the system configuration...
error: value is a Boolean while a list was expected

       at /nix/store/r0pb0c28n595b9vx4g0pjy8vqv5430r0-source/nixos/modules/config/users-groups.nix:628:11:

          627|         assertion = !cfg.mutableUsers -> !cfg.allowNoPasswordLogin ->
          628|           any id (mapAttrsToList (name: cfg:
             |           ^
          629|             (name == "root"
(use '--show-trace' to show detailed location information)

This seems to stem from #73106 and I don't understand what it wants me to change / make into a list.

My user conf:

  users = {
    mutableUsers = false;
    users = {
      frijters = {
        createHome = true;
        group = "users";
        extraGroups = [ "wheel" "video" "audio" "disk" ];
        home = "/home/frijters";
        isNormalUser = true;
        uid = 1000;
        description = "Stefan Frijters";
        hashedPassword = "<redacted>";
      };

      root = {
        hashedPassword = "<redacted>";
      };
    };
  };

Steps To Reproduce

Steps to reproduce the behavior:

Use a version of nixpkgs that includes #73106 and have the described user config.

Expected behavior

Either my current configuration should be accepted or the error message should tell me what to fix.

Additional context

Full trace:

building the system configuration...
error: value is a Boolean while a list was expected

       at /nix/store/r0pb0c28n595b9vx4g0pjy8vqv5430r0-source/nixos/modules/config/users-groups.nix:628:11:

          627|         assertion = !cfg.mutableUsers -> !cfg.allowNoPasswordLogin ->
          628|           any id (mapAttrsToList (name: cfg:
             |           ^
          629|             (name == "root"

       … while evaluating the attribute 'assertion'

       at /nix/store/r0pb0c28n595b9vx4g0pjy8vqv5430r0-source/nixos/modules/config/users-groups.nix:627:9:

          626|         # The check does not apply when users.mutableUsers
          627|         assertion = !cfg.mutableUsers -> !cfg.allowNoPasswordLogin ->
             |         ^
          628|           any id (mapAttrsToList (name: cfg:

       … while evaluating anonymous lambda

       at /nix/store/r0pb0c28n595b9vx4g0pjy8vqv5430r0-source/nixos/modules/system/activation/top-level.nix:125:50:

          124|
          125|   failedAssertions = map (x: x.message) (filter (x: !x.assertion) config.assertions);
             |                                                  ^
          126|

       … from call site

       … while evaluating 'fold''

       at /nix/store/r0pb0c28n595b9vx4g0pjy8vqv5430r0-source/lib/lists.nix:55:15:

           54|       len = length list;
           55|       fold' = n:
             |               ^
           56|         if n == len

       … from call site

       at /nix/store/r0pb0c28n595b9vx4g0pjy8vqv5430r0-source/lib/lists.nix:59:8:

           58|         else op (elemAt list n) (fold' (n + 1));
           59|     in fold' 0;
             |        ^
           60|

       … while evaluating 'foldr'

       at /nix/store/r0pb0c28n595b9vx4g0pjy8vqv5430r0-source/lib/lists.nix:52:20:

           51|   */
           52|   foldr = op: nul: list:
             |                    ^
           53|     let

       … from call site

       at /nix/store/r0pb0c28n595b9vx4g0pjy8vqv5430r0-source/nixos/modules/system/activation/top-level.nix:132:12:

          131|   # Replace runtime dependencies
          132|   system = foldr ({ oldDependency, newDependency }: drv:
             |            ^
          133|       pkgs.replaceDependency { inherit oldDependency newDependency drv; }

       … while evaluating the attribute 'value'

       at /nix/store/r0pb0c28n595b9vx4g0pjy8vqv5430r0-source/lib/modules.nix:471:44:

          470|       defnsByName' = byName "config" (module: value:
          471|           [{ inherit (module) file; inherit value; }]
             |                                            ^
          472|         ) configs;

       … while evaluating 'dischargeProperties'

       at /nix/store/r0pb0c28n595b9vx4g0pjy8vqv5430r0-source/lib/modules.nix:697:25:

          696|   */
          697|   dischargeProperties = def:
             |                         ^
          698|     if def._type or "" == "merge" then

       … from call site

       at /nix/store/r0pb0c28n595b9vx4g0pjy8vqv5430r0-source/lib/modules.nix:626:137:

          625|         defs' = concatMap (m:
          626|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
             |                                                                                                                                         ^
          627|         ) defs;

       … while evaluating definitions from `/nix/store/r0pb0c28n595b9vx4g0pjy8vqv5430r0-source/nixos/modules/system/activation/top-level.nix':

       … while evaluating anonymous lambda

       at /nix/store/r0pb0c28n595b9vx4g0pjy8vqv5430r0-source/lib/modules.nix:625:28:

          624|         # Process mkMerge and mkIf properties.
          625|         defs' = concatMap (m:
             |                            ^
          626|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … from call site

       at /nix/store/r0pb0c28n595b9vx4g0pjy8vqv5430r0-source/lib/modules.nix:625:17:

          624|         # Process mkMerge and mkIf properties.
          625|         defs' = concatMap (m:
             |                 ^
          626|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … while evaluating the attribute 'values'

       at /nix/store/r0pb0c28n595b9vx4g0pjy8vqv5430r0-source/lib/modules.nix:738:7:

          737|     in {
          738|       values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
             |       ^
          739|       inherit highestPrio;

       … while evaluating the attribute 'values'

       at /nix/store/r0pb0c28n595b9vx4g0pjy8vqv5430r0-source/lib/modules.nix:639:9:

          638|       in {
          639|         values = defs''';
             |         ^
          640|         inherit (defs'') highestPrio;

       … while evaluating the attribute 'mergedValue'

       at /nix/store/r0pb0c28n595b9vx4g0pjy8vqv5430r0-source/lib/modules.nix:645:5:

          644|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
          645|     mergedValue =
             |     ^
          646|       if isDefined then

       … while evaluating the option `system.build.toplevel':

       … while evaluating the attribute 'value'

       at /nix/store/r0pb0c28n595b9vx4g0pjy8vqv5430r0-source/lib/modules.nix:611:9:

          610|     in warnDeprecation opt //
          611|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          612|         inherit (res.defsFinal') highestPrio;

       … while evaluating anonymous lambda

       at /nix/store/r0pb0c28n595b9vx4g0pjy8vqv5430r0-source/lib/modules.nix:192:72:

          191|           # For definitions that have an associated option
          192|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                                                                        ^
          193|

       … from call site

       at /nix/store/r0pb0c28n595b9vx4g0pjy8vqv5430r0-source/lib/attrsets.nix:304:20:

          303|               then recurse (path ++ [name]) value
          304|               else f (path ++ [name]) value;
             |                    ^
          305|         in mapAttrs g;

       … while evaluating 'g'

       at /nix/store/r0pb0c28n595b9vx4g0pjy8vqv5430r0-source/lib/attrsets.nix:301:19:

          300|           g =
          301|             name: value:
             |                   ^
          302|             if isAttrs value && cond value

       … from call site

       … while evaluating anonymous lambda

       at /nix/store/r0pb0c28n595b9vx4g0pjy8vqv5430r0-source/lib/attrsets.nix:421:24:

          420|     let f = attrPath:
          421|       zipAttrsWith (n: values:
             |                        ^
          422|         let here = attrPath ++ [n]; in

       … from call site

Notify maintainers

@pasqui23 @roberth

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.16.5, NixOS, 22.05 (Quokka)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.7.0pre20220127_558c4ee`
 - channels(frijters): `""`
 - channels(root): `"nixos, nixos-unstable-20.09pre225264.683c68232e9"`
 - nixpkgs: `/etc/nixpkgs`
roberth added a commit to roberth/nixpkgs that referenced this issue Feb 5, 2022
Fixes what seems to be a programming error that went undetected by
me and @pasqui23

See NixOS#158279
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant