Skip to content

Commit 11dc625

Browse files
Merge request #734 README-restructuring-03
Adding `nix-build`.
2 parents 407e30f + 78ead04 commit 11dc625

File tree

1 file changed

+60
-7
lines changed

1 file changed

+60
-7
lines changed

README.md

Lines changed: 60 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,17 @@ env ALL_TESTS=yes cabal v2-test
100100
env NIXPKGS_TESTS=yes PRETTY_TESTS=1 cabal v2-test
101101
```
102102

103-
### Building the project
103+
#### Building the project
104104

105-
#### With benchmarks
105+
##### With benchmarks
106106

107107
To run benchmarks:
108108

109109
```
110110
cabal v2-bench
111111
```
112112

113-
#### With profiling
113+
##### With profiling
114114

115115
To build `hnix` with profiling enabled:
116116

@@ -119,7 +119,7 @@ cabal v2-configure --enable-tests --enable-profiling --flags=profiling
119119
cabal v2-run hnix -- <args> +RTS -p
120120
```
121121

122-
#### With full debug info
122+
##### With full debug info
123123

124124
To build `hnix` for debugging, with full tracing output and stack traces:
125125

@@ -131,16 +131,69 @@ cabal v2-run hnix -- -v5 --trace <args> +RTS -xc
131131
Note that this going to run quite slowly, but would give the most information as to what happens during parsing & evaluation.
132132

133133

134-
### Run HNix:
134+
#### Run HNix
135135
```
136136
cabal v2-run hnix -- --help
137137
```
138138
(`--` is for separation between `cabal` & `hnix` args)
139139

140140

141-
## Entering the HNix REPL
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+
187+
#### Run the result
188+
189+
```
190+
./result/bin/hnix
191+
```
192+
193+
194+
## Using the HNix REPL
142195

143-
Enter the REPL:
196+
To enter in:
144197
```
145198
hnix --repl
146199
```

0 commit comments

Comments
 (0)