Skip to content

Commit c9e10f5

Browse files
authored
Add README entries to explain nix-build (#679)
1 parent d1fdd7a commit c9e10f5

File tree

1 file changed

+37
-2
lines changed

1 file changed

+37
-2
lines changed

README.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,15 @@ Possible networks: `etc`, `eth`, `mordor`, `testnet-internal`
2626

2727
### Building the client
2828

29-
#### Prerequisites to build
29+
#### SBT
30+
31+
##### Prerequisites to build
3032

3133
- JDK 1.8 (download from [java.com](http://www.java.com))
3234
- sbt ([download sbt](http://www.scala-sbt.org/download.html))
3335
- python 2.7.15 (download from [python.org](https://www.python.org/downloads/))
3436

35-
#### Build the client
37+
##### Build the client
3638

3739
As an alternative to downloading the client build the client from source.
3840

@@ -46,6 +48,39 @@ in the root of the project.
4648

4749
This updates all submodules and creates a distribution zip in `~/target/universal/`.
4850

51+
#### Nix
52+
53+
In the root of the project:
54+
55+
##### Build the client
56+
57+
```
58+
nix-build
59+
```
60+
61+
##### Regenerate lock files
62+
63+
```
64+
nix-shell
65+
sbtix-gen-all2
66+
```
67+
68+
###### Why so many lock files?
69+
70+
- `repo.nix` : generated by the `sbtix-gen` command and includes only the build dependencies for the project.
71+
- `project/repo.nix` : generated by the `sbtix-gen-all` command and includes only the plugin dependencies. Also generates `repo.nix`.
72+
- `project/project/repo.nix` : generated by the `sbtix-gen-all2` command and includes only the pluginplugin dependencies. Also generates `repo.nix` and `project/repo.nix`.
73+
74+
##### error: unsupported argument 'submodules' to 'fetchGit'
75+
76+
You get this error when you aren't using a new-enough version of Nix (fetchGit support for submodules is recent).
77+
78+
To fix this, update the version of Nix you are using, or in a pinch:
79+
80+
- Remove the "submodules = true;" argument from fetchGit (in `./nix/pkgs/mantis/default.nix`).
81+
- `git submodule update --recursive --init`
82+
- `nix-build`
83+
4984
### Monitoring
5085

5186
#### Locally build & run monitoring client

0 commit comments

Comments
 (0)