Skip to content

Commit b93202f

Browse files
committed
README: reintroduce the shell highlighting
To splash some color to draw eyes into the boring readme. Myself removed it before and now introduce again, seems that highlighting algs become somewhat tolerable.
1 parent 5bf4d39 commit b93202f

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

README.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ Tooling is WIP, `nix-shell` and `nix-store` are still used for their purpose, so
4747

4848
## Getting Started
4949

50-
```
50+
```shell
5151
# Note: --recursive
52-
git clone --recursive https://github.com/haskell-nix/hnix.git
52+
git clone --recursive 'https://github.com/haskell-nix/hnix.git'
5353
cd hnix
5454
```
5555

@@ -68,35 +68,35 @@ If you opt in to use of Nix environment, please enable the official HNix Cachix
6868
Cabal [Quickstart](https://cabal.readthedocs.io/en/3.4/nix-local-build.html).
6969

7070
1. (Optional), to enter the projects reproducible Nix environment:
71-
```
71+
```shell
7272
nix-shell
7373
```
7474

7575
2. Building:
76-
```
76+
```shell
7777
cabal v2-configure
7878
cabal v2-build
7979
```
8080

8181
3. Loading the project into `ghci` REPL:
82-
```
82+
```shell
8383
cabal v2-repl
8484
```
8585

8686
4. Testing:
8787

8888
* Default suite:
89-
```
89+
```shell
9090
cabal v2-test
9191
```
9292

9393
* All available tests:
94-
```
94+
```shell
9595
env ALL_TESTS=yes cabal v2-test
9696
```
9797

9898
* Selected (list of tests is in `tests/Main.hs`):
99-
```
99+
```shell
100100
env NIXPKGS_TESTS=yes PRETTY_TESTS=1 cabal v2-test
101101
```
102102

@@ -106,15 +106,15 @@ env NIXPKGS_TESTS=yes PRETTY_TESTS=1 cabal v2-test
106106

107107
To run benchmarks:
108108

109-
```
109+
```shell
110110
cabal v2-bench
111111
```
112112

113113
##### With profiling
114114

115115
To build `hnix` with profiling enabled:
116116

117-
```
117+
```shell
118118
cabal v2-configure --enable-tests --enable-profiling --flags=profiling
119119
cabal v2-run hnix -- <args> +RTS -p
120120
```
@@ -123,7 +123,7 @@ cabal v2-run hnix -- <args> +RTS -p
123123

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

126-
```
126+
```shell
127127
cabal v2-configure --enable-tests --enable-profiling --flags=profiling --flags=tracing
128128
cabal v2-run hnix -- -v5 --trace <args> +RTS -xc
129129
```
@@ -132,7 +132,7 @@ Note that this going to run quite slowly, but would give the most information as
132132

133133

134134
#### Run HNix
135-
```
135+
```shell
136136
cabal v2-run hnix -- --help
137137
```
138138
(`--` is for separation between `cabal` & `hnix` args)
@@ -143,7 +143,7 @@ cabal v2-run hnix -- --help
143143
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).
144144

145145
Options can be used as:
146-
```
146+
```shell
147147
nix-build \
148148
--arg <option1> <argument1> \
149149
--arg <option2> <argument2> \
@@ -152,7 +152,7 @@ nix-build \
152152

153153
#### Run benchmarks
154154

155-
```
155+
```shell
156156
nix-build \
157157
--arg disableOptimization false \
158158
--arg enableDeadCodeElimination true \
@@ -162,7 +162,7 @@ nix-build \
162162

163163
#### With profiling
164164

165-
```
165+
```shell
166166
nix-build \
167167
--arg disableOptimization false \
168168
--arg enableDeadCodeElimination true \
@@ -172,7 +172,7 @@ nix-build \
172172

173173
#### With full debug info
174174

175-
```
175+
```shell
176176
nix-build \
177177
--arg disableOptimization false \
178178
--arg enableDeadCodeElimination true \
@@ -186,13 +186,13 @@ nix-build \
186186

187187
#### Run the result
188188

189-
```
189+
```shell
190190
./result/bin/hnix
191191
```
192192

193193
## Development status loop with amazing [`ghcid`](https://github.com/ndmitchell/ghcid)
194194

195-
```
195+
```shell
196196
ghcid --command="cabal v2-repl --repl-options=-fno-code --repl-options=-fno-break-on-exception --repl-options=-fno-break-on-error --repl-options=-v1 --repl-options=-ferror-spans --repl-options=-j"
197197
```
198198
(optional) To use projects reproducible environment, wrap `ghcid ...` command into a `nix-shell --command ' '`.
@@ -203,12 +203,12 @@ For simplicity `alias` the command in your shell.
203203
## Using the HNix REPL
204204

205205
Enter in:
206-
```
206+
```shell
207207
hnix --repl
208208
```
209209

210210
Evaluate an expression:
211-
```
211+
```shell
212212
hnix --eval -E '(import <nixpkgs> {}).pkgs.hello' --repl
213213
```
214214
This also binds the evaluated expression result to the `input` variable, so that variable can be inspected.
@@ -219,7 +219,7 @@ Use the `:help` command for a list of all available REPL commands.
219219

220220
Nix is a lazy language with the ability of recursion, so by default REPL and eval prints are lazy:
221221

222-
```
222+
```shell
223223
hnix \
224224
--eval \
225225
--expr '{ x = true; }'
@@ -229,7 +229,7 @@ hnix \
229229

230230
To disable laziness add the `--strict` to commands or `:set strict` in the REPL.
231231

232-
```
232+
```shell
233233
hnix \
234234
--eval \
235235
# Strictly \
@@ -247,7 +247,7 @@ hnix \
247247

248248
3. When the pull request is ready to be submitted, to save time - please, test it with:
249249

250-
```
250+
```shell
251251
git submodule update --init --recursive
252252
nix-shell --run "LANGUAGE_TESTS=yes cabal v2-test"
253253
```
@@ -258,6 +258,6 @@ Please, check that all tests that were passing prior (most probably all tests me
258258

259259
Currently, the main high-level goal is to be able to evaluate all of Nixpkgs:
260260

261-
```
261+
```shell
262262
hnix --eval -E "import <nixpkgs> {}" --find
263263
```

0 commit comments

Comments
 (0)