mirror of
https://codeberg.org/mhwombat/nix-book.git
synced 2025-12-28 01:05:02 +08:00
53 lines
834 B
Text
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
|
|
////
|