yusdacra / nix-cargo-integration

Library to easily and effortlessly integrate Cargo projects with Nix.
https://flake.parts/options/nix-cargo-integration.html
MIT License
190 stars 22 forks source link

error: A definition for option `features' is not of type `attribute set of list of string' #106

Closed yavko closed 1 year ago

yavko commented 1 year ago

Just started happening, idk why

Details ``` error: A definition for option `features' is not of type `attribute set of list of string'. Definition values: - In `/nix/store/gphwcj87jh3b64a8iha6hyj109n84rq7-source/src/lib/namespacedConfigModule.nix': [ ] … while evaluating the attribute 'mergedValue' at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/modules.nix:758:5: 757| # Type-check the remaining definitions, and merge them. Or throw if no definitions. 758| mergedValue = | ^ 759| if isDefined then … while evaluating the option `features': … while evaluating the attribute 'value' at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/modules.nix:723:9: 722| in warnDeprecation opt // 723| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value; | ^ 724| inherit (res.defsFinal') highestPrio; … while evaluating anonymous lambda at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/modules.nix:265:72: 264| # For definitions that have an associated option 265| declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options; | ^ 266| … from call site at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/attrsets.nix:532:20: 531| then recurse (path ++ [name]) value 532| else f (path ++ [name]) value; | ^ 533| in mapAttrs g; … while evaluating 'g' at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/attrsets.nix:529:19: 528| g = 529| name: value: | ^ 530| if isAttrs value && cond value … from call site … while evaluating 'optional' at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/lists.nix:255:20: 254| */ 255| optional = cond: elem: if cond then [elem] else []; | ^ 256| … from call site at /nix/store/gphwcj87jh3b64a8iha6hyj109n84rq7-source/src/build/default.nix:65:19: 64| # Specify --features if we have enabled features other than the default ones 65| featuresFlags = l.optional ((l.length features) > 0) "--no-default-features --features ${(l.concatStringsSep "," features)}"; | ^ 66| # Specify the --profile flag to set the profile we will use for compiling … while evaluating 'applySingleAttributeOverride' at /nix/store/h1afjh95v8q5h6vxz3xxgxj5zs7iddyl-source/src/modules/utils.override/implementation.nix:103:44: 102| # apply single attribute override 103| applySingleAttributeOverride = oldVal: functionOrValue: | ^ 104| if b.isFunction functionOrValue … from call site at /nix/store/h1afjh95v8q5h6vxz3xxgxj5zs7iddyl-source/src/modules/utils.override/implementation.nix:182:13: 181| (attrName: functionOrValue: 182| applySingleAttributeOverride old."${attrName}" functionOrValue) | ^ 183| updateAttrsFuncs)) … while evaluating anonymous lambda at /nix/store/h1afjh95v8q5h6vxz3xxgxj5zs7iddyl-source/src/modules/utils.override/implementation.nix:181:22: 180| l.mapAttrs 181| (attrName: functionOrValue: | ^ 182| applySingleAttributeOverride old."${attrName}" functionOrValue) … from call site … while evaluating anonymous lambda at /nix/store/h1afjh95v8q5h6vxz3xxgxj5zs7iddyl-source/src/subsystems/rust/builders/devshell.nix:106:18: 105| ( 106| n: v: | ^ 107| if ! (l.isAttrs v || l.isFunction v) … from call site at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/attrsets.nix:478:16: 477| attrs: 478| map (name: f name attrs.${name}) (attrNames attrs); | ^ 479| … while evaluating anonymous lambda at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/attrsets.nix:478:10: 477| attrs: 478| map (name: f name attrs.${name}) (attrNames attrs); | ^ 479| … from call site … while evaluating anonymous lambda at /nix/store/h1afjh95v8q5h6vxz3xxgxj5zs7iddyl-source/src/subsystems/rust/builders/devshell.nix:102:12: 101| l.filter 102| (env: (env != null) && (! isIllegalEnv env.name)) | ^ 103| ( … from call site … while evaluating the attribute 'env' at /nix/store/h1afjh95v8q5h6vxz3xxgxj5zs7iddyl-source/src/subsystems/rust/builders/devshell.nix:99:9: 98| ]; 99| env = | ^ 100| # filter out attrsets, functions and illegal environment vars … while evaluating the attribute 'env' at /nix/store/h1afjh95v8q5h6vxz3xxgxj5zs7iddyl-source/src/subsystems/rust/builders/devshell.nix:28:9: 27| commands = l.unique ((c.commands or []) ++ (oc.commands or [])); 28| env = l.unique ((c.env or []) ++ (oc.env or [])); | ^ 29| devshell = … while evaluating the attribute 'value' at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/modules.nix:563:44: 562| defnsByName' = byName "config" (module: value: 563| [{ inherit (module) file; inherit value; }] | ^ 564| ) configs; … while evaluating 'dischargeProperties' at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/modules.nix:810:25: 809| */ 810| dischargeProperties = def: | ^ 811| if def._type or "" == "merge" then … from call site at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/modules.nix:739:137: 738| defs' = concatMap (m: 739| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value)) | ^ 740| ) defs; … while evaluating definitions from `': … while evaluating anonymous lambda at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/modules.nix:738:28: 737| # Process mkMerge and mkIf properties. 738| defs' = concatMap (m: | ^ 739| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value)) … from call site at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/modules.nix:738:17: 737| # Process mkMerge and mkIf properties. 738| defs' = concatMap (m: | ^ 739| 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/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/modules.nix:851:7: 850| in { 851| values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs; | ^ 852| inherit highestPrio; … while evaluating the attribute 'values' at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/modules.nix:752:9: 751| in { 752| values = defs'''; | ^ 753| inherit (defs'') highestPrio; … while evaluating the attribute 'mergedValue' at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/modules.nix:758:5: 757| # Type-check the remaining definitions, and merge them. Or throw if no definitions. 758| mergedValue = | ^ 759| if isDefined then … while evaluating the option `env': … while evaluating the attribute 'value' at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/modules.nix:723:9: 722| in warnDeprecation opt // 723| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value; | ^ 724| inherit (res.defsFinal') highestPrio; … while evaluating anonymous lambda at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/modules.nix:265:72: 264| # For definitions that have an associated option 265| declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options; | ^ 266| … from call site at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/attrsets.nix:532:20: 531| then recurse (path ++ [name]) value 532| else f (path ++ [name]) value; | ^ 533| in mapAttrs g; … while evaluating 'g' at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/attrsets.nix:529:19: 528| g = 529| name: value: | ^ 530| if isAttrs value && cond value … from call site … while evaluating the attribute 'value' at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/modules.nix:563:44: 562| defnsByName' = byName "config" (module: value: 563| [{ inherit (module) file; inherit value; }] | ^ 564| ) configs; … while evaluating 'dischargeProperties' at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/modules.nix:810:25: 809| */ 810| dischargeProperties = def: | ^ 811| if def._type or "" == "merge" then … from call site at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/modules.nix:739:137: 738| defs' = concatMap (m: 739| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value)) | ^ 740| ) defs; … while evaluating definitions from `/nix/store/4cnrzgx9w9cdvwic4iyg0k128b30i44s-source/modules/env.nix': … while evaluating anonymous lambda at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/modules.nix:738:28: 737| # Process mkMerge and mkIf properties. 738| defs' = concatMap (m: | ^ 739| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value)) … from call site at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/modules.nix:738:17: 737| # Process mkMerge and mkIf properties. 738| defs' = concatMap (m: | ^ 739| 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/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/modules.nix:851:7: 850| in { 851| values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs; | ^ 852| inherit highestPrio; … while evaluating the attribute 'values' at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/modules.nix:752:9: 751| in { 752| values = defs'''; | ^ 753| inherit (defs'') highestPrio; … while evaluating the attribute 'mergedValue' at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/modules.nix:758:5: 757| # Type-check the remaining definitions, and merge them. Or throw if no definitions. 758| mergedValue = | ^ 759| if isDefined then … while evaluating the option `devshell.startup_env': … while evaluating the attribute 'value' at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/modules.nix:723:9: 722| in warnDeprecation opt // 723| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value; | ^ 724| inherit (res.defsFinal') highestPrio; … while evaluating anonymous lambda at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/modules.nix:265:72: 264| # For definitions that have an associated option 265| declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options; | ^ 266| … from call site at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/attrsets.nix:532:20: 531| then recurse (path ++ [name]) value 532| else f (path ++ [name]) value; | ^ 533| in mapAttrs g; … while evaluating 'g' at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/lib/attrsets.nix:529:19: 528| g = 529| name: value: | ^ 530| if isAttrs value && cond value … from call site … while evaluating the attribute 'text' of the derivation 'devshell-env.bash' at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/pkgs/stdenv/generic/make-derivation.nix:270:7: 269| // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) { 270| name = | ^ 271| let … while evaluating the attribute 'postBuild' of the derivation 'devshell-dir' at /nix/store/2n3ykdi3lamr8gn2if8wkf0px0kg1bnp-source/pkgs/stdenv/generic/make-derivation.nix:270:7: 269| // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) { 270| name = | ^ 271| let … while evaluating the attribute 'args' of the derivation 'devshell' at /nix/store/4cnrzgx9w9cdvwic4iyg0k128b30i44s-source/nix/mkNakedShell.nix:30:10: 29| (derivation { 30| inherit name system; | ^ 31| ```
yusdacra commented 1 year ago

Are you sure this happens on latest master? Also please post your flake.nix or an MRE of it

yavko commented 1 year ago

flake.nix

# This file is pretty general, and you can adapt it in your project replacing
# only `name` and `description` below.

{
  description = "Hyprland-rs dev shell";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
        #rust-overlay = {
    #  url = "github:oxalica/rust-overlay";
    #  inputs.nixpkgs.follows = "nixpkgs";
    #};
    nci.url = "github:yusdacra/nix-cargo-integration";
    nci.inputs.nixpkgs.follows = "nixpkgs";
  };

  outputs = inputs:
    inputs.nci.lib.makeOutputs {
      root = ./.;
      config = common: {
        shell = {
          packages = with common.pkgs; [ 
                        rust-analyzer
                        cbfmt
                        treefmt
                    ];
        };
      };
    };
}
yusdacra commented 1 year ago

I can't reproduce this, are you sure you are on the latest master?

yavko commented 1 year ago

I can't reproduce this, are you sure you are on the latest master?

I'll try again rn

yavko commented 1 year ago

Seems to work now, after running nix flake update, but strange since it was a new repo with no previous lockfile