= Access a Haskell library package in the nixpkgs repo (without using a `.cabal` file) //// $ mkdir tempwork $ cd tempwork $ cp ../Main.hs ../flake.nix . $ git add Main.hs flake.nix $ nix develop $ git add flake.lock $ git commit -a -m temp //// Occasionally you might want to run a short Haskell program that depends on a Haskell library, but you don't want to bother writing a cabal file. In this example, we will access the `extra` package from the `haskellPackages` set in the nixpkgs repo. [NOTE] ==== For non-trivial Haskell development projects, it's usually more convenient to use `haskell-flake` as described in <<#haskell-flake>>, together with the _high-level workflow_ described in <<_development_workflows>>. ==== [source,nix,linenums,highlight='11,16'] .flake.nix .... include::flake.nix[] .... Line 12 makes a custom GHC that knows about `extra`, and line 16 makes that custom GHC available in the development environment. Here's a short Haskell program that uses the new flake. [source,haskell,linenums] .Main.hs .... include::Main.hs[] .... Here's a demonstration using the program. .... $ runghc Main.hs # Fails; dependency not available $# start-shell nix develop <