Skip to content

Commit fea80a5

Browse files
Merge request #724 README-clean-up
Casual readme clean-up. Related to #726 Mainly making the language more to the point, terse, direct, and so - understandable. Also structuring of the text. Some fixes to the shell sections. Some of them are still out of dare, would go into fixing all commands in the upcoming PRs. Parsed results: https://github.com/Anton-Latukha/hnix/tree/2020-09-28-README-clean-up
2 parents 5bd4d9e + 0697836 commit fea80a5

File tree

1 file changed

+69
-68
lines changed

1 file changed

+69
-68
lines changed

README.md

Lines changed: 69 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -10,39 +10,62 @@
1010

1111
Haskell parser, evaluator and type checker for the Nix language.
1212

13-
## Prerequisites
13+
## Contents
14+
15+
<!-- TOC -->
16+
- [Prerequisites](#prerequisites)
17+
- [Getting Started](#getting-started)
18+
- [Using the REPL](#using-the-repl)
19+
- [Building with full debug info](#building-with-full-debug-info)
20+
- [Building with benchmarks enabled](#building-with-benchmarks-enabled)
21+
- [Building with profiling enabled](#building-with-profiling-enabled)
22+
- [Using the Cachix binary cache](#using-the-cachix-binary-cache)
23+
- [Contributing](#contributing)
24+
- [Evaluating Nixpkgs with HNix](#evaluating-nixpkgs-with-hnix)
25+
<!-- /TOC -->
1426

15-
Nix is installed and in your `$PATH`. This is so that `nix-store` can be used
16-
for interacting with store paths, until `hnix-store` is ready.
27+
## Prerequisites
28+
Until `hnix-store` is ready, `nix-store` is still used for interacting with the store paths, so Nix is still required installed and available through `$PATH`.
1729

1830
## Getting Started
1931

2032
```
21-
$ git clone --recursive https://github.com/haskell-nix/hnix.git
22-
...
23-
$ cd hnix
24-
$ nix-shell
25-
$ cabal v2-configure --enable-tests
26-
$ cabal v2-build
27-
$ cabal v2-test
28-
# To run all of the tests, which takes up to a minute:
29-
$ env ALL_TESTS=yes cabal v2-test
30-
# To run only specific tests (see `tests/Main.hs` for a list)
31-
$ env NIXPKGS_TESTS=yes PRETTY_TESTS=1 cabal v2-test
32-
$ ./dist/build/hnix/hnix --help
33+
git clone --recursive https://github.com/haskell-nix/hnix.git
34+
cd hnix
35+
nix-shell
36+
cabal v2-configure --enable-tests
37+
cabal v2-build
3338
```
3439

35-
## Using the REPL
40+
Run testing:
41+
* Default:
42+
```
43+
cabal v2-test
44+
```
45+
46+
* All:
47+
```
48+
env ALL_TESTS=yes cabal v2-test
49+
```
3650
37-
To enter the `hnix` REPL use
51+
* Selected (list of tests is in `tests/Main.hs`):
52+
```
53+
env NIXPKGS_TESTS=yes PRETTY_TESTS=1 cabal v2-test
54+
```
3855
56+
Run built binary with Cabal (`--` is for separation between `cabal` & `hnix` args):
3957
```
40-
hnix --repl
58+
cabal v2-run hnix -- --help
4159
```
4260
43-
To evaluate an expression and make it available in the REPL
44-
as the `input` variable use
61+
## Using the REPL
62+
63+
Enter REPL:
64+
```
65+
hnix --repl
66+
```
4567
68+
To evaluate an expression and make it available in the REPL as the `input` variable use:
4669
```
4770
hnix --eval -E '(import <nixpkgs> {}).pkgs.hello' --repl
4871
```
@@ -51,89 +74,67 @@ Use the `:help` command for a list of all available REPL commands.
5174
5275
## Building with full debug info
5376
54-
To build `hnix` for debugging, and with full tracing output and stack traces,
55-
use:
77+
To build `hnix` for debugging, and with full tracing output and stack traces, use:
5678
5779
```
58-
$ nix-shell
59-
$ cabal v2-configure --enable-tests --enable-profiling --flags=profiling --flags=tracing
60-
$ cabal v2-build
61-
$ ./dist/build/hnix/hnix -v5 --trace <args> +RTS -xc
80+
nix-shell
81+
cabal v2-configure --enable-tests --enable-profiling --flags=profiling --flags=tracing
82+
cabal v2-build
83+
cabal v2-run hnix -- -v5 --trace <args> +RTS -xc
6284
```
6385
64-
Note that this will run quite slowly, but will give the most information as to
65-
what might potentially be going wrong during parsing or evaluation.
86+
Note that this will run quite slowly, but will give the most information as to what might potentially be going wrong during parsing or evaluation.
6687
6788
## Building with benchmarks enabled
6889
6990
To build `hnix` with benchmarks enabled:
7091
7192
```
72-
$ nix-shell --arg doBenchmarks true
73-
$ cabal v2-configure --enable-tests --enable-benchmarks
74-
$ cabal v2-build
75-
$ cabal v2-bench
93+
nix-shell
94+
cabal v2-configure --enable-tests --enable-benchmarks
95+
cabal v2-build
96+
cabal v2-bench
7697
```
7798
7899
## Building with profiling enabled
79100
80101
To build `hnix` with profiling enabled:
81102
82103
```
83-
$ nix-shell
84-
$ cabal v2-configure --enable-tests --enable-profiling --flags=profiling
85-
$ cabal v2-build
86-
$ ./dist/build/hnix/hnix <args> +RTS -p
87-
```
88-
89-
## Building with GHCJS
90-
91-
From the project root directory, run:
92-
93-
```
94-
$ NIX_CONF_DIR=$PWD/ghcjs nix-build ghcjs
104+
nix-shell
105+
cabal v2-configure --enable-tests --enable-profiling --flags=profiling
106+
cabal v2-build
107+
cabal v2-run hnix -- <args> +RTS -p
95108
```
96109
97-
This will build an `hnix` library that can be linked to your GHCJS
98-
application.
99-
100110
## Using the Cachix binary cache
101111
102-
If you're on macOS, you can use the binary cache at Cachix to avoid building
103-
the specific dependencies used by hnix. Just use these commands:
112+
If you're on macOS, you can use the binary cache at Cachix to avoid building the specific dependencies used by hnix. Just use these commands:
104113
105114
```
106-
$ nix-env -iA cachix -f https://github.com/NixOS/nixpkgs/tarball/db557aab7b690f5e0e3348459f2e4dc8fd0d9298
107-
$ cachix use hnix
115+
nix-env -iA cachix -f https://github.com/NixOS/nixpkgs/tarball/db557aab7b690f5e0e3348459f2e4dc8fd0d9298
116+
cachix use hnix
108117
```
109118
110-
## How you can help
119+
## Contributing
111120
112-
### Issue Tracker Backlog
121+
1. If something in the [quests](https://github.com/haskell-nix/hnix/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22+no%3Aassignee) looks interesting, look through the thread and leave a comment taking it, to let others know you're working on it.
113122
114-
If you're looking for a way to help out, try taking a look
115-
[here](https://github.com/haskell-nix/hnix/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22+no%3Aassignee).
116-
When you find an issue that looks interesting to you, comment on the ticket to
117-
let others know you're working on it; look for others who might have done the
118-
same. You can talk with everyone live on
119-
[Gitter](https://gitter.im/haskell-nix/Lobby).
123+
2. You are free to chat with everyone on [Gitter](https://gitter.im/haskell-nix/Lobby).
120124
121-
When you're ready to submit a pull request, test it with:
125+
3. When pull request is ready to be submitted, to save time - please, test it with:
122126
123127
```
124-
$ git submodule update --init --recursive
125-
$ nix-shell --run "LANGUAGE_TESTS=yes cabal v2-test"
128+
git submodule update --init --recursive
129+
nix-shell --run "LANGUAGE_TESTS=yes cabal v2-test"
126130
```
127131
128-
Make sure that all the tests that were passing prior to your PR are still
129-
passing afterwards; it's OK if no new tests are passing.
132+
Please, check that all tests that were passing prior (most probably all tests mentioned in the command) are still passing for the PR, it is faster to chech that locally then through CI. It's OK if no new tests are passing.
130133
131134
### Evaluating Nixpkgs with HNix
132135
133-
Currently the main high-level goal is to be able to evaluate all of nixpkgs. To
134-
run this yourself, first build hnix with `nix-build`, then run the following
135-
command:
136+
Currently the main high-level goal is to be able to evaluate all of Nixpkgs. To run this yourself, first build `hnix` with `nix-build`, then run the following command:
136137
137138
```
138-
$ ./result/bin/hnix --eval -E "import <nixpkgs> {}" --find
139+
./result/bin/hnix --eval -E "import <nixpkgs> {}" --find
139140
```

0 commit comments

Comments
 (0)