Skip to content

Commit 567e076

Browse files
authored
Merge pull request kadena-io#129 from kadena-io/use-stack-with-nix
Add stack-nix.yaml and description of nix incremental builds
2 parents 06d492b + dc7607c commit 567e076

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

‎README.md‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,26 @@ sudo systemctl restart nix-daemon.service
140140

141141
5. Run `nix-build` from the project root
142142

143+
### Incremental Builds
144+
145+
Building with `nix-build` does a full rebuild every time, which is usually not
146+
what you want when developing. To do incremental builds, you need to enter a nix
147+
shell. To do that use the following command:
148+
149+
```
150+
$ nix-shell -A shells.ghc
151+
```
152+
153+
This puts you in a shell that has all the necessary dependencies installed. Once
154+
inside this shell you can build as normal with cabal using `cabal build` or
155+
`cabal new-build`.
156+
157+
You can also build with stack inside this shell as follows:
158+
159+
```
160+
$ stack --stack-yaml stack-nix.yaml build
161+
```
162+
143163
License
144164
---
145165

‎stack-nix.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
resolver: ghc-8.0.2
2+
system-ghc: true
3+
install-ghc: false

0 commit comments

Comments
 (0)