nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
7.04k stars 1.81k forks source link

bug: error: A definition for option `home-manager.users.optimal.home.packages.[definition 15-entry 1]' is not of type `package'. #2948

Closed TheOPtimal closed 2 years ago

TheOPtimal commented 2 years ago

Is there an existing issue for this?

Issue description

I have been trying to fix this goddamn issue for 2 weeks. Nothing worked. I'm all out of ideas, my Nix system is out of dated and I'm seriously considering wiping everything and just installing Fedora.

I'm using Home Manager inside of NixOS with the home-manager flake module. Here is the error log that occurs when I try to run nixos-rebuild:

error: A definition for option `home-manager.users.optimal.home.packages.[definition 15-entry 1]' is not of type `package'. Definition values:
       - In `/nix/store/i31947x13vyrfbaf6dn3353v8rb00qd7-source/module-lists/cli.nix': /nix/store/i31947x13vyrfbaf6dn3353v8rb00qd7-source/applications/neovim/module.nix

       … while evaluating the attribute 'value'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:790:27:

          789|     optionalValue =
          790|       if isDefined then { value = mergedValue; }
             |                           ^
          791|       else {};

       … while evaluating anonymous lambda

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/types.nix:403:14:

          402|       merge = loc: defs:
          403|         map (x: x.value) (filter (x: x ? value) (concatLists (imap1 (n: def:
             |              ^
          404|           imap1 (m: def':

       … from call site

       … while evaluating the attribute 'passAsFile'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/pkgs/build-support/buildenv/default.nix:77:5:

           76|     # XXX: The size is somewhat arbitrary
           77|     passAsFile = if builtins.stringLength pkgs >= 128*1024 then [ "pkgs" ] else [ ];
             |     ^
           78|   }

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

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/pkgs/stdenv/generic/make-derivation.nix:205:7:

          204|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          205|       name =
             |       ^
          206|         let

       … while evaluating the attribute 'value'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:578:44:

          577|       defnsByName' = byName "config" (module: value:
          578|           [{ inherit (module) file; inherit value; }]
             |                                            ^
          579|         ) configs;

       … while evaluating 'dischargeProperties'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:829:25:

          828|   */
          829|   dischargeProperties = def:
             |                         ^
          830|     if def._type or "" == "merge" then

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:758:137:

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

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

       … while evaluating anonymous lambda

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:757:28:

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

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:757:17:

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

       … while evaluating the attribute 'values'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:870:7:

          869|     in {
          870|       values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
             |       ^
          871|       inherit highestPrio;

       … while evaluating the attribute 'values'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:771:9:

          770|       in {
          771|         values = defs''';
             |         ^
          772|         inherit (defs'') highestPrio;

       … while evaluating the attribute 'mergedValue'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:777:5:

          776|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
          777|     mergedValue =
             |     ^
          778|       if isDefined then

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

       … while evaluating the attribute 'value'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:743:9:

          742|     in warnDeprecation opt //
          743|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          744|         inherit (res.defsFinal') highestPrio;

       … while evaluating anonymous lambda

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:293:72:

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

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/attrsets.nix:401:20:

          400|               then recurse (path ++ [name]) value
          401|               else f (path ++ [name]) value;
             |                    ^
          402|         in mapAttrs g;

       … while evaluating 'g'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/attrsets.nix:398:19:

          397|           g =
          398|             name: value:
             |                   ^
          399|             if isAttrs value && cond value

       … from call site

       … while evaluating the attribute 'value'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:578:44:

          577|       defnsByName' = byName "config" (module: value:
          578|           [{ inherit (module) file; inherit value; }]
             |                                            ^
          579|         ) configs;

       … while evaluating 'dischargeProperties'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:829:25:

          828|   */
          829|   dischargeProperties = def:
             |                         ^
          830|     if def._type or "" == "merge" then

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:758:137:

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

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

       … while evaluating anonymous lambda

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:757:28:

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

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:757:17:

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

       … while evaluating the attribute 'values'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:870:7:

          869|     in {
          870|       values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
             |       ^
          871|       inherit highestPrio;

       … while evaluating the attribute 'values'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:771:9:

          770|       in {
          771|         values = defs''';
             |         ^
          772|         inherit (defs'') highestPrio;

       … while evaluating the attribute 'mergedValue'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:777:5:

          776|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
          777|     mergedValue =
             |     ^
          778|       if isDefined then

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

       … while evaluating the attribute 'value'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:743:9:

          742|     in warnDeprecation opt //
          743|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          744|         inherit (res.defsFinal') highestPrio;

       … while evaluating anonymous lambda

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:293:72:

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

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/attrsets.nix:401:20:

          400|               then recurse (path ++ [name]) value
          401|               else f (path ++ [name]) value;
             |                    ^
          402|         in mapAttrs g;

       … while evaluating 'g'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/attrsets.nix:398:19:

          397|           g =
          398|             name: value:
             |                   ^
          399|             if isAttrs value && cond value

       … from call site

       … while evaluating the attribute 'condition'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:900:14:

          899|     { _type = "if";
          900|       inherit condition content;
             |              ^
          901|     };

       … while evaluating 'dischargeProperties'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:829:25:

          828|   */
          829|   dischargeProperties = def:
             |                         ^
          830|     if def._type or "" == "merge" then

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:758:137:

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

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

       … while evaluating anonymous lambda

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:757:28:

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

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:757:17:

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

       … while evaluating the attribute 'values'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:870:7:

          869|     in {
          870|       values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
             |       ^
          871|       inherit highestPrio;

       … while evaluating the attribute 'values'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:771:9:

          770|       in {
          771|         values = defs''';
             |         ^
          772|         inherit (defs'') highestPrio;

       … while evaluating the attribute 'mergedValue'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:777:5:

          776|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
          777|     mergedValue =
             |     ^
          778|       if isDefined then

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

       … while evaluating the attribute 'value'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:743:9:

          742|     in warnDeprecation opt //
          743|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          744|         inherit (res.defsFinal') highestPrio;

       … while evaluating anonymous lambda

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:293:72:

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

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/attrsets.nix:401:20:

          400|               then recurse (path ++ [name]) value
          401|               else f (path ++ [name]) value;
             |                    ^
          402|         in mapAttrs g;

       … while evaluating 'g'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/attrsets.nix:398:19:

          397|           g =
          398|             name: value:
             |                   ^
          399|             if isAttrs value && cond value

       … from call site

       … while evaluating 'sourceStorePath'

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

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

       … from call site

       at /nix/store/h8c0pidqn3igywxxcrs5358c2v5qngyw-source/modules/files.nix:395:16:

          394|             escapeShellArgs [
          395|               (sourceStorePath v)
             |                ^
          396|               v.target

       … while evaluating 'escapeShellArg'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/strings.nix:315:20:

          314|   */
          315|   escapeShellArg = arg: "'${replaceStrings ["'"] ["'\\''"] (toString arg)}'";
             |                    ^
          316|

       … from call site

       … while evaluating 'concatMapStringsSep'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/strings.nix:110:5:

          109|     # List of input strings
          110|     list: concatStringsSep sep (map f list);
             |     ^
          111|

       … from call site

       at /nix/store/h8c0pidqn3igywxxcrs5358c2v5qngyw-source/modules/files.nix:394:13:

          393|           insertFile ${
          394|             escapeShellArgs [
             |             ^
          395|               (sourceStorePath v)

       … while evaluating anonymous lambda

       at /nix/store/h8c0pidqn3igywxxcrs5358c2v5qngyw-source/modules/files.nix:392:28:

          391|       '' + concatStrings (
          392|         mapAttrsToList (n: v: ''
             |                            ^
          393|           insertFile ${

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/attrsets.nix:356:16:

          355|   mapAttrsToList = f: attrs:
          356|     map (name: f name attrs.${name}) (attrNames attrs);
             |                ^
          357|

       … while evaluating anonymous lambda

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/attrsets.nix:356:10:

          355|   mapAttrsToList = f: attrs:
          356|     map (name: f name attrs.${name}) (attrNames attrs);
             |          ^
          357|

       … from call site

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

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/pkgs/stdenv/generic/make-derivation.nix:205:7:

          204|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          205|       name =
             |       ^
          206|         let

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

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/pkgs/stdenv/generic/make-derivation.nix:205:7:

          204|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          205|       name =
             |       ^
          206|         let

       … while evaluating the attribute 'value'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/types.nix:436:60:

          435|           # Push down position info.
          436|           (map (def: mapAttrs (n: v: { inherit (def) file; value = v; }) def.value) defs)));
             |                                                            ^
          437|       emptyValue = { value = {}; };

       … while evaluating 'dischargeProperties'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:829:25:

          828|   */
          829|   dischargeProperties = def:
             |                         ^
          830|     if def._type or "" == "merge" then

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:758:137:

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

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

       … while evaluating anonymous lambda

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:757:28:

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

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:757:17:

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

       … while evaluating the attribute 'values'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:870:7:

          869|     in {
          870|       values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
             |       ^
          871|       inherit highestPrio;

       … while evaluating the attribute 'values'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:771:9:

          770|       in {
          771|         values = defs''';
             |         ^
          772|         inherit (defs'') highestPrio;

       … while evaluating the attribute 'optionalValue'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:789:5:

          788|
          789|     optionalValue =
             |     ^
          790|       if isDefined then { value = mergedValue; }

       … while evaluating anonymous lambda

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/types.nix:432:86:

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

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/attrsets.nix:466:15:

          465|       inherit name;
          466|       value = f name (catAttrs name sets);
             |               ^
          467|     }) names);

       … while evaluating the attribute 'ExecStart'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/attrsets.nix:466:7:

          465|       inherit name;
          466|       value = f name (catAttrs name sets);
             |       ^
          467|     }) names);

       … while evaluating anonymous lambda

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/types.nix:432:51:

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

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/attrsets.nix:225:62:

          224|   filterAttrs = pred: set:
          225|     listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set));
             |                                                              ^
          226|

       … while evaluating anonymous lambda

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/attrsets.nix:225:29:

          224|   filterAttrs = pred: set:
          225|     listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set));
             |                             ^
          226|

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/attrsets.nix:225:18:

          224|   filterAttrs = pred: set:
          225|     listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set));
             |                  ^
          226|

       … while evaluating 'filterAttrs'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/attrsets.nix:224:23:

          223|   */
          224|   filterAttrs = pred: set:
             |                       ^
          225|     listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set));

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/types.nix:432:35:

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

       … while evaluating 'merge'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/types.nix:431:20:

          430|       check = isAttrs;
          431|       merge = loc: defs:
             |                    ^
          432|         mapAttrs (n: v: v.value) (filterAttrs (n: v: v ? value) (zipAttrsWith (name: defs:

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:779:59:

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

       … while evaluating the attribute 'mergedValue'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:777:5:

          776|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
          777|     mergedValue =
             |     ^
          778|       if isDefined then

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

       … while evaluating the attribute 'value'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:743:9:

          742|     in warnDeprecation opt //
          743|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          744|         inherit (res.defsFinal') highestPrio;

       … while evaluating anonymous lambda

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:293:72:

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

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/attrsets.nix:401:20:

          400|               then recurse (path ++ [name]) value
          401|               else f (path ++ [name]) value;
             |                    ^
          402|         in mapAttrs g;

       … while evaluating 'g'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/attrsets.nix:398:19:

          397|           g =
          398|             name: value:
             |                   ^
          399|             if isAttrs value && cond value

       … from call site

       … while evaluating 'optional'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/lists.nix:255:20:

          254|   */
          255|   optional = cond: elem: if cond then [elem] else [];
             |                    ^
          256|

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/nixos/modules/system/boot/systemd.nix:419:16:

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

       … while evaluating anonymous lambda

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/nixos/modules/system/boot/systemd.nix:412:16:

          411|       mapAttrsToList
          412|         (name: service:
             |                ^
          413|           let

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/attrsets.nix:356:16:

          355|   mapAttrsToList = f: attrs:
          356|     map (name: f name attrs.${name}) (attrNames attrs);
             |                ^
          357|

       … while evaluating anonymous lambda

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/attrsets.nix:356:10:

          355|   mapAttrsToList = f: attrs:
          356|     map (name: f name attrs.${name}) (attrNames attrs);
             |          ^
          357|

       … from call site

       … while evaluating the attribute 'value'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:578:44:

          577|       defnsByName' = byName "config" (module: value:
          578|           [{ inherit (module) file; inherit value; }]
             |                                            ^
          579|         ) configs;

       … while evaluating 'dischargeProperties'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:829:25:

          828|   */
          829|   dischargeProperties = def:
             |                         ^
          830|     if def._type or "" == "merge" then

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:758:137:

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

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

       … while evaluating anonymous lambda

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:757:28:

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

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:757:17:

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

       … while evaluating the attribute 'values'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:870:7:

          869|     in {
          870|       values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
             |       ^
          871|       inherit highestPrio;

       … while evaluating the attribute 'values'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:771:9:

          770|       in {
          771|         values = defs''';
             |         ^
          772|         inherit (defs'') highestPrio;

       … while evaluating the attribute 'mergedValue'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:777:5:

          776|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
          777|     mergedValue =
             |     ^
          778|       if isDefined then

       … while evaluating the option `warnings':

       … while evaluating the attribute 'value'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:743:9:

          742|     in warnDeprecation opt //
          743|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          744|         inherit (res.defsFinal') highestPrio;

       … while evaluating anonymous lambda

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:293:72:

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

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/attrsets.nix:401:20:

          400|               then recurse (path ++ [name]) value
          401|               else f (path ++ [name]) value;
             |                    ^
          402|         in mapAttrs g;

       … while evaluating 'g'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/attrsets.nix:398:19:

          397|           g =
          398|             name: value:
             |                   ^
          399|             if isAttrs value && cond value

       … from call site

       … while evaluating 'fold''

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/lists.nix:56:15:

           55|       len = length list;
           56|       fold' = n:
             |               ^
           57|         if n == len

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/lists.nix:60:8:

           59|         else op (elemAt list n) (fold' (n + 1));
           60|     in fold' 0;
             |        ^
           61|

       … while evaluating 'foldr'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/lists.nix:53:20:

           52|   */
           53|   foldr = op: nul: list:
             |                    ^
           54|     let

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/trivial.nix:407:33:

          406|
          407|   showWarnings = warnings: res: lib.foldr (w: x: warn w x) res warnings;
             |                                 ^
          408|

       … while evaluating 'showWarnings'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/trivial.nix:407:28:

          406|
          407|   showWarnings = warnings: res: lib.foldr (w: x: warn w x) res warnings;
             |                            ^
          408|

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/nixos/modules/system/activation/top-level.nix:136:10:

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

       … while evaluating 'fold''

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/lists.nix:56:15:

           55|       len = length list;
           56|       fold' = n:
             |               ^
           57|         if n == len

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/lists.nix:60:8:

           59|         else op (elemAt list n) (fold' (n + 1));
           60|     in fold' 0;
             |        ^
           61|

       … while evaluating 'foldr'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/lists.nix:53:20:

           52|   */
           53|   foldr = op: nul: list:
             |                    ^
           54|     let

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/nixos/modules/system/activation/top-level.nix:139:12:

          138|   # Replace runtime dependencies
          139|   system = foldr ({ oldDependency, newDependency }: drv:
             |            ^
          140|       pkgs.replaceDependency { inherit oldDependency newDependency drv; }

       … while evaluating the attribute 'value'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:578:44:

          577|       defnsByName' = byName "config" (module: value:
          578|           [{ inherit (module) file; inherit value; }]
             |                                            ^
          579|         ) configs;

       … while evaluating 'dischargeProperties'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:829:25:

          828|   */
          829|   dischargeProperties = def:
             |                         ^
          830|     if def._type or "" == "merge" then

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:758:137:

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

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

       … while evaluating anonymous lambda

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:757:28:

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

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:757:17:

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

       … while evaluating the attribute 'values'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:870:7:

          869|     in {
          870|       values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
             |       ^
          871|       inherit highestPrio;

       … while evaluating the attribute 'values'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:771:9:

          770|       in {
          771|         values = defs''';
             |         ^
          772|         inherit (defs'') highestPrio;

       … while evaluating the attribute 'mergedValue'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:777:5:

          776|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
          777|     mergedValue =
             |     ^
          778|       if isDefined then

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

       … while evaluating the attribute 'value'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:743:9:

          742|     in warnDeprecation opt //
          743|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          744|         inherit (res.defsFinal') highestPrio;

       … while evaluating anonymous lambda

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/modules.nix:293:72:

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

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/attrsets.nix:401:20:

          400|               then recurse (path ++ [name]) value
          401|               else f (path ++ [name]) value;
             |                    ^
          402|         in mapAttrs g;

       … while evaluating 'g'

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/attrsets.nix:398:19:

          397|           g =
          398|             name: value:
             |                   ^
          399|             if isAttrs value && cond value

       … from call site

       … while evaluating anonymous lambda

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/attrsets.nix:518:24:

          517|     let f = attrPath:
          518|       zipAttrsWith (n: values:
             |                        ^
          519|         let here = attrPath ++ [n]; in

       … from call site

       at /nix/store/yyddvwq452qsvpgb104mllpq0hkkmsqx-source/lib/attrsets.nix:466:15:

          465|       inherit name;
          466|       value = f name (catAttrs name sets);
             |               ^
          467|     }) names);

Here is neovim/module.nix

{ config, pkgs, lib, ... }:

let
  mkLuaConfig = file: "lua << EOF\n" + builtins.readFile file + "\nEOF";
in
{
  programs.neovim = {
    enable = true;
    # Alias `vim` to nvim
    vimAlias = true;
    # Extra vimscript
    extraConfig = builtins.readFile ./config.vim;
    # Extra packages eg. ones that are needed for LSP
    extraPackages = with pkgs; with pkgs.nodePackages; [
      vscode-langservers-extracted
      typescript-language-server
      prettier
      eslint

      rnix-lsp

      rust-analyzer
      rustfmt

      vim-language-server
    ];
    # Python LSP packages
    extraPython3Packages = (ps: with ps; [
      python-lsp-server

      autopep8
      rope
      pyflakes
      pycodestyle
      pydocstyle
    ]);
    # Plugins
    plugins = with pkgs.vimPlugins; with opkgs.vimPlugins; [
      # Better tables in markdown
      # {
      #   plugin = vim-table-mode;
      #   config = builtins.readFile ./pluginConfig/vim-table-mode.vim;
      # }
      # Treesitter, a really good syntax highlighting plugin
      {
        plugin = nvim-treesitter.withPlugins (p: with p; [
          tree-sitter-html
          tree-sitter-css
          tree-sitter-javascript
          tree-sitter-typescript
          tree-sitter-json
          tree-sitter-python
          tree-sitter-nix
          tree-sitter-markdown
        ]);
        config = mkLuaConfig ./pluginConfig/nvim-treesitter.lua;
      }
      # Vim plugin for surrounding like [] or {}
      vim-surround
      # Better cutting in vim
      {
        plugin = vim-cutlass;
        config = builtins.readFile ./pluginConfig/vim-cutlass.vim;
      }
      nord-vim
      # {
      #   plugin = (pkgs.vimPlugins.base16-vim.overrideAttrs (old:
      #     let schemeFile = config.scheme base16-vim;
      #     in { patchPhase = ''cp ${schemeFile} colors/base16-scheme.vim''; }
      #   ));
      #   extraConfig = ''
      #     set termguicolors
      #     colorscheme base16-scheme
      #     set background=dark
      #     let base16colorspace=256
      #   '';
      # }
      vim-nix
      # Syntax-based completion for over 600 languages
      {
        plugin = syntaxcomplete;
        config = builtins.readFile ./pluginConfig/syntaxcomplete.vim;
      }
      # Provides really good snippets
      friendly-snippets
      # Amazing file tree
      {
        plugin = nvim-tree-lua;
        config = builtins.readFile ./pluginConfig/nvim-tree-lua.vim;
      }
      # Icons for certain plugins
      nvim-web-devicons
      vim-devicons
      # Git support in vim
      vim-fugitive
      vim-gitgutter
      # Asynchronous goodies
      vim-dispatch
      # Lua-based statusline
      {
        plugin = lualine-nvim;
        config = mkLuaConfig (builtins.readFile (config.scheme {
          template = ./pluginConfig/lualine-nvim.lua;
          extension = ".lua";
        }));
      }
      vim-tpipeline
      # Beautiful bufferline
      {
        plugin = bufferline-nvim;
        config = mkLuaConfig ./pluginConfig/bufferline-nvim.lua;
      }
      # HTML Preview plugin
      {
        plugin = bracey-vim;
        config = builtins.readFile ./pluginConfig/bracey.vim;
      }
      # Really good snippet engine
      {
        plugin = luasnip;
        config = mkLuaConfig ./pluginConfig/luasnip.lua;
      }
      cmp_luasnip
      # Easily configure neovim's built-in LSP
      {
        plugin = nvim-lspconfig;
        config = mkLuaConfig ./pluginConfig/nvim-lspconfig.lua;
      }
      cmp-nvim-lsp
      # Extra goodies for using neovim's built-in LSP
      {
        plugin = lspsaga-nvim;
        config = builtins.readFile ./pluginConfig/lspsaga.vim;
      }
      # Make completions using neovim's built-in LSP
      {
        plugin = nvim-cmp;
        config = mkLuaConfig ./pluginConfig/nvim-cmp.lua;
      }
      cmp-buffer
      cmp-calc
      cmp-emoji
      cmp-latex-symbols
      cmp-nvim-lua
      cmp-path
      cmp-spell
      cmp-treesitter
      # Icons for LSP completions
      lspkind-nvim
      # Extra tools for rust
      {
        plugin = rust-tools-nvim;
        config = mkLuaConfig ./pluginConfig/rust-tools-nvim.lua;
      }
      {
        plugin = crates-nvim;
        config = mkLuaConfig ./pluginConfig/crates-nvim.lua;
      }
      # Automatically pair things like [ with ] and { with }
      {
        plugin = nvim-autopairs;
        config = mkLuaConfig ./pluginConfig/nvim-autopairs.lua;
      }
      # Really nice fuzzy finder
      skim-vim
      # Code formatting front-end (beatifier)
      {
        plugin = neoformat;
        config = builtins.readFile ./pluginConfig/neoformat.vim;
      }
      # Comment stuff out really easily
      {
        plugin = commentary;
        config = builtins.readFile ./pluginConfig/commentary.vim;
      }
      # Focus easily
      goyo
      {
        plugin = limelight-vim;
        config = builtins.readFile ./pluginConfig/limelight.vim;
      }
      # Use vim in the browser
      firenvim
      # Better scrolling
      sexy-scroller
      # Tmux plugins
      vim-tmux-navigator
      vim-tmux-resizer
      vim-tmux
      # .editorconfig support
      editorconfig-nvim
    ];
  };

  # Set neovim as the default editor
  home.sessionVariables = rec {
    EDITOR = "${config.programs.neovim.package}/bin/nvim";
    VISUAL = EDITOR;
  };
}

Maintainer CC

No response

System information

- system: `"x86_64-linux"`
 - host os: `Linux 5.15.26, NixOS, 22.05 (Quokka)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.6.1`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
teto commented 2 years ago

the message says that one of your package is not of type package. Do you by any chance override the neovim package somewhere ? it should be doable to bisect (with git or not).

NB: you can now add type = "lua"; to

{
plugin = syntaxcomplete;
config = builtins.readFile ./pluginConfig/syntaxcomplete.vim;
}

then you dont need heredoc syntax and can just source the generated lua file.

berbiche commented 2 years ago

The issue is that the generated package (which is the one added to the environment, not the user provided package) fails to generate.

See https://github.com/nix-community/home-manager/blob/882bd8118bdbff3a6e53e5ced393932b351ce2f6/modules/programs/neovim.nix#L387-L387 https://github.com/nix-community/home-manager/blob/882bd8118bdbff3a6e53e5ced393932b351ce2f6/modules/programs/neovim.nix#L405-L411

The error happens in wrapNeovimUnstable where it probably returns null or an expression that is not a derivation.

TheOPtimal commented 2 years ago

the message says that one of your package is not of type package. Do you by any chance override the neovim package somewhere ? it should be doable to bisect (with git or not).

NB: you can now add type = "lua"; to

{
plugin = syntaxcomplete;
config = builtins.readFile ./pluginConfig/syntaxcomplete.vim;
}

then you dont need heredoc syntax and can just source the generated lua file.

Thing is, bisect wouldn't work because my config has been broken for a while.

TheOPtimal commented 2 years ago

The issue is that the generated package (which is the one added to the environment, not the user provided package) fails to generate.

See

https://github.com/nix-community/home-manager/blob/882bd8118bdbff3a6e53e5ced393932b351ce2f6/modules/programs/neovim.nix#L387-L387

https://github.com/nix-community/home-manager/blob/882bd8118bdbff3a6e53e5ced393932b351ce2f6/modules/programs/neovim.nix#L405-L411

The error happens in wrapNeovimUnstable where it probably returns null or an expression that is not a derivation.

How do I find out what's causing that?

teto commented 2 years ago

Thing is, bisect wouldn't work because my config has been broken for a while.

git bisect is log n so it looks tractable but I didn't necessarily mean git bisect but just commenting out nix code in your neovim/module.nix

also EDITOR = "${config.programs.neovim.package}/bin/nvim"; should probably be EDITOR = "${config.programs.neovim.finalPackage}/bin/nvim";

berbiche commented 2 years ago

the message says that one of your package is not of type package. Do you by any chance override the neovim package somewhere ? it should be doable to bisect (with git or not). NB: you can now add type = "lua"; to

{
plugin = syntaxcomplete;
config = builtins.readFile ./pluginConfig/syntaxcomplete.vim;
}

then you dont need heredoc syntax and can just source the generated lua file.

Thing is, bisect wouldn't work because my config has been broken for a while.

Sorry there's no action to take on your side, my comment was directed to @teto but I did not address them directly initially.

TheOPtimal commented 2 years ago

What do I do? My NixOS system has gotten very out of date

teto commented 2 years ago

have you tried to comment out some of neovim config to see what triggers the error ?

TheOPtimal commented 2 years ago

have you tried to comment out some of neovim config to see what triggers the error ?

Yes, tried to comment out a bunch of packages. None of them made a difference

teto commented 2 years ago

I mean starting from

  programs.neovim = {
    enable = true;
 }

   # Set neovim as the default editor
  home.sessionVariables = rec {
  };

and then uncommenting little by little to know which parts raise the error.

TheOPtimal commented 2 years ago

Just figured out the issue, I am an IDIOT. Instead of putting module.nix in imports, I accidentally put it in home.packages. Sorry for wasting your time, I feel like I should've figured that out earlier

MatrixManAtYrService commented 11 months ago

@TheOPtimal I'm running into this also. It happens when I add rust to home.packages (here). The command I'm running is:

nix run nix-darwin -- switch --flake .#LIGO

And the error is

error:
       … while calling the 'derivationStrict' builtin

         at /builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'darwin-system-24.05.20231129.e92039b+darwin4.4b9b83d'
         whose name attribute is located at /nix/store/cjvwy2rr87ir1nb6wvs9n6lvbnzlqrdg-source/pkgs/stdenv/generic/make-derivation.nix:348:7

       … while evaluating attribute 'activationScript' of derivation 'darwin-system-24.05.20231129.e92039b+darwin4.4b9b83d'

         at /nix/store/wki8fh5iv47w07xpw1ly5xliz6bdbh26-source/modules/system/default.nix:95:7:

           94|
           95|       activationScript = cfg.activationScripts.script.text;
             |       ^
           96|       activationUserScript = cfg.activationScripts.userScript.text;

       … while calling 'g'
...
         at /nix/store/cjvwy2rr87ir1nb6wvs9n6lvbnzlqrdg-source/lib/types.nix:511:14:

          510|       merge = loc: defs:
          511|         map (x: x.value) (filter (x: x ? value) (concatLists (imap1 (n: def:
             |              ^
          512|           imap1 (m: def':

       error: A definition for option `home-manager.users.matt.home.packages."[definition 13-entry 1]"' is not of type `package'. Definition values:
       - In `/nix/store/afabzcsliqdq0njcw8h1b4rpxvybm7fg-source/home-manager/rust.nix':
           {
             IsNoStdTarget = <function>;
             envVars = {
               ccForBuild = "/nix/store/dgmdis15d7s7vlkfkz5w5b2wnna2syfz-clang-wrapper-16.0.6/bin/cc";
               ccForHost = "/nix/store/dgmdis15d7s7vlkfkz5w5b2wnna2syfz-clang-wrapper-16.0.6/bin/cc";
           ...

Any ideas?

rycee commented 11 months ago

@MatrixManAtYrService Unfortunately, the rust attribute is not actually a package, which certainly can be a bit confusing. You'll want to include pkgs.rustc and pkgs.cargo, instead. Have a look at the documentation for Nixpkgs: https://nixos.org/manual/nixpkgs/unstable/#rust