README.md: add Building the project with Nix-build section

This commit is contained in:
Anton-Latukha 2020-09-30 18:21:43 +03:00
parent 5de67e72e1
commit ef702b48ec
No known key found for this signature in database
GPG Key ID: 3D84C07E91802E41
1 changed files with 46 additions and 0 deletions

View File

@ -138,6 +138,52 @@ cabal v2-run hnix -- --help
(`--` is for separation between `cabal` & `hnix` args)
### Using the Nix-build
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).
Options can be used as:
```
nix-build \
--arg <option1> <argument1> \
--arg <option2> <argument2> \
--argstr <option3> "<strinTypeArg>"
```
#### Run benchmarks
```
nix-build \
--arg disableOptimization false \
--arg enableDeadCodeElimination true \
--arg doStrip true \
--arg doBenchmark true
```
#### With profiling
```
nix-build \
--arg disableOptimization false \
--arg enableDeadCodeElimination true \
--arg enableLibraryProfiling true \
--arg enableExecutableProfiling true
```
#### With full debug info
```
nix-build \
--arg disableOptimization false \
--arg enableDeadCodeElimination true \
--arg doBenchmark true \
--arg doStrip false \
--arg enableLibraryProfiling true \
--arg enableExecutableProfiling true
--arg doTracing true \
--arg enableDWARFDebugging true
```
## Using the HNix REPL
To enter in: