Programs.nix-ld.libraries expects set instead of list?

Tried updating via flake yesterday on the unstable branch my packages.

  programs.nix-ld = {
    enable = true;
  };
  programs.nix-ld.libraries = (pkgs.steam-run.fhsenv.args.multiPkgs pkgs) ++ [
    pkgs.zlib
    pkgs.libgcc
  ];

This raised the following error when applying the updated configuration

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

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

       … while evaluating the option `system.systemBuilderArgs':

       … while evaluating definitions from `/nix/store/0sxsfzswhjck7f4sbsvznz285s4i7y64-source/nixos/modules/system/activation/activatable-system.nix':

       … while evaluating the option `system.activationScripts.etc.text':

       … while evaluating definitions from `/nix/store/0sxsfzswhjck7f4sbsvznz285s4i7y64-source/nixos/modules/system/etc/etc-activation.nix':

       … while evaluating definitions from `/nix/store/0sxsfzswhjck7f4sbsvznz285s4i7y64-source/nixos/modules/system/etc/etc.nix':

       … while evaluating the option `environment.etc.dbus-1.source':

       … while evaluating the option `programs.nix-ld.libraries':

       … while evaluating definitions from `/nix/store/wy0gaandd2b6x8a0rvcna683vjk9dwz6-source/common/nix-ld.nix':

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: expected a set but found a list: [ "-e" «thunk» ]
error: Recipe `flake-rebuild` failed on line 12 with exit code 1

This caused the weird error

error: expected a set but found a list: [ "-e" «thunk» ]

while on the options page it clearly indicates that the libraries being set should be a list
see NixOS Search

So what is going on here? Why is the list produced not accepted anymore?
Note:
The above is also raised when using only pkgs.steam-run.fhsenv.args.multiPkgs pkgs

1 Like

Additional parts with trace

 … while evaluating the attribute 'value'
         at /nix/store/0sxsfzswhjck7f4sbsvznz285s4i7y64-source/lib/modules.nix:816:9:
          815|     in warnDeprecation opt //
          816|       { value = addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          817|         inherit (res.defsFinal') highestPrio;

       … while evaluating the option `programs.nix-ld.libraries':

       (10 duplicate frames omitted)

       … while evaluating definitions from `/nix/store/z78f2xxhanp1cknbcvjan5cr8y3lbfl3-source/common/nix-ld.nix':

       … from call site
         at /nix/store/0sxsfzswhjck7f4sbsvznz285s4i7y64-source/lib/modules.nix:832:128:
          831|         defs' = concatMap (m:
          832|           map (value: { inherit (m) file; inherit value; }) (addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
             |                                                                                                                                ^
          833|         ) defs;

       … while calling 'dischargeProperties'
         at /nix/store/0sxsfzswhjck7f4sbsvznz285s4i7y64-source/lib/modules.nix:903:25:
          902|   */
          903|   dischargeProperties = def:
             |                         ^
          904|     if def._type or "" == "merge" then

       … while evaluating a branch condition
         at /nix/store/0sxsfzswhjck7f4sbsvznz285s4i7y64-source/lib/modules.nix:904:5:
          903|   dischargeProperties = def:
          904|     if def._type or "" == "merge" then
             |     ^
          905|       concatMap dischargeProperties def.contents

       … while evaluating the attribute 'value'
         at /nix/store/0sxsfzswhjck7f4sbsvznz285s4i7y64-source/lib/modules.nix:614:53:
          613|                 (n: value:
          614|                   [{ inherit (module) file; inherit value; }]
             |                                                     ^
          615|                 )

       … while evaluating the attribute 'steam-run.fhsenv.args.multiPkgs'
         at /nix/store/0sxsfzswhjck7f4sbsvznz285s4i7y64-source/pkgs/stdenv/generic/make-derivation.nix:364:7:
          363|       builder = attrs.realBuilder or stdenv.shell;
          364|       args = attrs.args or ["-e" (attrs.builder or ./default-builder.sh)];
             |       ^
          365|       inherit stdenv;

       … while selecting an attribute
         at /nix/store/z78f2xxhanp1cknbcvjan5cr8y3lbfl3-source/common/nix-ld.nix:6:32:
            5|   };
            6|   programs.nix-ld.libraries = (pkgs.steam-run.fhsenv.args.multiPkgs pkgs) ++ [
             |                                ^
            7|     pkgs.zlib

       error: expected a set but found a list: [ "-e" «thunk» ]

The error’s saying pkgs.steam-run.fhsenv.args is a list, but you’re using it like a set by trying to access the multiPkgs attribute under it. I’ve never heard of this attr, where did you copy it from?

EDIT: and more importantly, what is the actual problem you’re trying to solve, as this screams X-Y?

had the same problem fixed it by using pkgs.steam-run.args.multiPkgs pkgs; instead of pkgs.steam-run.fhsenv.args.multiPkgs pkgs;

1 Like