devour-flake icon indicating copy to clipboard operation
devour-flake copied to clipboard

Error: cannot coerce a set to a string

Open pcboy opened this issue 2 years ago • 2 comments

I'm trying to run nix run nixpkgs#nixci on my flake, but I'm encountering this error from devour-flake.

🍏 .
🐚 nix --extra-experimental-features 'nix-command flakes' eval '.#nixci.default' --json️
🍎 default.<root>
🐚 nix --extra-experimental-features 'nix-command flakes' flake lock --no-update-lock-file .️
🐚 nix --extra-experimental-features 'nix-command flakes' build '/nix/store/p8vfkmfh43yy8lmz1r65dr9yq3ql7cd7-source#default' -L --no-link --print-out-paths --override-input flake . --refresh -j auto️
error:
       … while calling the 'derivationStrict' builtin

         at /derivation-internal.nix:9:12:

            8|
            9|   strict = derivationStrict drvAttrs;
             |            ^
           10|

       … while evaluating derivation 'devour-output'
         whose name attribute is located at /nix/store/qjqzr7905xxv3rv70z7mkpp06lalnzzb-source/pkgs/stdenv/generic/make-derivation.nix:300:7

       … while evaluating attribute 'text' of derivation 'devour-output'

         at /nix/store/qjqzr7905xxv3rv70z7mkpp06lalnzzb-source/pkgs/build-support/trivial-builders/default.nix:148:16:

          147|     runCommand name
          148|       { inherit text executable checkPhase allowSubstitutes preferLocalBuild;
             |                ^
          149|         passAsFile = [ "text" ];

       error: cannot coerce a set to a string
Error: devour-flake failed to run (exited: 1)

It seems it's happening because one of my outputs is actually of the form:

      packages.pythonPkgs = {
        package1 = pkgs.callPackage ./packages/mypackage1/. {};
        package2 = pkgs.callPackage ./packages/mypackage2/. {};
      };

Is there a way to make that structure work with nixci/devour-output? I'm would like to clearly separate python packages in a pythonPkgs key. Is my way of handling this non standard maybe? :thinking:

pcboy avatar Jan 03 '24 07:01 pcboy

@pcboy Your package structure is not valid according to the flake schema: https://nixos.asia/en/blog/nix-rapid#packages

So, I'm closing this issue. But you are welcome to join our Zulip https://nixos.zulipchat.com/ and continue this discussion there.

srid avatar Jan 03 '24 21:01 srid

@pcboy I misunderstood the issue. https://github.com/srid/devour-flake/pull/11 should address your case, specifically #8.

But let's continue our discussion in Zulip: https://nixos.zulipchat.com/#narrow/stream/413950-nix/topic/2.20level.20deep.20packages.20in.20nix.20flakes

srid avatar Jan 04 '24 13:01 srid