input-output-hk / haskell.nix

Alternative Haskell Infrastructure for Nixpkgs
https://input-output-hk.github.io/haskell.nix
Apache License 2.0
559 stars 238 forks source link

Attribute missing when building with flakes #1421

Closed IllustratedMan-code closed 2 years ago

IllustratedMan-code commented 2 years ago

I'm trying to build pandoc. I'm not sure what I am doing wrong, but I am unable to build any executable using a slightly modified flake taken from the tutorial. Here is a link to my code. nix build shows me this error

error: attribute 'pandoc:exe:pandoc' missing

       at /nix/store/aqi3glc0chyf8dh3b16x7xyzpywz1i0b-source/flake.nix:43:24:

           42|       # Built by `nix build .`
           43|       defaultPackage = flake.packages."pandoc:exe:pandoc";
             |                        ^
           44|     });
(use '--show-trace' to show detailed location information)

Running nix develop . I get this error.

error: cannot coerce a function to a string

       at /nix/store/aqi3glc0chyf8dh3b16x7xyzpywz1i0b-source/flake.nix:31:15:

           30|               ];
           31|               shell.crossPlatform = p: [p.ghcjs];
             |               ^
           32|               # This adds `js-unknown-ghcjs-cabal` to the shell.
(use '--show-trace' to show detailed location information)

I'm not sure if I am fundamentally understanding the tutorial or not. I would love some help!

hamishmack commented 2 years ago

Ooops. Should be crossPlatforms not crossPlatform. I've fixed up the example https://github.com/input-output-hk/haskell.nix/pull/1423

IllustratedMan-code commented 2 years ago

Thanks for the help!