Skip to content

Instantly share code, notes, and snippets.

@ajhalili2006
Created November 6, 2025 13:27
Show Gist options
  • Select an option

  • Save ajhalili2006/66660fb705a73d6361a2dbb693b4508e to your computer and use it in GitHub Desktop.

Select an option

Save ajhalili2006/66660fb705a73d6361a2dbb693b4508e to your computer and use it in GitHub Desktop.
GitHub Copilot chat archive: Zen Browser on NixOS configs + recursion headaches

Copilot Chat Archive (using Gemini 2.5 Pro)

Link to original chat for @ajhalili2006: https://github.com/copilot/c/df45f6a9-5e82-444d-b2fc-b1cac00c0e44 (see conversation_context.md also)

User Turn 1

Got it but I got some headaches with recursion lately:

error:
       … while calling anonymous lambda
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/attrsets.nix:1691:14:
         1690|         zipAttrsWith (
         1691|           n: values:
             |              ^
         1692|           let

       … while calling the 'head' builtin
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/attrsets.nix:1696:13:
         1695|           if length values == 1 || pred here (elemAt values 1) (head values) then
         1696|             head values
             |             ^
         1697|           else

       … while calling anonymous lambda
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/attrsets.nix:1188:17:
         1187|         mapAttrs (
         1188|           name: value:
             |                 ^
         1189|           if isAttrs value && cond value then recurse (path ++ [ name ]) value else f (path ++ [ name ]) value

       … from call site
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/attrsets.nix:1189:85:
         1188|           name: value:
         1189|           if isAttrs value && cond value then recurse (path ++ [ name ]) value else f (path ++ [ name ]) value
             |                                                                                     ^
         1190|         );

       … while calling anonymous lambda
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:275:71:
          274|           # For definitions that have an associated option
          275|           declaredConfig = mapAttrsRecursiveCond (v: !isOption v) (_: v: v.value) options;
             |                                                                       ^
          276|

       … while evaluating the attribute 'value'
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:1118:7:
         1117|     // {
         1118|       value = addErrorContext "while evaluating the option `${showOption loc}':" value;
             |       ^
         1119|       inherit (res.defsFinal') highestPrio;

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

       … while evaluating the attribute 'mergedValue'
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:1189:5:
         1188|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
         1189|     mergedValue =
             |     ^
         1190|       if isDefined then

       … while evaluating a branch condition
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:1190:7:
         1189|     mergedValue =
         1190|       if isDefined then
             |       ^
         1191|         if type.merge ? v2 then

       … while evaluating the attribute 'values'
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:1183:9:
         1182|       {
         1183|         values = defsSorted;
             |         ^
         1184|         inherit (defsFiltered) highestPrio;

       … while evaluating a branch condition
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:1177:11:
         1176|           # Avoid sorting if we don't have to.
         1177|           if any (def: def.value._type or "" == "order") defsFiltered.values then
             |           ^
         1178|             sortProperties defsFiltered.values

       … while calling the 'any' builtin
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:1177:14:
         1176|           # Avoid sorting if we don't have to.
         1177|           if any (def: def.value._type or "" == "order") defsFiltered.values then
             |              ^
         1178|             sortProperties defsFiltered.values

       … while evaluating the attribute 'values'
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:1357:7:
         1356|     {
         1357|       values = concatMap (def: if getPrio def == highestPrio then [ (strip def) ] else [ ]) defs;
             |       ^
         1358|       inherit highestPrio;

       … while calling the 'concatMap' builtin
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:1357:16:
         1356|     {
         1357|       values = concatMap (def: if getPrio def == highestPrio then [ (strip def) ] else [ ]) defs;
             |                ^
         1358|       inherit highestPrio;

       … while calling the 'concatMap' builtin
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:1157:26:
         1156|         # Process mkMerge and mkIf properties.
         1157|         defsNormalized = concatMap (
             |                          ^
         1158|           m:

       … while calling anonymous lambda
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:1158:11:
         1157|         defsNormalized = concatMap (
         1158|           m:
             |           ^
         1159|           map (

       … while calling the 'map' builtin
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:1159:11:
         1158|           m:
         1159|           map (
             |           ^
         1160|             value:

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

       … from call site
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:1168:80:
         1167|               }
         1168|           ) (addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
             |                                                                                ^
         1169|         ) defs;

       … while calling 'dischargeProperties'
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:1308:5:
         1307|   dischargeProperties =
         1308|     def:
             |     ^
         1309|     if def._type or "" == "merge" then

       … while evaluating a branch condition
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:1309:5:
         1308|     def:
         1309|     if def._type or "" == "merge" then
             |     ^
         1310|       concatMap dischargeProperties def.contents

       … while evaluating the attribute 'value'
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:805:21:
          804|             inherit (module) file;
          805|             inherit value;
             |                     ^
          806|           }) module.config

       … from call site
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/nixos/modules/system/activation/top-level.nix:83:26:
           82|   # Handle assertions and warnings
           83|   baseSystemAssertWarn = lib.asserts.checkAssertWarn config.assertions config.warnings baseSystem;
             |                          ^
           84|

       … while calling 'checkAssertWarn'
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/asserts.nix:193:27:
          192|   checkAssertWarn =
          193|     assertions: warnings: val:
             |                           ^
          194|     let

       … while evaluating a branch condition
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/asserts.nix:197:5:
          196|     in
          197|     if failedAssertions != [ ] then
             |     ^
          198|       throw "\nFailed assertions:\n${concatStringsSep "\n" (map (x: "- ${x}") failedAssertions)}"

       … while calling the 'map' builtin
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/asserts.nix:195:26:
          194|     let
          195|       failedAssertions = map (x: x.message) (filter (x: !x.assertion) assertions);
             |                          ^
          196|     in

       … while calling the 'filter' builtin
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/asserts.nix:195:46:
          194|     let
          195|       failedAssertions = map (x: x.message) (filter (x: !x.assertion) assertions);
             |                                              ^
          196|     in

       … from call site
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/nixos/modules/system/activation/top-level.nix:83:54:
           82|   # Handle assertions and warnings
           83|   baseSystemAssertWarn = lib.asserts.checkAssertWarn config.assertions config.warnings baseSystem;
             |                                                      ^
           84|

       … while calling anonymous lambda
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/attrsets.nix:1188:17:
         1187|         mapAttrs (
         1188|           name: value:
             |                 ^
         1189|           if isAttrs value && cond value then recurse (path ++ [ name ]) value else f (path ++ [ name ]) value

       … from call site
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/attrsets.nix:1189:85:
         1188|           name: value:
         1189|           if isAttrs value && cond value then recurse (path ++ [ name ]) value else f (path ++ [ name ]) value
             |                                                                                     ^
         1190|         );

       … while calling anonymous lambda
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:275:71:
          274|           # For definitions that have an associated option
          275|           declaredConfig = mapAttrsRecursiveCond (v: !isOption v) (_: v: v.value) options;
             |                                                                       ^
          276|

       … while evaluating the attribute 'value'
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:1118:7:
         1117|     // {
         1118|       value = addErrorContext "while evaluating the option `${showOption loc}':" value;
             |       ^
         1119|       inherit (res.defsFinal') highestPrio;

       … while evaluating the option `assertions':

       (10 duplicate frames omitted)

       … while evaluating definitions from `/nix/store/553sq15q5p4qraxx0vny8if77f0fykic-source/nixos/common.nix':

       … from call site
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:1168:80:
         1167|               }
         1168|           ) (addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
             |                                                                                ^
         1169|         ) defs;

       … while calling 'dischargeProperties'
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:1308:5:
         1307|   dischargeProperties =
         1308|     def:
             |     ^
         1309|     if def._type or "" == "merge" then

       … from call site
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:1313:31:
         1312|       if isBool def.condition then
         1313|         if def.condition then dischargeProperties def.content else [ ]
             |                               ^
         1314|       else

       … while calling 'dischargeProperties'
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:1308:5:
         1307|   dischargeProperties =
         1308|     def:
             |     ^
         1309|     if def._type or "" == "merge" then

       … while evaluating a branch condition
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:1309:5:
         1308|     def:
         1309|     if def._type or "" == "merge" then
             |     ^
         1310|       concatMap dischargeProperties def.contents

       … while evaluating the attribute 'content'
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:1468:23:
         1467|     _type = "if";
         1468|     inherit condition content;
             |                       ^
         1469|   };

       … from call site
         at «github:nix-community/home-manager/af119fe»/nixos/common.nix:166:22:
          165|
          166|         assertions = lib.flatten (
             |                      ^
          167|           flip lib.mapAttrsToList cfg.users (

       … while calling 'flatten'
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/lists.nix:437:13:
          436|   */
          437|   flatten = x: if isList x then concatMap (y: flatten y) x else [ x ];
             |             ^
          438|

       … while calling the 'concatMap' builtin
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/lists.nix:437:33:
          436|   */
          437|   flatten = x: if isList x then concatMap (y: flatten y) x else [ x ];
             |                                 ^
          438|

       … while calling anonymous lambda
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/lists.nix:437:44:
          436|   */
          437|   flatten = x: if isList x then concatMap (y: flatten y) x else [ x ];
             |                                            ^
          438|

       … from call site
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/lists.nix:437:47:
          436|   */
          437|   flatten = x: if isList x then concatMap (y: flatten y) x else [ x ];
             |                                               ^
          438|

       … while calling 'flatten'
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/lists.nix:437:13:
          436|   */
          437|   flatten = x: if isList x then concatMap (y: flatten y) x else [ x ];
             |             ^
          438|

       … while evaluating a branch condition
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/lists.nix:437:16:
          436|   */
          437|   flatten = x: if isList x then concatMap (y: flatten y) x else [ x ];
             |                ^
          438|

       … while calling the 'isList' builtin
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/lists.nix:437:19:
          436|   */
          437|   flatten = x: if isList x then concatMap (y: flatten y) x else [ x ];
             |                   ^
          438|

       … while calling anonymous lambda
         at «github:nix-community/home-manager/af119fe»/nixos/common.nix:168:19:
          167|           flip lib.mapAttrsToList cfg.users (
          168|             user: config:
             |                   ^
          169|             flip map config.assertions (assertion: {

       … from call site
         at «github:nix-community/home-manager/af119fe»/nixos/common.nix:169:13:
          168|             user: config:
          169|             flip map config.assertions (assertion: {
             |             ^
          170|               inherit (assertion) assertion;

       … while calling 'flip'
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/trivial.nix:326:11:
          325|   flip =
          326|     f: a: b:
             |           ^
          327|     f b a;

       … while calling the 'map' builtin
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/trivial.nix:327:5:
          326|     f: a: b:
          327|     f b a;
             |     ^
          328|

       … from call site
         at «github:nix-community/home-manager/af119fe»/nixos/common.nix:169:22:
          168|             user: config:
          169|             flip map config.assertions (assertion: {
             |                      ^
          170|               inherit (assertion) assertion;

       … while calling anonymous lambda
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/types.nix:860:22:
          859|                 value = mapAttrs (
          860|                   n: v:
             |                      ^
          861|                   if lazy then

       … while evaluating the attribute 'optionalValue.value'
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:1253:41:
         1252|
         1253|     optionalValue = if isDefined then { value = mergedValue; } else { };
             |                                         ^
         1254|   };

       … while evaluating the attribute 'value'
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/types.nix:1288:17:
         1287|                 headError = checkDefsForError check loc defs;
         1288|                 value = configuration.config;
             |                 ^
         1289|                 valueMeta = { inherit configuration; };

       … while evaluating the attribute 'config'
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/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 «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/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 «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/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 «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/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 «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/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 «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:288:9:
          287|         in
          288|         if declaredConfig._module.freeformType == null then
             |         ^
          289|           declaredConfig

       … from call site
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/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 «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/attrsets.nix:1183:14:
         1182|   mapAttrsRecursiveCond =
         1183|     cond: f: set:
             |              ^
         1184|     let

       … while calling the 'mapAttrs' builtin
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/attrsets.nix:1192:5:
         1191|     in
         1192|     recurse [ ] set;
             |     ^
         1193|

       … while evaluating the attribute 'matchedOptions'
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:891:15:
          890|     {
          891|       inherit matchedOptions;
             |               ^
          892|

       … while calling the 'mapAttrs' builtin
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:881:24:
          880|
          881|       matchedOptions = mapAttrs (n: v: v.matchedOptions) resultsByName;
             |                        ^
          882|

       … while calling the 'mapAttrs' builtin
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:829:23:
          828|
          829|       resultsByName = mapAttrs (
             |                       ^
          830|         name: decls:

       … while calling the 'zipAttrsWith' builtin
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/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 «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:746:9:
          745|       declsByName = zipAttrsWith (n: v: v) (
          746|         map (
             |         ^
          747|           module:

       … from call site
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:267:37:
          266|
          267|       merged = mergeModules prefix (reverseList (doCollect { }).modules);
             |                                     ^
          268|

       … while calling 'reverseList'
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/lists.nix:1103:5:
         1102|   reverseList =
         1103|     xs:
             |     ^
         1104|     let

       … while calling the 'genList' builtin
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/lists.nix:1107:5:
         1106|     in
         1107|     genList (n: elemAt xs (l - n - 1)) l;
             |     ^
         1108|

       … while evaluating the second argument passed to builtins.genList

       … while calling the 'length' builtin
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/lists.nix:1105:11:
         1104|     let
         1105|       l = length xs;
             |           ^
         1106|     in

       … while evaluating the attribute 'modules'
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/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 «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/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 «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:525:9:
          524|         modulesPath:
          525|         { disabled, modules }:
             |         ^
          526|         let

       … while calling the 'map' builtin
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:529:9:
          528|         in
          529|         map (attrs: attrs.module) (genericClosure {
             |         ^
          530|           startSet = keyFilter modules;

       … while calling the 'genericClosure' builtin
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:529:36:
          528|         in
          529|         map (attrs: attrs.module) (genericClosure {
             |                                    ^
          530|           startSet = keyFilter modules;

       … while calling the 'filter' builtin
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/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 «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/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 «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:527:39:
          526|         let
          527|           keyFilter = filter (attrs: !isDisabled modulesPath disabled attrs);
             |                                       ^
          528|         in

       … from call site
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:527:39:
          526|         let
          527|           keyFilter = filter (attrs: !isDisabled modulesPath disabled attrs);
             |                                       ^
          528|         in

       … while calling anonymous lambda
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:456:9:
          455|         in
          456|         structuredModule: elem structuredModule.key disabledKeys;
             |         ^
          457|

       … while calling the 'elem' builtin
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:456:27:
          455|         in
          456|         structuredModule: elem structuredModule.key disabledKeys;
             |                           ^
          457|

       … while calling the 'concatMap' builtin
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:454:26:
          453|
          454|           disabledKeys = concatMap ({ file, disabled }: map (moduleKey file) disabled) disabledList;
             |                          ^
          455|         in

       … while calling the 'concatLists' builtin
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:486:24:
          485|           collectResults = modules: {
          486|             disabled = concatLists (catAttrs "disabled" modules);
             |                        ^
          487|             inherit modules;

       … while evaluating the attribute 'disabled'
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:486:13:
          485|           collectResults = modules: {
          486|             disabled = concatLists (catAttrs "disabled" modules);
             |             ^
          487|             inherit modules;

       … while calling the 'concatLists' builtin
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:486:24:
          485|           collectResults = modules: {
          486|             disabled = concatLists (catAttrs "disabled" modules);
             |                        ^
          487|             inherit modules;

       … while evaluating the attribute 'disabled'
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:486:13:
          485|           collectResults = modules: {
          486|             disabled = concatLists (catAttrs "disabled" modules);
             |             ^
          487|             inherit modules;

       … while calling the 'concatLists' builtin
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:486:24:
          485|           collectResults = modules: {
          486|             disabled = concatLists (catAttrs "disabled" modules);
             |                        ^
          487|             inherit modules;

       … while evaluating the attribute 'disabled'
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:486:13:
          485|           collectResults = modules: {
          486|             disabled = concatLists (catAttrs "disabled" modules);
             |             ^
          487|             inherit modules;

       … while calling the 'concatLists' builtin
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:486:24:
          485|           collectResults = modules: {
          486|             disabled = concatLists (catAttrs "disabled" modules);
             |                        ^
          487|             inherit modules;

       … while evaluating a branch condition
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:504:19:
          503|                 (
          504|                   if module.disabledModules != [ ] then
             |                   ^
          505|                     [

       … from call site
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/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 «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/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 «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/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 «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:415:31:
          414|           m:
          415|           if m._class == null || m._class == class then
             |                               ^
          416|             m

       … from call site
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/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 «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:379:42:
          378|       loadModule =
          379|         args: fallbackFile: fallbackKey: m:
             |                                          ^
          380|         if isFunction m then

       … while evaluating a branch condition
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/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 «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/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 «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/trivial.nix:1043:16:
         1042|   */
         1043|   isFunction = f: builtins.isFunction f || (f ? __functor && isFunction (f.__functor f));
             |                ^
         1044|

       … in the left operand of the OR (||) operator
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/trivial.nix:1043:41:
         1042|   */
         1043|   isFunction = f: builtins.isFunction f || (f ? __functor && isFunction (f.__functor f));
             |                                         ^
         1044|

       … while calling the 'isFunction' builtin
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/trivial.nix:1043:19:
         1042|   */
         1043|   isFunction = f: builtins.isFunction f || (f ? __functor && isFunction (f.__functor f));
             |                   ^
         1044|

       … while calling the 'elemAt' builtin
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/lists.nix:345:43:
          344|   */
          345|   imap1 = f: list: genList (n: f (n + 1) (elemAt list n)) (length list);
             |                                           ^
          346|

       … from call site
         at /workspaces/ajhalili2006/nixops-config/shared/home-manager/main.nix:21:5:
           20|     ./fonts.nix
           21|     zen-browser.homeModules.beta #iykyk
             |     ^
           22|   ];

       … while calling anonymous lambda
         at «https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.888688%2Brev-7241bcbb4f099a66aafca120d37c65e8dda32717/019a4d5f-1342-7012-9c08-5af5fe8439c0/source.tar.gz»/lib/modules.nix:681:15:
          680|       extraArgs = mapAttrs (
          681|         name: _:
             |               ^
          682|         addErrorContext (context name) (

       … while evaluating the module argument `zen-browser' in "/nix/store/yq386kqix7yxvvx2332z069q61paxvmk-source/shared/home-manager/main.nix":

       … noting that argument `zen-browser` is not externally provided, so querying `_module.args` instead, requiring `config`

       … if you get an infinite recursion here, you probably reference `config` in `imports`. If you are trying to achieve a conditional import behavior dependent on `config`, consider importing unconditionally, and using `mkEnableOption` and `mkIf` to control its effect.

Copilot Turn 1

Oof, that's a classic Nix infinite recursion error. They can look intimidating, but the error message itself gives us a very strong clue about what's wrong. Thank you for providing the full error trace and all the relevant files; it makes diagnosing this much easier.

Let's zero in on the most helpful part of the error message:

… while evaluating the module argument `zen-browser' in ".../shared/home-manager/main.nix":

… noting that argument `zen-browser` is not externally provided, so querying `_module.args` instead, requiring `config`

… if you get an infinite recursion here, you probably reference `config` in `imports`. If you are trying to achieve a conditional import behavior dependent on `config`, consider importing unconditionally, and using `mkEnableOption` and `mkIf` to control its effect.

This tells us three things:

  1. The problem is in shared/home-manager/main.nix.
  2. It's related to the zen-browser argument.
  3. The root cause is a circular dependency: an imports statement is trying to use a value that depends on config, but config can't be built until all modules are imported.

The Problem

Looking at your shared/home-manager/main.nix, we can see exactly where this happens:

{
  config,
  pkgs,
  lib,
  home-manager,
  zen-browser,  # This comes from your flake inputs
  ...
}:

{
  imports = [
    ./packages.nix
    ./desktop.nix
    ./git.nix
    ./shell.nix
    ./fonts.nix
    zen-browser.homeModules.beta # <-- THIS IS THE PROBLEM
  ];
  
  # ...
}

You are correctly trying to use the Home Manager module provided by the new 0xc000022070/zen-browser-flake. However, you're doing it inside the imports block of a module that receives zen-browser as a function argument. Nix sees this as: "To figure out the imports for main.nix, I need the zen-browser argument. But to know what zen-browser is, I have to evaluate the module arguments, which requires the final config... which requires the imports." And thus, infinite recursion.

The Solution

The fix is to move the zen-browser Home Manager module import out of this file and into the place where you define your Home Manager configuration for the user. This is typically done in your NixOS configuration file where you set up home-manager.users.<username>.

Based on your file structure, the correct place to add this import is in hosts/stellapent-cier/users/gildedguy.nix.

Here is the corrected version of gildedguy.nix:

{ config, pkgs, lib, zen-browser, ... }:

{
  imports = [
    ../../../shared/home-manager/main.nix
    zen-browser.homeModules.beta #  <-- Import it here
  ];

  home.username = "gildedguy";
  home.homeDirectory = "/home/gildedguy";
}

And you need to remove the problematic line from shared/home-manager/main.nix:

# This is the meta configuration for my dotfiles with home-manager, except
# some home.{username,userDirectory} configs to ensure portability between
# hosts

{
  config,
  pkgs,
  lib,
  home-manager,
  # We no longer need zen-browser passed in here
  ...
}:

{
  imports = [
    ./packages.nix
    ./desktop.nix
    ./git.nix
    ./shell.nix
    ./fonts.nix
    # zen-browser.homeModules.beta has been removed from here
  ];

  # ... (The rest of the file remains the same)
  # https://fnordig.de/til/nix/home-manager-allow-unfree.html
  nixpkgs = {
    config = {
      allowUnfree = true;
      # https://github.com/nix-community/home-manager/issues/2942
      allowUnfreePredicate = (_: true);
    };
  };

  # This value determines the Home Manager release that your configuration is
  # compatible with. This helps avoid breakage when a new Home Manager release
  # introduces backwards incompatible changes.
  #
  # You should not change this value, even if you update Home Manager. If you do
  # want to update the value, then make sure to first check the Home Manager
  # release notes.
  home.stateVersion = "25.05"; # Please read the comment before changing.

  home.sessionPath = [
    "$HOME/bin"
    "$HOME/.local/bin"
    "$HOME/.nix-profile/bin"
    "$HOME/.local/share/go/bin"
  ];

  # Let Home Manager install and manage itself.
  programs.home-manager.enable = true;

  programs.vscode = {
    enable = true;
    package = pkgs.vscode;
    profiles = {
      default = {
        enableExtensionUpdateCheck = true;
      };
    };
    mutableExtensionsDir = true;
  };
}

By making this change, you are importing the zen-browser module at the top level of the user's configuration, which correctly resolves the dependency without causing recursion. You can now take full advantage of the programs.zen-browser options that the new flake provides in your other Home Manager files, like you already are in packages.nix.

User Turn 2

That may work for home-manager on NixOS but what about on non-NixOS Linuxes (or those NixOS servers but w/o admin perms)?

Copilot Turn 2

That is an excellent and very important question. You've hit on the key difference between using Home-Manager as a NixOS module versus using it in standalone mode. My previous answer was tailored to your NixOS setup. For non-NixOS systems or unprivileged servers, you are correct that a different approach is needed.

The infinite recursion error is a side effect of how NixOS module arguments are passed. In a standalone Home-Manager setup, you define your configuration entry point differently, which neatly avoids this problem.

Here’s how you can structure your configuration to support both NixOS and standalone Home-Manager usage while sharing the bulk of your code.

The Standalone Home-Manager Approach

In standalone mode, you typically have a home.nix file that serves as the entry point, and you build it via a homeConfigurations output in your flake.nix.

1. Create a Standalone Entry Point

Let's create a new file, for example at home/gildedguy/home.nix. This will be the main configuration file for your user when used outside of your NixOS setup. It will import the shared modules.

# This is the entry point for a standalone Home-Manager configuration.
{ pkgs, lib, zen-browser, ... }:

{
  # This imports all your shared settings
  imports = [
    ../../shared/home-manager/main.nix
    zen-browser.homeModules.beta # <-- Import it here, just like the NixOS user file.
  ];

  # Basic user info required by standalone Home-Manager
  home.username = "gildedguy";
  home.homeDirectory = "/home/gildedguy";

  # This value should be consistent across all your Home-Manager configurations.
  home.stateVersion = "25.05";
}

Notice this file is very similar to the gildedguy.nix file for your NixOS host. It sets the user/home and pulls in all the shared logic.

2. Update Your flake.nix to Build Standalone Configurations

Now, you need to tell your flake how to build this standalone configuration. You do this by adding a homeConfigurations output to your main flake.nix.

{
  description = "@ajhalili2006's nixpkgs + NixOS configurations";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    home-manager = {
      url = "github:nix-community/home-manager";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    # You switched to the new zen-browser flake
    zen-browser = {
      url = "github:0xc000022070/zen-browser-flake";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    # ... other inputs
  };

  outputs = { self, nixpkgs, home-manager, zen-browser, ... }@inputs: {

    # Your existing NixOS configurations
    nixosConfigurations = {
      "stellapent-cier" = nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        specialArgs = {
          # Pass flake inputs as arguments to your NixOS modules
          inherit zen-browser;
          # ... other specialArgs
        };
        modules = [
          ./hosts/stellapent-cier/configuration.nix
          # You can also pass home-manager as a module here if you prefer
          # home-manager.nixosModules.default
        ];
      };
      # ... other hosts
    };

    # NEW: Standalone Home-Manager configurations
    homeConfigurations = {
      # The name can be anything, but "user@host" is a common convention
      "gildedguy-standalone" = home-manager.lib.homeManagerConfiguration {
        pkgs = nixpkgs.legacyPackages.x86_64-linux;
        extraSpecialArgs = {
          # Pass flake inputs as arguments to your Home-Manager modules
          inherit zen-browser;
          # ... other specialArgs
        };
        modules = [
          # Point to your new standalone entry point
          ./home/gildedguy/home.nix
        ];
      };
    };
  };
}

How to Use It

  • On a non-NixOS machine (or unprivileged server):

    1. Make sure you have Nix and Home-Manager installed.
    2. Clone your nixops-config repository.
    3. From within the repository, run:
      # This builds and activates the 'gildedguy-standalone' configuration
      home-manager switch --flake .#gildedguy-standalone
  • On your NixOS machine (stellapent-cier):

    • You continue to build as you always have:
      sudo nixos-rebuild switch --flake .#stellapent-cier

Why This Works

The key is the extraSpecialArgs parameter in homeManagerConfiguration. It does the same job as specialArgs in nixosSystem: it makes your flake inputs (zen-browser, etc.) available as arguments to your modules.

Because the home.nix entry point receives zen-browser this way, you can safely import zen-browser.homeModules.beta within it without causing the infinite recursion you saw earlier. You've successfully separated the concerns of system configuration and user configuration, allowing you to reuse your dotfiles across any machine.

Conversation Context

User

Attachments not linked:

I am trying to rebuild my NixOS unstable configuration for my laptop to apply latest updates from nixpkgs alongside third-party flakes I use, but I got the following error at the community-maintained flake for Zen Browser from [@youwen5/zen-browser-flake]9https://github.com/youwen5/zen-browser-flake) with the following nixos-rebuild error:

error: hash mismatch in fixed-output derivation '/nix/store/k6dqlz21sm8kqdr6d61w001432q5pivh-zen.linux-x86_64.tar.xz.drv':
         specified: sha256-eZ3NfXZ12m5LZ0cgZ5WYk2npTO+riFjw8lcRdUp3VZg=
            got:    sha256-X5Q1OuEjbUWE8Y8E446SqvqpoExlTRw9R5TM0esRzP8=
error: build of resolved derivation '/nix/store/k6dqlz21sm8kqdr6d61w001432q5pivh-zen.linux-x86_64.tar.xz.drv' failed
error: Cannot build '/nix/store/0zk11y4cgx4zwhnczyji8cjyf12dp1y4-zen-browser-unwrapped-1.17.5b.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/q64l4di3flhv4rmm832xs7ccf41k40dc-zen-browser-unwrapped-1.17.5b
error: Cannot build '/nix/store/2aq9596i0c53hwfy0j0w20d3s6kgi9ix-zen-browser-1.17.5b.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/l6mivmllr3x6iyjn0ylic9z37hj72lmp-zen-browser-1.17.5b
error: Cannot build '/nix/store/r6mkryzv5d1j3zsmszgx1y0j23s0a2dl-system-path.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/wsyrfs5dw3n94fldw3zqpw8wry9kyj9q-system-path
error: Cannot build '/nix/store/rvm9ybfn3a9mnhljsrcxv0wypwa5aclb-nixos-system-stellapent-cier-cockpit-devtools-tailnet-25.11.20251103.7241bcb.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/gp3xml8iczs68hjhzbgjfgrsf2fccxph-nixos-system-stellapent-cier-cockpit-devtools-tailnet-25.11.20251103.7241bcb

Any suggestions to fix this, including possible upstream contributions btw?

Copilot

Hello @ajhalili2006, I can see you're running into a hash mismatch error with the zen-browser-flake. This is a common issue in Nix when an upstream dependency is updated, and the expected hash in the Nix expression no longer matches the hash of the downloaded file.

Based on the error, it seems the Zen Browser has been updated, but the flake from youwen5/zen-browser-flake hasn't been updated with the new source code's hash yet.

Looking at the youwen5/zen-browser-flake repository, I don't see any open pull requests addressing this, which means you have a great opportunity to contribute the fix upstream!

Here is the relevant part of the flake.nix from the repository:

{
  description = "Flake that provides Zen Browser binaries wrapped and patched for NixOS.";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
  };

  outputs =
    {
      nixpkgs,
      ...
    }:
    let
      supportedSystems = [
        "x86_64-linux"
        "aarch64-linux"
      ];
      forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
    in
    {
      packages = forAllSystems (
        system:
        let
          pkgs = import nixpkgs { inherit system; };
          packages = import ./. { inherit pkgs system; };
        in
        packages
      );

      apps = forAllSystems (
        system:
        let
          pkgs = import nixpkgs { inherit system; };
        in
        {
          update = {
            type = "app";
            program = "${pkgs.callPackage ./update-scripts { }}/bin/commit-update.nu";
          };
        }
      );

      formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style);
    };
}

The flake seems to have an update script. You can try running it locally after forking the repository.

To fix this, you will need to:

  1. Fork the youwen5/zen-browser-flake repository.
  2. Update the hash: The error output from your nixos-rebuild command gives you the correct hash.
    • Specified (old) hash: sha256-eZ3NfXZ12m5LZ0cgZ5WYk2npTO+riFjw8lcRdUp3VZg=
    • Got (new) hash: sha256-X5Q1OuEjbUWE8Y8E446SqvqpoExlTRw9R5TM0esRzP8=
  3. Locate the file containing the hash: Inside the repository, you'll need to find the Nix file that defines the package and its source hash. Based on the flake.nix, it's likely in a file that defines the package derivation (e.g., default.nix). You'll need to replace the old hash with the new one.
  4. Submit a Pull Request: After updating the hash, commit the change, push it to your fork, and open a pull request to the youwen5/zen-browser-flake repository. This will help the maintainer and other users who are likely facing the same issue.

In the meantime, you can use an overlay in your own configuration to override the hash locally, which will allow you to proceed with your system rebuild while you wait for the upstream PR to be merged.

User

In the meanwhile, could you help me do the overrides on my @andreijiroh-dev/nixops-config/files/shared/desktop/firefox.nix file in the meanwhile? The flake in question's @youwen5/zen-browser-flake/files/.github/workflows/update.yml has some automation in it (alongside nix run .#update command if manually run per your instructions).

Copilot

Of course! I can certainly help you create an overlay to temporarily fix the hash mismatch in your NixOS configuration. It's great that you've noticed the automation in the upstream flake; that indicates the maintainer has a process for updates, and submitting a PR is the right long-term solution.

Here's how you can modify your shared/desktop/firefox.nix to include an overlay for zen-browser:

I'll use an overlay to replace the src attribute of the zen-browser package with one that has the correct hash.

Here is the modified file:

{ pkgs, zen-browser, ... }:

let
  # The new hash from your build error
  newHash = "sha256-X5Q1OuEjbUWE8Y8E446SqvqpoExlTRw9R5TM0esRzP8=";

  # Create an overlay to override the zen-browser package
  zen-overlay = final: prev: {
    zen-browser = prev.zen-browser.overrideAttrs (oldAttrs: {
      src = pkgs.fetchurl {
        url = oldAttrs.src.url;
        hash = newHash;
      };
    });
  };

  # Apply the overlay to pkgs
  pkgs-with-zen-override = pkgs.extend zen-overlay;

in
{
  programs.firefox = {
    enable = true;
    nativeMessagingHosts.packages = with pkgs; [
      firefoxpwa
      #    _1password-gui
      #    gnupg
    ];
    package = pkgs.firefox;
  };

  environment.systemPackages = [
    zen-browser.packages.${pkgs.system}.default
  ];

  # Add a Nixpkgs overlay to fix the zen-browser hash.
  # This is a temporary solution until the upstream flake is updated.
  nixpkgs.overlays = [
    (final: prev: {
      zen-browser = prev.zen-browser.overrideAttrs (old: {
        src = prev.fetchurl {
          url = old.src.url;
          sha256 = "sha256-X5Q1OuEjbUWE8Y8E446SqvqpoExlTRw9R5TM0esRzP8=";
        };
      });
    })
  ];
}

Explanation:

  1. nixpkgs.overlays: This is a standard way in NixOS to modify the nixpkgs package set. We are adding a new overlay here.
  2. The Overlay Function (final: prev: { ... }):
    • prev represents the original package set before our changes.
    • final represents the final package set after all overlays are applied.
  3. Overriding zen-browser:
    • zen-browser = prev.zen-browser.overrideAttrs (old: { ... }); This line tells Nix to take the existing zen-browser package and change some of its attributes.
    • src = prev.fetchurl { ... }; We are specifically overriding the src attribute.
    • url = old.src.url; We keep the original download URL.
    • sha256 = "sha256-X5Q1OuEjbUWE8Y8E446SqvqpoExlTRw9R5TM0esRzP8="; This is the crucial part where we replace the old, incorrect hash with the new one you got from the error message.

By adding this to your shared/desktop/firefox.nix, your NixOS configuration will use the corrected hash for zen-browser, allowing your nixos-rebuild to complete successfully.

Once the youwen5/zen-browser-flake is updated upstream, you can remove this overlay and update your flake inputs as usual.

User

I might be switching to @0xc000022070/zen-browser-flake as mentioned in @youwen5/zen-browser-flake/issues/11 (cue the maintainability reasons alongside support for home-manager options).

Copilot

That's a very interesting development, and thank you for sharing that issue. It seems you've stumbled upon a classic case of a community fork taking over an apparently unmaintained project.

Switching to 0xc000022070/zen-browser-flake is an excellent idea, especially since the issue you found highlights two major benefits:

  1. Active Maintenance: The fork is actively updated by community members.
  2. Better Integration: It supports Home Manager options, allowing for declarative configuration of browser profiles, which is a huge plus for Nix users.

Given this, the overlay we created is no longer the best approach. A full switch is the right call.

How to Switch to the New Flake

The change needs to happen in two places:

  1. Your main flake.nix: You need to update the inputs section of your nixops-config's flake.nix to point to the new repository.

    You would change something like this:

    inputs = {
      # ... other inputs
      zen-browser.url = "github:youwen5/zen-browser-flake";
      # ... other inputs
    };

    to this:

    inputs = {
      # ... other inputs
      zen-browser.url = "github:0xc000022070/zen-browser-flake";
      # ... other inputs
    };

    After changing the input, you should run nix flake update to pull in the new flake's lockfile.

  2. Your shared/desktop/firefox.nix file: We should remove the overlay we just added, as it's no longer necessary. The new flake should be up-to-date and not have the hash mismatch issue.

Here is the cleaned-up shared/desktop/firefox.nix file, reverting to its original state before we added the overlay:

{ pkgs, zen-browser, ... }:

{
  programs.firefox = {
    enable = true;
    nativeMessagingHosts.packages = with pkgs; [
      firefoxpwa
      #    _1password-gui
      #    gnupg
    ];
    package = pkgs.firefox;
  };

  environment.systemPackages = [
    zen-browser.packages.${pkgs.system}.default
  ];
}

By making these changes, you'll be using the actively maintained, more feature-rich version of the Zen Browser flake. This is a much better long-term solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment