Gabriella439 / haskell-nix

Nix and Haskell in production
1.14k stars 116 forks source link

Unable to Build project0 #96

Closed dogatkeyboard closed 2 years ago

dogatkeyboard commented 2 years ago

Having trouble getting started with this tutorial. When I try to build project0, I experience the following error:

$ nix-build release0.nix
error: attribute 'lib' missing

       at /home/humblepie/haskell-nix/project0/project0.nix:9:13:

            8|   executableHaskellDepends = [ base ];
            9|   license = stdenv.lib.licenses.bsd3;
             |             ^
           10| }
(use '--show-trace' to show detailed location information)

Any insights on what I might be doing wrong on my end? My environment is:

dogatkeyboard commented 2 years ago

Looks like changing the project0.nix file to remove stdenv and use lib instead fixes this:

{ mkDerivation, base, lib }:
mkDerivation {
  pname = "project0";
  version = "1.0.0";
  src = ./.;
  isLibrary = false;
  isExecutable = true;
  executableHaskellDepends = [ base ];
  license = lib.licenses.bsd3;
}