Skip to content

Commit 2672187

Browse files
committed
Added instructions to start with cabal2nix and running cabal update
1 parent b08d117 commit 2672187

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ This uses Nix and Cabal without Stack. This is because when using Nix, you don't
77
The first step is that we have to acquire `cabal2nix`, which we use to generate a `cabal.nix` file from the `package.yaml`. Note that the usage of `package.yaml` means we are using the [hpack format](https://github.com/sol/hpack). This format is transformed to a cabal file via the `hpack` command.
88

99
```sh
10+
nix-shell -p cabal2nix
1011
# using --hpack ensures that we always use package.yaml
1112
cabal2nix --hpack . >./cabal.nix
1213
```
@@ -15,6 +16,8 @@ The above command is also executed at the beginning of the `shellHook`.
1516

1617
This `cabal.nix` will be imported by the `default.nix` to be used as the core derivation. Unlike other `*2nix` tools, this still retains package sharing, because the generated `cabal.nix` expects the current package's dependencies to be passed down from a higher level package set.
1718

19+
If this is the first time you've ran `cabal`, then run `cabal update` to get the latest package list in `~/.cabal`.
20+
1821
## Developing inside `nix-shell`
1922

2023
Run `nix-shell`, and once you're inside, you can use:

0 commit comments

Comments
 (0)