How to remove warnings about `fold` and `stdenv`

Recently, I started getting warnings on the nixos-rebuild switch:

evaluation warning: fold has been deprecated, use foldr instead evaluation warning: ‘system’ has been renamed to/replaced by ‘stdenv.hostPlatform.system’ evaluation warning: ‘system’ has been renamed to/replaced by ‘stdenv.hostPlatform.system’

Without seeing your config I can’t say exactly but you would need to replace the usage of fold with an equivalent usage of foldr (there’s a usage example here). I don’t know about the system one.

I don’t seem to use it at all in my configuration.

My config

Use the solution I posted above:

NIX_ABORT_ON_WARN=1 nixos-rebuild build --impure --show-trace

Then figure out who wrote that code and complain to them.

EDIT: to be clear don’t use --impure normally, this is just to make sure NIX_ABORT_ON_WARN is passed in.

3 Likes
building the system configuration...
error:
       … while evaluating the attribute 'config'
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:361:9:
          360|         options = checked options;
          361|         config = checked (removeAttrs config [ "_module" ]);
             |         ^
          362|         _module = checked (config._module);

       … while calling the 'seq' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:361:18:
          360|         options = checked options;
          361|         config = checked (removeAttrs config [ "_module" ]);
             |                  ^
          362|         _module = checked (config._module);

       … while evaluating a branch condition
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:297:9:
          296|       checkUnmatched =
          297|         if config._module.check && config._module.freeformType == null && merged.unmatchedDefns != [ ] then
             |         ^
          298|           let

       … in the left operand of the AND (&&) operator
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:297:72:
          296|       checkUnmatched =
          297|         if config._module.check && config._module.freeformType == null && merged.unmatchedDefns != [ ] then
             |                                                                        ^
          298|           let

       … in the left operand of the AND (&&) operator
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:297:33:
          296|       checkUnmatched =
          297|         if config._module.check && config._module.freeformType == null && merged.unmatchedDefns != [ ] then
             |                                 ^
          298|           let

       … while evaluating a branch condition
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:288:9:
          287|         in
          288|         if declaredConfig._module.freeformType == null then
             |         ^
          289|           declaredConfig

       … from call site
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:275:28:
          274|           # For definitions that have an associated option
          275|           declaredConfig = mapAttrsRecursiveCond (v: !isOption v) (_: v: v.value) options;
             |                            ^
          276|

       … while calling 'mapAttrsRecursiveCond'
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/attrsets.nix:1183:14:
         1182|   mapAttrsRecursiveCond =
         1183|     cond: f: set:
             |              ^
         1184|     let

       … while calling the 'mapAttrs' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/attrsets.nix:1192:5:
         1191|     in
         1192|     recurse [ ] set;
             |     ^
         1193|

       … while evaluating the attribute 'matchedOptions'
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:891:15:
          890|     {
          891|       inherit matchedOptions;
             |               ^
          892|

       … while calling the 'mapAttrs' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:881:24:
          880|
          881|       matchedOptions = mapAttrs (n: v: v.matchedOptions) resultsByName;
             |                        ^
          882|

       … while calling the 'mapAttrs' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:829:23:
          828|
          829|       resultsByName = mapAttrs (
             |                       ^
          830|         name: decls:

       … while calling the 'zipAttrsWith' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:745:21:
          744|       # an attrset 'name' => list of submodules that declare ‘name’.
          745|       declsByName = zipAttrsWith (n: v: v) (
             |                     ^
          746|         map (

       … while calling the 'map' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:746:9:
          745|       declsByName = zipAttrsWith (n: v: v) (
          746|         map (
             |         ^
          747|           module:

       … from call site
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:267:37:
          266|
          267|       merged = mergeModules prefix (reverseList (doCollect { }).modules);
             |                                     ^
          268|

       … while calling 'reverseList'
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/lists.nix:1105:5:
         1104|   reverseList =
         1105|     xs:
             |     ^
         1106|     let

       … while calling the 'genList' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/lists.nix:1109:5:
         1108|     in
         1109|     genList (n: elemAt xs (l - n - 1)) l;
             |     ^
         1110|

       … while evaluating the second argument passed to builtins.genList

       … while calling the 'length' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/lists.nix:1107:11:
         1106|     let
         1107|       l = length xs;
             |           ^
         1108|     in

       … while evaluating the attribute 'modules'
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:550:7:
          549|     modulesPath: initialModules: args: {
          550|       modules = filterModules modulesPath (collectStructuredModules unknownModule "" initialModules args);
             |       ^
          551|       graph = toGraph modulesPath (collectStructuredModules unknownModule "" initialModules args);

       … from call site
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:550:17:
          549|     modulesPath: initialModules: args: {
          550|       modules = filterModules modulesPath (collectStructuredModules unknownModule "" initialModules args);
             |                 ^
          551|       graph = toGraph modulesPath (collectStructuredModules unknownModule "" initialModules args);

       … while calling 'filterModules'
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:525:9:
          524|         modulesPath:
          525|         { disabled, modules }:
             |         ^
          526|         let

       … while calling the 'map' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:529:9:
          528|         in
          529|         map (attrs: attrs.module) (genericClosure {
             |         ^
          530|           startSet = keyFilter modules;

       … while calling the 'genericClosure' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:529:36:
          528|         in
          529|         map (attrs: attrs.module) (genericClosure {
             |                                    ^
          530|           startSet = keyFilter modules;

       … while calling the 'filter' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:530:22:
          529|         map (attrs: attrs.module) (genericClosure {
          530|           startSet = keyFilter modules;
             |                      ^
          531|           operator = attrs: keyFilter attrs.modules;

       … while calling anonymous lambda
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:527:31:
          526|         let
          527|           keyFilter = filter (attrs: !isDisabled modulesPath disabled attrs);
             |                               ^
          528|         in

       … in the argument of the not operator
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:527:39:
          526|         let
          527|           keyFilter = filter (attrs: !isDisabled modulesPath disabled attrs);
             |                                       ^
          528|         in

       … from call site
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:527:39:
          526|         let
          527|           keyFilter = filter (attrs: !isDisabled modulesPath disabled attrs);
             |                                       ^
          528|         in

       … while calling anonymous lambda
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:456:9:
          455|         in
          456|         structuredModule: elem structuredModule.key disabledKeys;
             |         ^
          457|

       … while calling the 'elem' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:456:27:
          455|         in
          456|         structuredModule: elem structuredModule.key disabledKeys;
             |                           ^
          457|

       … while calling the 'concatMap' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:454:26:
          453|
          454|           disabledKeys = concatMap ({ file, disabled }: map (moduleKey file) disabled) disabledList;
             |                          ^
          455|         in

       … while calling the 'concatLists' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:486:24:
          485|           collectResults = modules: {
          486|             disabled = concatLists (catAttrs "disabled" modules);
             |                        ^
          487|             inherit modules;

       … while evaluating the attribute 'disabled'
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:486:13:
          485|           collectResults = modules: {
          486|             disabled = concatLists (catAttrs "disabled" modules);
             |             ^
          487|             inherit modules;

       … while calling the 'concatLists' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:486:24:
          485|           collectResults = modules: {
          486|             disabled = concatLists (catAttrs "disabled" modules);
             |                        ^
          487|             inherit modules;

       … while evaluating a branch condition
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:504:19:
          503|                 (
          504|                   if module.disabledModules != [ ] then
             |                   ^
          505|                     [

       … from call site
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:495:24:
          494|             let
          495|               module = checkModule (loadModule args parentFile "${parentKey}:anon-${toString n}" x);
             |                        ^
          496|               collectedImports = collectStructuredModules module._file module.key module.imports args;

       … while calling anonymous lambda
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:414:11:
          413|         if class != null then
          414|           m:
             |           ^
          415|           if m._class == null || m._class == class then

       … while evaluating a branch condition
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:415:11:
          414|           m:
          415|           if m._class == null || m._class == class then
             |           ^
          416|             m

       … in the left operand of the OR (||) operator
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:415:31:
          414|           m:
          415|           if m._class == null || m._class == class then
             |                               ^
          416|             m

       … from call site
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:495:37:
          494|             let
          495|               module = checkModule (loadModule args parentFile "${parentKey}:anon-${toString n}" x);
             |                                     ^
          496|               collectedImports = collectStructuredModules module._file module.key module.imports args;

       … while calling 'loadModule'
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:379:42:
          378|       loadModule =
          379|         args: fallbackFile: fallbackKey: m:
             |                                          ^
          380|         if isFunction m then

       … while evaluating a branch condition
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:380:9:
          379|         args: fallbackFile: fallbackKey: m:
          380|         if isFunction m then
             |         ^
          381|           unifyModuleSyntax fallbackFile fallbackKey (applyModuleArgs fallbackKey m args)

       … from call site
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:380:12:
          379|         args: fallbackFile: fallbackKey: m:
          380|         if isFunction m then
             |            ^
          381|           unifyModuleSyntax fallbackFile fallbackKey (applyModuleArgs fallbackKey m args)

       … while calling 'isFunction'
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/trivial.nix:1057:16:
         1056|   */
         1057|   isFunction = f: builtins.isFunction f || (f ? __functor && isFunction (f.__functor f));
             |                ^
         1058|

       … in the left operand of the OR (||) operator
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/trivial.nix:1057:41:
         1056|   */
         1057|   isFunction = f: builtins.isFunction f || (f ? __functor && isFunction (f.__functor f));
             |                                         ^
         1058|

       … while calling the 'isFunction' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/trivial.nix:1057:19:
         1056|   */
         1057|   isFunction = f: builtins.isFunction f || (f ? __functor && isFunction (f.__functor f));
             |                   ^
         1058|

       … while calling the 'elemAt' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/lists.nix:347:43:
          346|   */
          347|   imap1 = f: list: genList (n: f (n + 1) (elemAt list n)) (length list);
             |                                           ^
          348|

       … from call site
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/nixos/default.nix:2:19:
            1| {
            2|   configuration ? import ./lib/from-env.nix "NIXOS_CONFIG" <nixos-config>,
             |                   ^
            3|   system ? builtins.currentSystem,

       … while calling anonymous lambda
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/nixos/lib/from-env.nix:2:7:
            1| # TODO: remove this file. There is lib.maybeEnv now
            2| name: default:
             |       ^
            3| let

       … while calling the 'findFile' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/nixos/default.nix:2:60:
            1| {
            2|   configuration ? import ./lib/from-env.nix "NIXOS_CONFIG" <nixos-config>,
             |                                                            ^
            3|   system ? builtins.currentSystem,

       error: file 'nixos-config' was not found in the Nix search path (add it using $NIX_PATH or -I)
Command 'nix-build '<nixpkgs/nixos>' --attr config.system.build.toplevel --show-trace' returned non-zero exit status 1.

Well you should pass in any additional flags that you normally use, like --flake or -I or whatnot.

building the system configuration...
evaluation warning: fold has been deprecated, use foldr instead
error:
       … while calling the 'seq' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:361:18:
          360|         options = checked options;
          361|         config = checked (removeAttrs config [ "_module" ]);
             |                  ^
          362|         _module = checked (config._module);

       … while evaluating a branch condition
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:297:9:
          296|       checkUnmatched =
          297|         if config._module.check && config._module.freeformType == null && merged.unmatchedDefns != [ ] then
             |         ^
          298|           let

       … in the left operand of the AND (&&) operator
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:297:72:
          296|       checkUnmatched =
          297|         if config._module.check && config._module.freeformType == null && merged.unmatchedDefns != [ ] then
             |                                                                        ^
          298|           let

       … in the left operand of the AND (&&) operator
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:297:33:
          296|       checkUnmatched =
          297|         if config._module.check && config._module.freeformType == null && merged.unmatchedDefns != [ ] then
             |                                 ^
          298|           let

       … while evaluating a branch condition
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:288:9:
          287|         in
          288|         if declaredConfig._module.freeformType == null then
             |         ^
          289|           declaredConfig

       … from call site
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:275:28:
          274|           # For definitions that have an associated option
          275|           declaredConfig = mapAttrsRecursiveCond (v: !isOption v) (_: v: v.value) options;
             |                            ^
          276|

       … while calling 'mapAttrsRecursiveCond'
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/attrsets.nix:1183:14:
         1182|   mapAttrsRecursiveCond =
         1183|     cond: f: set:
             |              ^
         1184|     let

       … while calling the 'mapAttrs' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/attrsets.nix:1192:5:
         1191|     in
         1192|     recurse [ ] set;
             |     ^
         1193|

       … while evaluating the attribute 'matchedOptions'
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:891:15:
          890|     {
          891|       inherit matchedOptions;
             |               ^
          892|

       … while calling the 'mapAttrs' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:881:24:
          880|
          881|       matchedOptions = mapAttrs (n: v: v.matchedOptions) resultsByName;
             |                        ^
          882|

       … while calling the 'mapAttrs' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:829:23:
          828|
          829|       resultsByName = mapAttrs (
             |                       ^
          830|         name: decls:

       … while calling the 'zipAttrsWith' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:745:21:
          744|       # an attrset 'name' => list of submodules that declare ‘name’.
          745|       declsByName = zipAttrsWith (n: v: v) (
             |                     ^
          746|         map (

       … while calling the 'map' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:746:9:
          745|       declsByName = zipAttrsWith (n: v: v) (
          746|         map (
             |         ^
          747|           module:

       … from call site
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:267:37:
          266|
          267|       merged = mergeModules prefix (reverseList (doCollect { }).modules);
             |                                     ^
          268|

       … while calling 'reverseList'
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/lists.nix:1105:5:
         1104|   reverseList =
         1105|     xs:
             |     ^
         1106|     let

       … while calling the 'genList' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/lists.nix:1109:5:
         1108|     in
         1109|     genList (n: elemAt xs (l - n - 1)) l;
             |     ^
         1110|

       … while evaluating the second argument passed to builtins.genList

       … while calling the 'length' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/lists.nix:1107:11:
         1106|     let
         1107|       l = length xs;
             |           ^
         1108|     in

       … while evaluating the attribute 'modules'
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:550:7:
          549|     modulesPath: initialModules: args: {
          550|       modules = filterModules modulesPath (collectStructuredModules unknownModule "" initialModules args);
             |       ^
          551|       graph = toGraph modulesPath (collectStructuredModules unknownModule "" initialModules args);

       … from call site
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:550:17:
          549|     modulesPath: initialModules: args: {
          550|       modules = filterModules modulesPath (collectStructuredModules unknownModule "" initialModules args);
             |                 ^
          551|       graph = toGraph modulesPath (collectStructuredModules unknownModule "" initialModules args);

       … while calling 'filterModules'
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:525:9:
          524|         modulesPath:
          525|         { disabled, modules }:
             |         ^
          526|         let

       … while calling the 'map' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:529:9:
          528|         in
          529|         map (attrs: attrs.module) (genericClosure {
             |         ^
          530|           startSet = keyFilter modules;

       … while calling the 'genericClosure' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:529:36:
          528|         in
          529|         map (attrs: attrs.module) (genericClosure {
             |                                    ^
          530|           startSet = keyFilter modules;

       … while calling the 'filter' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:530:22:
          529|         map (attrs: attrs.module) (genericClosure {
          530|           startSet = keyFilter modules;
             |                      ^
          531|           operator = attrs: keyFilter attrs.modules;

       … while calling anonymous lambda
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:527:31:
          526|         let
          527|           keyFilter = filter (attrs: !isDisabled modulesPath disabled attrs);
             |                               ^
          528|         in

       … in the argument of the not operator
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:527:39:
          526|         let
          527|           keyFilter = filter (attrs: !isDisabled modulesPath disabled attrs);
             |                                       ^
          528|         in

       … from call site
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:527:39:
          526|         let
          527|           keyFilter = filter (attrs: !isDisabled modulesPath disabled attrs);
             |                                       ^
          528|         in

       … while calling anonymous lambda
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:456:9:
          455|         in
          456|         structuredModule: elem structuredModule.key disabledKeys;
             |         ^
          457|

       … while calling the 'elem' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:456:27:
          455|         in
          456|         structuredModule: elem structuredModule.key disabledKeys;
             |                           ^
          457|

       … while calling the 'concatMap' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:454:26:
          453|
          454|           disabledKeys = concatMap ({ file, disabled }: map (moduleKey file) disabled) disabledList;
             |                          ^
          455|         in

       … while calling the 'concatLists' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:486:24:
          485|           collectResults = modules: {
          486|             disabled = concatLists (catAttrs "disabled" modules);
             |                        ^
          487|             inherit modules;

       … while evaluating the attribute 'disabled'
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:486:13:
          485|           collectResults = modules: {
          486|             disabled = concatLists (catAttrs "disabled" modules);
             |             ^
          487|             inherit modules;

       … while calling the 'concatLists' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:486:24:
          485|           collectResults = modules: {
          486|             disabled = concatLists (catAttrs "disabled" modules);
             |                        ^
          487|             inherit modules;

       … while evaluating a branch condition
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:504:19:
          503|                 (
          504|                   if module.disabledModules != [ ] then
             |                   ^
          505|                     [

       … from call site
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:495:24:
          494|             let
          495|               module = checkModule (loadModule args parentFile "${parentKey}:anon-${toString n}" x);
             |                        ^
          496|               collectedImports = collectStructuredModules module._file module.key module.imports args;

       … while calling anonymous lambda
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:414:11:
          413|         if class != null then
          414|           m:
             |           ^
          415|           if m._class == null || m._class == class then

       … while evaluating a branch condition
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:415:11:
          414|           m:
          415|           if m._class == null || m._class == class then
             |           ^
          416|             m

       … in the left operand of the OR (||) operator
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:415:31:
          414|           m:
          415|           if m._class == null || m._class == class then
             |                               ^
          416|             m

       … from call site
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:495:37:
          494|             let
          495|               module = checkModule (loadModule args parentFile "${parentKey}:anon-${toString n}" x);
             |                                     ^
          496|               collectedImports = collectStructuredModules module._file module.key module.imports args;

       … while calling 'loadModule'
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:379:42:
          378|       loadModule =
          379|         args: fallbackFile: fallbackKey: m:
             |                                          ^
          380|         if isFunction m then

       … while evaluating a branch condition
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:380:9:
          379|         args: fallbackFile: fallbackKey: m:
          380|         if isFunction m then
             |         ^
          381|           unifyModuleSyntax fallbackFile fallbackKey (applyModuleArgs fallbackKey m args)

       … from call site
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/modules.nix:380:12:
          379|         args: fallbackFile: fallbackKey: m:
          380|         if isFunction m then
             |            ^
          381|           unifyModuleSyntax fallbackFile fallbackKey (applyModuleArgs fallbackKey m args)

       … while calling 'isFunction'
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/trivial.nix:1057:16:
         1056|   */
         1057|   isFunction = f: builtins.isFunction f || (f ? __functor && isFunction (f.__functor f));
             |                ^
         1058|

       … in the left operand of the OR (||) operator
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/trivial.nix:1057:41:
         1056|   */
         1057|   isFunction = f: builtins.isFunction f || (f ? __functor && isFunction (f.__functor f));
             |                                         ^
         1058|

       … while calling the 'isFunction' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/trivial.nix:1057:19:
         1056|   */
         1057|   isFunction = f: builtins.isFunction f || (f ? __functor && isFunction (f.__functor f));
             |                   ^
         1058|

       … while calling the 'elemAt' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/lists.nix:347:43:
          346|   */
          347|   imap1 = f: list: genList (n: f (n + 1) (elemAt list n)) (length list);
             |                                           ^
          348|

       … from call site
         at /nix/store/2pkandqdph6ys5yw8i9gx8xbxaklgr3k-source/flake.nix:41:11:
           40|           catppuccin.nixosModules.catppuccin
           41|           solaar.nixosModules.default
             |           ^
           42|         ];

       … while calling anonymous lambda
         at «flakes-internal»/call-flake.nix:68:37:
           67|
           68|       inputs = mapAttrs (inputName: inputSpec: allNodes.${resolveInput inputSpec}.result) (
             |                                     ^
           69|         node.inputs or { }

       … while evaluating the attribute 'solaar.result'
         at «flakes-internal»/call-flake.nix:94:7:
           93|     {
           94|       result =
             |       ^
           95|         if node.flake or true then

       … in the left operand of the update (//) operator
         at «flakes-internal»/call-flake.nix:81:9:
           80|         # This is shadowed in the next //
           81|         // sourceInfo
             |         ^
           82|         // {

       … from call site
         at «flakes-internal»/call-flake.nix:72:17:
           71|
           72|       outputs = flake.outputs (inputs // { self = result; });
             |                 ^
           73|

       … while calling 'outputs'
         at /nix/store/y0lbisalmbcmmg3ahviciyncxnljvdx5-source/flake.nix:18:13:
           17|
           18|   outputs = inputs:
             |             ^
           19|     let

       … from call site
         at /nix/store/y0lbisalmbcmmg3ahviciyncxnljvdx5-source/flake.nix:20:13:
           19|     let
           20|       lib = inputs.snowfall-lib.mkLib {
             |             ^
           21|         inherit inputs;

       … while calling anonymous lambda
         at /nix/store/vxk2rhymymyi6mrnsjgh3zvflvr1cpr5-source/snowfall-lib/default.nix:5:14:
            4| # another extended library for its own applications.
            5| core-inputs: user-options: let
             |              ^
            6|   raw-snowfall-config = user-options.snowfall or {};

       … while evaluating the attribute 'fold'
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/default.nix:252:9:
          251|         foldr
          252|         fold
             |         ^
          253|         foldl

       … while evaluating the attribute 'fold'
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/lists.nix:152:3:
          151|   */
          152|   fold = warn "fold has been deprecated, use foldr instead" foldr;
             |   ^
          153|

       … while calling the 'warn' builtin
         at /nix/store/cd6v80pj9h7r2prxx9a71y92zq88p1xx-source/lib/lists.nix:152:10:
          151|   */
          152|   fold = warn "fold has been deprecated, use foldr instead" foldr;
             |          ^
          153|

       error: aborting to reveal stack trace of warning, as abort-on-warn is set
Command 'nix --extra-experimental-features 'nix-command flakes' build --print-out-paths 'NixOS/#nixosConfigurations."nixos".config.system.build.toplevel' --show-trace --impure' returned non-zero exit status 1.

Looks like the culprit is snowfall-lib.

But honestly you really don’t need to use these extraneous inputs like snowfall, flakes are not really difficult to write.

1 Like

They aren’t using it; a dependency of theirs is.

Sorry OP, not much you personally can do about this, and Nix’s warnings story isn’t sophisticated enough to keep messages that don’t apply to your code out of your logs.

1 Like