nix-book/source/recipes/devshell/haskell-flake/main.adoc0
Amy de Buitléir 595d08319e temp
2025-09-13 20:41:15 +01:00

53 lines
834 B
Text

= Access to a Haskell package defined in a flake
////
$ mkdir tempwork
$ cd tempwork
$ cp ../flake.nix .
$ git add flake.nix
$ nix develop
$ git add flake.lock
$ git commit -a -m temp
////
In this example we will access three Haskell packages
(`pandoc-linear-table`, `pandoc-logic-proof`, and `pandoc-columns`)
that are defined as flakes on my hard drive.
We are using `haskell-flake`, so the development environment is
set up automatically; no need to define `devShells`.
[source,nix,linenums]
.flake.nix
....
include::flake.nix[]
....
Here's a demonstration using the shell.
....
$# ../../../../../start-shell nix develop <<EOL
$ cabal info pandoc-columns
$# EOL
....
FINISH
FINISH
FINISH
FINISH
FINISH
FINISH
FINISH
FINISH
////
Good adoc0 scripts clean up after themselves.
$ cd .. ; rm -rf tempwork # clean up
////