Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

tree-sitter.buildGrammar - error: cannot coerce a set to a string #616

Closed
skrobul opened this issue Aug 11, 2024 · 10 comments
Closed

tree-sitter.buildGrammar - error: cannot coerce a set to a string #616

skrobul opened this issue Aug 11, 2024 · 10 comments

Comments

@skrobul
Copy link

skrobul commented Aug 11, 2024

I was trying to switch to the neovim-nightly, but I am not able to because of this error when attempting to nixos-rebuild

at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/pkgs/by-name/ne/neovim-unwrapped/package.nix:175:20:

   174|           ${tree-sitter.buildGrammar {
   175|             inherit language src;
      |                    ^
   176|             version = "neovim-${finalAttrs.version}";

error: cannot coerce a set to a string

Full trace:

❯ sudo nixos-rebuild switch --flake '.#marek'   --option eval-cache false --show-trace
[sudo] password for skrobul:
building the system configuration...
error:
       … while calling anonymous lambda

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/attrsets.nix:1571:24:

         1570|     let f = attrPath:
         1571|       zipAttrsWith (n: values:
             |                        ^
         1572|         let here = attrPath ++ [n]; in

       … while calling anonymous lambda

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/attrsets.nix:1205:18:

         1204|         mapAttrs
         1205|           (name: value:
             |                  ^
         1206|             if isAttrs value && cond value

       … from call site

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/attrsets.nix:1208:18:

         1207|             then recurse (path ++ [ name ]) value
         1208|             else f (path ++ [ name ]) value);
             |                  ^
         1209|     in

       … while calling anonymous lambda

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/modules.nix:242:72:

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

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

       … while calling anonymous lambda

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/modules.nix:824:28:

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

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

       … from call site

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/modules.nix:825:137:

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

       … while calling 'dischargeProperties'

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/modules.nix:896:25:

          895|   */
          896|   dischargeProperties = def:
             |                         ^
          897|     if def._type or "" == "merge" then

       … from call site

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/nixos/modules/system/activation/top-level.nix:71:12:

           70|   # Replace runtime dependencies
           71|   system = foldr ({ oldDependency, newDependency }: drv:
             |            ^
           72|       pkgs.replaceDependency { inherit oldDependency newDependency drv; }

       … while calling 'foldr'

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/lists.nix:121:20:

          120|   */
          121|   foldr = op: nul: list:
             |                    ^
          122|     let

       … from call site

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/lists.nix:128:8:

          127|         else op (elemAt list n) (fold' (n + 1));
          128|     in fold' 0;
             |        ^
          129|

       … while calling 'fold''

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/lists.nix:124:15:

          123|       len = length list;
          124|       fold' = n:
             |               ^
          125|         if n == len

       … from call site

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/nixos/modules/system/activation/top-level.nix:68:10:

           67|     then throw "\nFailed assertions:\n${concatStringsSep "\n" (map (x: "- ${x}") failedAssertions)}"
           68|     else showWarnings config.warnings baseSystem;
             |          ^
           69|

       … while calling 'showWarnings'

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/trivial.nix:867:28:

          866|
          867|   showWarnings = warnings: res: lib.foldr (w: x: warn w x) res warnings;
             |                            ^
          868|

       … from call site

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/trivial.nix:867:33:

          866|
          867|   showWarnings = warnings: res: lib.foldr (w: x: warn w x) res warnings;
             |                                 ^
          868|

       … while calling 'foldr'

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/lists.nix:121:20:

          120|   */
          121|   foldr = op: nul: list:
             |                    ^
          122|     let

       … from call site

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/lists.nix:128:8:

          127|         else op (elemAt list n) (fold' (n + 1));
          128|     in fold' 0;
             |        ^
          129|

       … while calling 'fold''

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/lists.nix:124:15:

          123|       len = length list;
          124|       fold' = n:
             |               ^
          125|         if n == len

       … while calling anonymous lambda

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/attrsets.nix:1205:18:

         1204|         mapAttrs
         1205|           (name: value:
             |                  ^
         1206|             if isAttrs value && cond value

       … from call site

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/attrsets.nix:1208:18:

         1207|             then recurse (path ++ [ name ]) value
         1208|             else f (path ++ [ name ]) value);
             |                  ^
         1209|     in

       … while calling anonymous lambda

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/modules.nix:242:72:

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

       … while evaluating the option `warnings':

       … while calling anonymous lambda

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/modules.nix:824:28:

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

       … while evaluating definitions from `/nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/nixos/modules/system/boot/systemd.nix':

       … from call site

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/modules.nix:825:137:

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

       … while calling 'dischargeProperties'

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/modules.nix:896:25:

          895|   */
          896|   dischargeProperties = def:
             |                         ^
          897|     if def._type or "" == "merge" then

       … while calling anonymous lambda

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/attrsets.nix:1096:10:

         1095|     attrs:
         1096|     map (name: f name attrs.${name}) (attrNames attrs);
             |          ^
         1097|

       … from call site

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/attrsets.nix:1096:16:

         1095|     attrs:
         1096|     map (name: f name attrs.${name}) (attrNames attrs);
             |                ^
         1097|

       … while calling anonymous lambda

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/nixos/modules/system/boot/systemd.nix:443:16:

          442|       mapAttrsToList
          443|         (name: service:
             |                ^
          444|           let

       … from call site

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/nixos/modules/system/boot/systemd.nix:450:16:

          449|             concatLists [
          450|               (optional (type == "oneshot" && (restart == "always" || restart == "on-success"))
             |                ^
          451|                 "Service '${name}.service' with 'Type=oneshot' cannot have 'Restart=always' or 'Restart=on-success'"

       … while calling 'optional'

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/lists.nix:784:20:

          783|   */
          784|   optional = cond: elem: if cond then [elem] else [];
             |                    ^
          785|

       … while calling anonymous lambda

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/attrsets.nix:1205:18:

         1204|         mapAttrs
         1205|           (name: value:
             |                  ^
         1206|             if isAttrs value && cond value

       … from call site

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/attrsets.nix:1208:18:

         1207|             then recurse (path ++ [ name ]) value
         1208|             else f (path ++ [ name ]) value);
             |                  ^
         1209|     in

       … while calling anonymous lambda

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/modules.nix:242:72:

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

       … while evaluating the option `systemd.services.home-manager-skrobul.serviceConfig':

       … from call site

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/modules.nix:846:59:

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

       … while calling 'merge'

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/types.nix:583:20:

          582|       check = isAttrs;
          583|       merge = loc: defs:
             |                    ^
          584|         mapAttrs (n: v: v.value) (filterAttrs (n: v: v ? value) (zipAttrsWith (name: defs:

       … from call site

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/types.nix:584:35:

          583|       merge = loc: defs:
          584|         mapAttrs (n: v: v.value) (filterAttrs (n: v: v ? value) (zipAttrsWith (name: defs:
             |                                   ^
          585|             (mergeDefinitions (loc ++ [name]) elemType defs).optionalValue

       … while calling 'filterAttrs'

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/attrsets.nix:646:5:

          645|     pred:
          646|     set:
             |     ^
          647|     listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set));

       … while calling anonymous lambda

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/attrsets.nix:647:29:

          646|     set:
          647|     listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set));
             |                             ^
          648|

       … from call site

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/attrsets.nix:647:62:

          646|     set:
          647|     listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set));
             |                                                              ^
          648|

       … while calling anonymous lambda

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/types.nix:584:51:

          583|       merge = loc: defs:
          584|         mapAttrs (n: v: v.value) (filterAttrs (n: v: v ? value) (zipAttrsWith (name: defs:
             |                                                   ^
          585|             (mergeDefinitions (loc ++ [name]) elemType defs).optionalValue

       … while calling anonymous lambda

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/types.nix:584:86:

          583|       merge = loc: defs:
          584|         mapAttrs (n: v: v.value) (filterAttrs (n: v: v ? value) (zipAttrsWith (name: defs:
             |                                                                                      ^
          585|             (mergeDefinitions (loc ++ [name]) elemType defs).optionalValue

       … while calling anonymous lambda

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/modules.nix:824:28:

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

       … while evaluating definitions from `/nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/flake.nix':

       … from call site

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/modules.nix:825:137:

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

       … while calling 'dischargeProperties'

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/modules.nix:896:25:

          895|   */
          896|   dischargeProperties = def:
             |                         ^
          897|     if def._type or "" == "merge" then

       … while evaluating derivation 'home-manager-generation'
         whose name attribute is located at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/pkgs/stdenv/generic/make-derivation.nix:331:7

       … while evaluating attribute 'buildCommand' of derivation 'home-manager-generation'

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/pkgs/build-support/trivial-builders/default.nix:68:16:

           67|         enableParallelBuilding = true;
           68|         inherit buildCommand name;
             |                ^
           69|         passAsFile = [ "buildCommand" ]

       … while evaluating derivation 'home-manager-files'
         whose name attribute is located at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/pkgs/stdenv/generic/make-derivation.nix:331:7

       … while evaluating attribute 'buildCommand' of derivation 'home-manager-files'

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/pkgs/build-support/trivial-builders/default.nix:68:16:

           67|         enableParallelBuilding = true;
           68|         inherit buildCommand name;
             |                ^
           69|         passAsFile = [ "buildCommand" ]

       … while calling anonymous lambda

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/attrsets.nix:1096:10:

         1095|     attrs:
         1096|     map (name: f name attrs.${name}) (attrNames attrs);
             |          ^
         1097|

       … from call site

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/attrsets.nix:1096:16:

         1095|     attrs:
         1096|     map (name: f name attrs.${name}) (attrNames attrs);
             |                ^
         1097|

       … while calling anonymous lambda

         at /nix/store/hxhym8c5xz6dxkl3d9yppiwlnzk3khn7-source/modules/files.nix:353:28:

          352|       '' + concatStrings (
          353|         mapAttrsToList (n: v: ''
             |                            ^
          354|           insertFile ${

       … from call site

         at /nix/store/hxhym8c5xz6dxkl3d9yppiwlnzk3khn7-source/modules/files.nix:355:13:

          354|           insertFile ${
          355|             escapeShellArgs [
             |             ^
          356|               (sourceStorePath v)

       … while calling 'concatMapStringsSep'

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/strings.nix:116:5:

          115|     # List of input strings
          116|     list: concatStringsSep sep (map f list);
             |     ^
          117|

       … while calling 'escapeShellArg'

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/strings.nix:454:20:

          453|   */
          454|   escapeShellArg = arg: "'${replaceStrings ["'"] ["'\\''"] (toString arg)}'";
             |                    ^
          455|

       … from call site

         at /nix/store/hxhym8c5xz6dxkl3d9yppiwlnzk3khn7-source/modules/files.nix:356:16:

          355|             escapeShellArgs [
          356|               (sourceStorePath v)
             |                ^
          357|               v.target

       … while calling 'sourceStorePath'

         at /nix/store/hxhym8c5xz6dxkl3d9yppiwlnzk3khn7-source/modules/files.nix:15:21:

           14|
           15|   sourceStorePath = file:
             |                     ^
           16|     let

       … while calling anonymous lambda

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/attrsets.nix:1205:18:

         1204|         mapAttrs
         1205|           (name: value:
             |                  ^
         1206|             if isAttrs value && cond value

       … from call site

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/attrsets.nix:1208:18:

         1207|             then recurse (path ++ [ name ]) value
         1208|             else f (path ++ [ name ]) value);
             |                  ^
         1209|     in

       … while calling anonymous lambda

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/modules.nix:242:72:

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

       … while evaluating the option `home-manager.users.skrobul.home.file."/home/skrobul/.config/fontconfig/conf.d/10-hm-fonts.conf".source':

       … while calling anonymous lambda

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/modules.nix:824:28:

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

       … while evaluating definitions from `/nix/store/hxhym8c5xz6dxkl3d9yppiwlnzk3khn7-source/modules/files.nix':

       … from call site

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/modules.nix:825:137:

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

       … while calling 'dischargeProperties'

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/modules.nix:896:25:

          895|   */
          896|   dischargeProperties = def:
             |                         ^
          897|     if def._type or "" == "merge" then

       … while calling anonymous lambda

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/attrsets.nix:1205:18:

         1204|         mapAttrs
         1205|           (name: value:
             |                  ^
         1206|             if isAttrs value && cond value

       … from call site

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/attrsets.nix:1208:18:

         1207|             then recurse (path ++ [ name ]) value
         1208|             else f (path ++ [ name ]) value);
             |                  ^
         1209|     in

       … while calling anonymous lambda

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/modules.nix:242:72:

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

       … while evaluating the option `home-manager.users.skrobul.home.file."/home/skrobul/.config/fontconfig/conf.d/10-hm-fonts.conf".text':

       … while calling anonymous lambda

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/modules.nix:824:28:

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

       … while evaluating definitions from `/nix/store/hxhym8c5xz6dxkl3d9yppiwlnzk3khn7-source/modules/misc/xdg.nix':

       … from call site

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/modules.nix:825:137:

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

       … while calling 'dischargeProperties'

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/modules.nix:896:25:

          895|   */
          896|   dischargeProperties = def:
             |                         ^
          897|     if def._type or "" == "merge" then

       … while calling anonymous lambda

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/attrsets.nix:1205:18:

         1204|         mapAttrs
         1205|           (name: value:
             |                  ^
         1206|             if isAttrs value && cond value

       … from call site

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/attrsets.nix:1208:18:

         1207|             then recurse (path ++ [ name ]) value
         1208|             else f (path ++ [ name ]) value);
             |                  ^
         1209|     in

       … while calling anonymous lambda

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/modules.nix:242:72:

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

       … while evaluating the option `home-manager.users.skrobul.xdg.configFile."fontconfig/conf.d/10-hm-fonts.conf".text':

       … while calling anonymous lambda

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/modules.nix:824:28:

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

       … while evaluating definitions from `/nix/store/hxhym8c5xz6dxkl3d9yppiwlnzk3khn7-source/modules/misc/fontconfig.nix':

       … from call site

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/modules.nix:825:137:

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

       … while calling 'dischargeProperties'

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/modules.nix:896:25:

          895|   */
          896|   dischargeProperties = def:
             |                         ^
          897|     if def._type or "" == "merge" then

       … from call site

         at /nix/store/hxhym8c5xz6dxkl3d9yppiwlnzk3khn7-source/modules/misc/fontconfig.nix:134:51:

          133|     in {
          134|       "fontconfig/conf.d/10-hm-fonts.conf".text = mkFontconfigConf ''
             |                                                   ^
          135|         <description>Add fonts in the Nix user profile</description>

       … while calling 'mkFontconfigConf'

         at /nix/store/hxhym8c5xz6dxkl3d9yppiwlnzk3khn7-source/modules/misc/fontconfig.nix:123:26:

          122|     xdg.configFile = let
          123|       mkFontconfigConf = conf: ''
             |                          ^
          124|         <?xml version='1.0'?>

       … while evaluating derivation 'home-manager-path'
         whose name attribute is located at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/pkgs/stdenv/generic/make-derivation.nix:331:7

       … while evaluating attribute 'passAsFile' of derivation 'home-manager-path'

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/pkgs/build-support/trivial-builders/default.nix:69:9:

           68|         inherit buildCommand name;
           69|         passAsFile = [ "buildCommand" ]
             |         ^
           70|           ++ (derivationArgs.passAsFile or [ ]);

       … while evaluating derivation 'neovim-nightly'
         whose name attribute is located at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/pkgs/stdenv/generic/make-derivation.nix:331:7

       … while evaluating attribute 'buildPhase' of derivation 'neovim-nightly'

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/pkgs/applications/editors/neovim/wrapper.nix:166:5:

          165|
          166|     buildPhase = ''
             |     ^
          167|       runHook preBuild

       … while evaluating derivation 'neovim-unwrapped-nightly'
         whose name attribute is located at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/pkgs/stdenv/generic/make-derivation.nix:331:7

       … while evaluating attribute 'preConfigure' of derivation 'neovim-unwrapped-nightly'

         at /nix/store/0q13ssdv1dpqzsxr2b5h2gr2b1zdszch-source/flake/packages/neovim.nix:91:5:

           90|
           91|     preConfigure = ''
             |     ^
           92|       ${oa.preConfigure}

       … while calling anonymous lambda

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/attrsets.nix:1096:10:

         1095|     attrs:
         1096|     map (name: f name attrs.${name}) (attrNames attrs);
             |          ^
         1097|

       … from call site

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/lib/attrsets.nix:1096:16:

         1095|     attrs:
         1096|     map (name: f name attrs.${name}) (attrNames attrs);
             |                ^
         1097|

       … while calling anonymous lambda

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/pkgs/by-name/ne/neovim-unwrapped/package.nix:172:18:

          171|     '' + lib.concatStrings (lib.mapAttrsToList
          172|       (language: src: ''
             |                  ^
          173|         ln -s \

       … while evaluating derivation 'c-grammar-neovim-nightly'
         whose name attribute is located at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/pkgs/stdenv/generic/make-derivation.nix:331:7

       … while evaluating attribute 'src' of derivation 'c-grammar-neovim-nightly'

         at /nix/store/wzx1ba5hqqfa23vfrvqmfmkpj25p37mr-source/pkgs/by-name/ne/neovim-unwrapped/package.nix:175:20:

          174|           ${tree-sitter.buildGrammar {
          175|             inherit language src;
             |                    ^
          176|             version = "neovim-${finalAttrs.version}";

       error: cannot coerce a set to a string

I searched for a potential solution and stumbled upon #591 where @antoineco suggested adding inputs.nixpkgs.follows = "nixpkgs"; but it made absolutely no difference for me (same traceback was produced).

My exact configuration at the time when this happens is available here:

Is there anything I am doing wrong here? I'd appreciate any help or suggestions

@antoineco
Copy link

@skrobul your repo seems private. Maybe your nixpkgs input is 24.05 instead of nixpkgs-unstable? If that's the case, you need to remove the follow, because this overlay works against the unstable branch.

@skrobul
Copy link
Author

skrobul commented Aug 11, 2024

@skrobul your repo seems private. Maybe your nixpkgs input is 24.05 instead of nixpkgs-unstable? If that's the case, you need to remove the follow, because this overlay works against the unstable branch.

@antoineco - thanks and apologies, I have now made the repo public so you can see whole file.

Following your suggestion I have also tried:

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs?ref=24.05";
    nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
    neovim-nightly-overlay = {
      url = "github:nix-community/neovim-nightly-overlay";
      inputs.nixpkgs.follows = "nixpkgs";
    };

as well as

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs?ref=24.05";
    nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
    neovim-nightly-overlay = {
      url = "github:nix-community/neovim-nightly-overlay";
      inputs.nixpkgs.follows = "nixpkgs-unstable";
    };

and

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs?ref=24.05";
    nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
    neovim-nightly-overlay = {
      url = "github:nix-community/neovim-nightly-overlay";
     };

and all of them end up with exact same traceback :(

@antoineco
Copy link

@skrobul the flake you linked doesn't seem to be applying the overlay. Anyway the trick for me was to apply it on top of nixpkgs-unstable: https://github.com/antoineco/dotfiles/blob/aabe14063e89265fe4c2a378d31f57d33fed4e46/nix/flakes/system/flake.nix#L38-L42

Since you are using two different revisions of nixpkgs inside your flake, you have to be careful not to be accidentally applying it on top of nixos-24.05.

@skrobul
Copy link
Author

skrobul commented Aug 11, 2024

I thought this part

({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable inputs.neovim-nightly-overlay.overlays.default]; })

was applying the overlay, but looks like I need to do some more reading as I'm genuinely lost here.

@willruggiano
Copy link
Contributor

See #533

@willruggiano
Copy link
Contributor

Overriding inputs won't make much of a difference when using overlays. If you absolutely must use the 24.05 branch then I suggest you directly access neovim-nightly via the flake's outputs, e.g.

environment.systemPackages = [inputs.neovim-nightly.packages.${system}.default];

@skrobul
Copy link
Author

skrobul commented Aug 11, 2024

See #533

Thanks, I did - my take-away from this issue was that I need to update my nixpkgs so I have ran nix flake update earlier, did I need to do anything else?

Overriding inputs won't make much of a difference when using overlays.

TIL

I suggest you directly access neovim-nightly via the flake's outputs,

That did the trick, THANK YOU so much 🙌🏻 I just now need to figure out how to make it work with home-manager.

For future reference if anyone gets the problem, here's what I did

  1. Update flakes to pass inputs to configuration.nix as described here
  2. Add the snippet @willruggiano posted above - it was just called inputs.neovim-nightly-overlay.packages... instead of inputs.neovim-nightly.packages.

@skrobul
Copy link
Author

skrobul commented Aug 11, 2024

Making it work with home-manager was easier than I thought. Once again, big thanks guys, appreciate your help!

@skrobul skrobul closed this as completed Aug 11, 2024
@glebdovzhenko
Copy link

Hey @skrobul could you please share your solution? The link is dead and I'm facing the same issue.

@skrobul
Copy link
Author

skrobul commented Nov 14, 2024

@glebdovzhenko sure thing, this is a diff from a commit linked above (sorry didn't realise it's private repo):

From 524afad375c9eef45ed01ee640cae845b1ebaaec Mon Sep 17 00:00:00 2001
From: Marek Skrobacki <[email protected]>
Date: Sun, 11 Aug 2024 20:02:56 +0100
Subject: [PATCH] use neovim-nightly-overlay with home-manager

---
 flake.nix                     | 1 +
 hosts/marek/configuration.nix | 1 -
 hosts/marek/home.nix          | 5 +++--
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/flake.nix b/flake.nix
index a7c8fda..7e00d65 100644
--- a/flake.nix
+++ b/flake.nix
@@ -40,6 +40,7 @@
             home-manager.useGlobalPkgs = true;
             home-manager.useUserPackages = true;
             home-manager.users.skrobul = import ./hosts/marek/home.nix;
+            home-manager.extraSpecialArgs = { inherit neovim-nightly-overlay; inherit system; };
           }
         ];
         specialArgs = { inherit inputs; };
diff --git a/hosts/marek/configuration.nix b/hosts/marek/configuration.nix
index f0b0d50..7a21f99 100644
--- a/hosts/marek/configuration.nix
+++ b/hosts/marek/configuration.nix
@@ -244,7 +244,6 @@ in
     unstable.noson
     wezterm
     stylua
-    inputs.neovim-nightly-overlay.packages.${system}.default
   ];

   fonts.packages = with pkgs; [
diff --git a/hosts/marek/home.nix b/hosts/marek/home.nix
index 6e43bb0..302c06b 100644
--- a/hosts/marek/home.nix
+++ b/hosts/marek/home.nix
@@ -1,4 +1,4 @@
-{  config, pkgs, ... }:
+{  config, pkgs, neovim-nightly-overlay, system, ... }:


 let
@@ -83,8 +83,9 @@ in
     nixfmt-classic
   ];
   programs.neovim =  {
-    enable = false;
+    enable = true;
     extraPackages = [ pkgs.sqlite ];
+    package = neovim-nightly-overlay.packages.${system}.default;
     defaultEditor = true;
     viAlias = true;
     vimAlias = true;

full flake.nix and home-manager part: https://gist.github.com/skrobul/731e2941af7dfc8404d357c3dd54d6cd

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

No branches or pull requests

4 participants