Skip to content

Commit ef702b4

Browse files
committed
README.md: add Building the project with Nix-build section
1 parent 5de67e7 commit ef702b4

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,52 @@ cabal v2-run hnix -- --help
138138
(`--` is for separation between `cabal` & `hnix` args)
139139

140140

141+
### Using the Nix-build
142+
143+
There is a number of build options to use with `nix-build`, documentation of them is in: `./default.nix`, keys essentially pass-through the [Nixpkgs Haskell Lib API](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/haskell-modules/lib.nix).
144+
145+
Options can be used as:
146+
```
147+
nix-build \
148+
--arg <option1> <argument1> \
149+
--arg <option2> <argument2> \
150+
--argstr <option3> "<strinTypeArg>"
151+
```
152+
153+
#### Run benchmarks
154+
155+
```
156+
nix-build \
157+
--arg disableOptimization false \
158+
--arg enableDeadCodeElimination true \
159+
--arg doStrip true \
160+
--arg doBenchmark true
161+
```
162+
163+
#### With profiling
164+
165+
```
166+
nix-build \
167+
--arg disableOptimization false \
168+
--arg enableDeadCodeElimination true \
169+
--arg enableLibraryProfiling true \
170+
--arg enableExecutableProfiling true
171+
```
172+
173+
#### With full debug info
174+
175+
```
176+
nix-build \
177+
--arg disableOptimization false \
178+
--arg enableDeadCodeElimination true \
179+
--arg doBenchmark true \
180+
--arg doStrip false \
181+
--arg enableLibraryProfiling true \
182+
--arg enableExecutableProfiling true
183+
--arg doTracing true \
184+
--arg enableDWARFDebugging true
185+
```
186+
141187
## Using the HNix REPL
142188

143189
To enter in:

0 commit comments

Comments
 (0)