divnix / digga

A flake utility library to craft shell-, home-, and hosts- environments.
https://digga.divnix.com
MIT License
994 stars 108 forks source link

Odd error when trying nixpkgs-unstable #419

Closed water-sucks closed 2 years ago

water-sucks commented 2 years ago

I attempted to use the nixpkgs-unstable branch to get some fixes for my Neovim configuration from it. When I tried to rebuild using the nixpkgs-unstable branch as my nixpkgs input, I got a weird error saying this, and couldn't find any useful information when using --show-trace. I put it below for reference:

building the system configuration...
warning: Git tree '/home/varun/nixed' is dirty
warning: Using saved setting for 'extra-experimental-features = nix-command flakes' from ~/.local/share/nix/trusted-settings.json.
warning: Using saved setting for 'extra-substituters = https://nrdxp.cachix.org https://nix-community.cachix.org' from ~/.local/share/nix/trusted-settings.json.
warning: Using saved setting for 'extra-trusted-public-keys = nrdxp.cachix.org-1:Fc5PSqY2Jm1TrWfm88l6cvGWwz3s93c6IOifQWnhNW4= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=' from ~/.local/share/nix/trusted-settings.json.
trace: warning: The args argument to evalModules is deprecated. Please set config._module.args instead.
trace: warning: The check argument to evalModules is deprecated. Please set config._module.check instead.
error: anonymous function at /nix/store/j4pkvga6l60zd3hws11bf2ffaasfsx06-source/lib/types.nix:521:38 called with unexpected argument 'priority'

       at /nix/store/j4pkvga6l60zd3hws11bf2ffaasfsx06-source/lib/lists.nix:116:32:

          115|   */
          116|   imap1 = f: list: genList (n: f (n + 1) (elemAt list n)) (length list);
             |                                ^
          117|

       … while evaluating anonymous lambda

       at /nix/store/j4pkvga6l60zd3hws11bf2ffaasfsx06-source/lib/lists.nix:116:29:

          115|   */
          116|   imap1 = f: list: genList (n: f (n + 1) (elemAt list n)) (length list);
             |                             ^
          117|

       … from call site

       … while evaluating 'isFunction'

       at /nix/store/j4pkvga6l60zd3hws11bf2ffaasfsx06-source/lib/trivial.nix:403:16:

          402|   */
          403|   isFunction = f: builtins.isFunction f ||
             |                ^
          404|     (f ? __functor && isFunction (f.__functor f));

       … from call site

       at /nix/store/j4pkvga6l60zd3hws11bf2ffaasfsx06-source/lib/modules.nix:271:12:

          270|       loadModule = args: fallbackFile: fallbackKey: m:
          271|         if isFunction m || isAttrs m then
             |            ^
          272|           unifyModuleSyntax fallbackFile fallbackKey (applyIfFunction fallbackKey m args)

       … while evaluating 'loadModule'

       at /nix/store/j4pkvga6l60zd3hws11bf2ffaasfsx06-source/lib/modules.nix:270:53:

          269|       # Like unifyModuleSyntax, but also imports paths and calls functions if necessary
          270|       loadModule = args: fallbackFile: fallbackKey: m:
             |                                                     ^
          271|         if isFunction m || isAttrs m then

       … from call site

       at /nix/store/j4pkvga6l60zd3hws11bf2ffaasfsx06-source/lib/modules.nix:311:22:

          310|           let
          311|             module = loadModule args parentFile "${parentKey}:anon-${toString n}" x;
             |                      ^
          312|             collectedImports = collectStructuredModules module._file module.key module.imports args;

       … while evaluating anonymous lambda

       at /nix/store/j4pkvga6l60zd3hws11bf2ffaasfsx06-source/lib/modules.nix:328:31:

          327|           disabledKeys = map moduleKey disabled;
          328|           keyFilter = filter (attrs: ! elem attrs.key disabledKeys);
             |                               ^
          329|         in map (attrs: attrs.module) (builtins.genericClosure {

       … from call site

       … while evaluating 'filterModules'

       at /nix/store/j4pkvga6l60zd3hws11bf2ffaasfsx06-source/lib/modules.nix:324:36:

          323|       # modules recursively. It returns the final list of unique-by-key modules
          324|       filterModules = modulesPath: { disabled, modules }:
             |                                    ^
          325|         let

       … from call site

       at /nix/store/j4pkvga6l60zd3hws11bf2ffaasfsx06-source/lib/modules.nix:335:7:

          334|     in modulesPath: initialModules: args:
          335|       filterModules modulesPath (collectStructuredModules unknownModule "" initialModules args);
             |       ^
          336|

       … while evaluating anonymous lambda

       at /nix/store/j4pkvga6l60zd3hws11bf2ffaasfsx06-source/lib/modules.nix:334:37:

          333|
          334|     in modulesPath: initialModules: args:
             |                                     ^
          335|       filterModules modulesPath (collectStructuredModules unknownModule "" initialModules args);

       … from call site

       at /nix/store/j4pkvga6l60zd3hws11bf2ffaasfsx06-source/lib/modules.nix:180:25:

          179|       merged =
          180|         let collected = collectModules
             |                         ^
          181|           (specialArgs.modulesPath or "")

       … while evaluating 'reverseList'

       at /nix/store/j4pkvga6l60zd3hws11bf2ffaasfsx06-source/lib/lists.nix:393:17:

          392|   */
          393|   reverseList = xs:
             |                 ^
          394|     let l = length xs; in genList (n: elemAt xs (l - n - 1)) l;

       … from call site

       at /nix/store/j4pkvga6l60zd3hws11bf2ffaasfsx06-source/lib/modules.nix:184:33:

          183|           ({ inherit lib options config specialArgs; } // specialArgs);
          184|         in mergeModules prefix (reverseList collected);
             |                                 ^
          185|

       … while evaluating 'zipAttrsWithNames'

       at /nix/store/j4pkvga6l60zd3hws11bf2ffaasfsx06-source/lib/attrsets.nix:366:33:

          365|   */
          366|   zipAttrsWithNames = names: f: sets:
             |                                 ^
          367|     listToAttrs (map (name: {

       … from call site

       at /nix/store/j4pkvga6l60zd3hws11bf2ffaasfsx06-source/lib/attrsets.nix:382:40:

          381|   zipAttrsWith =
          382|     builtins.zipAttrsWith or (f: sets: zipAttrsWithNames (concatMap attrNames sets) f sets);
             |                                        ^
          383|   /* Like `zipAttrsWith' with `(name: values: values)' as the function.

       … while evaluating anonymous lambda

       at /nix/store/j4pkvga6l60zd3hws11bf2ffaasfsx06-source/lib/attrsets.nix:382:34:

          381|   zipAttrsWith =
          382|     builtins.zipAttrsWith or (f: sets: zipAttrsWithNames (concatMap attrNames sets) f sets);
             |                                  ^
          383|   /* Like `zipAttrsWith' with `(name: values: values)' as the function.

       … from call site

       at /nix/store/j4pkvga6l60zd3hws11bf2ffaasfsx06-source/lib/modules.nix:446:9:

          445|       byName = attr: f: modules:
          446|         zipAttrsWith (n: concatLists)
             |         ^
          447|           (map (module: let subtree = module.${attr}; in

       … while evaluating 'byName'

       at /nix/store/j4pkvga6l60zd3hws11bf2ffaasfsx06-source/lib/modules.nix:445:25:

          444|       */
          445|       byName = attr: f: modules:
             |                         ^
          446|         zipAttrsWith (n: concatLists)

       … from call site

       at /nix/store/j4pkvga6l60zd3hws11bf2ffaasfsx06-source/lib/modules.nix:462:21:

          461|       # an attrset 'name' => list of submodules that declare ‘name’.
          462|       declsByName = byName "options" (module: option:
             |                     ^
          463|           [{ inherit (module) _file; options = option; }]

       … while evaluating the attribute 'matchedOptions'

       at /nix/store/j4pkvga6l60zd3hws11bf2ffaasfsx06-source/lib/modules.nix:506:14:

          505|     in {
          506|       inherit matchedOptions;
             |              ^
          507|

       … while evaluating 'mapAttrsRecursiveCond'

       at /nix/store/j4pkvga6l60zd3hws11bf2ffaasfsx06-source/lib/attrsets.nix:296:36:

          295|   */
          296|   mapAttrsRecursiveCond = cond: f: set:
             |                                    ^
          297|     let

       … from call site

       at /nix/store/j4pkvga6l60zd3hws11bf2ffaasfsx06-source/lib/modules.nix:192:28:

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

       … while evaluating the attribute 'config'

       at /nix/store/j4pkvga6l60zd3hws11bf2ffaasfsx06-source/lib/modules.nix:257:9:

          256|         options = checked options;
          257|         config = checked (removeAttrs config [ "_module" ]);
             |         ^
          258|         _module = checked (config._module);

       … while evaluating 'merge'

       at /nix/store/j4pkvga6l60zd3hws11bf2ffaasfsx06-source/lib/types.nix:557:22:

          556|         check = x: isAttrs x || isFunction x || path.check x;
          557|         merge = loc: defs:
             |                      ^
          558|           (base.extendModules {

       … from call site

       at /nix/store/j4pkvga6l60zd3hws11bf2ffaasfsx06-source/lib/modules.nix:647:59:

          646|       if isDefined then
          647|         if all (def: type.check def.value) defsFinal then type.merge loc defsFinal
             |                                                           ^
          648|         else let allInvalid = filter (def: ! type.check def.value) defsFinal;

       … while evaluating the attribute 'mergedValue'

       at /nix/store/j4pkvga6l60zd3hws11bf2ffaasfsx06-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':

       … while evaluating the attribute 'value'

       at /nix/store/j4pkvga6l60zd3hws11bf2ffaasfsx06-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/j4pkvga6l60zd3hws11bf2ffaasfsx06-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/j4pkvga6l60zd3hws11bf2ffaasfsx06-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/j4pkvga6l60zd3hws11bf2ffaasfsx06-source/lib/attrsets.nix:301:19:

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

       … from call site

Any idea what's going on? I pinned to specific revisions of nixpkgs and used bisect to find where this was first happening, and it starts at revision ccb85a53b6a496984073227fd8c4d4c58889f421, and works before that. Any idea as to why this would happen?

tgunnoe commented 2 years ago

I also have this error now, after updating to the latest nixos-unstable