aboutsummaryrefslogtreecommitdiff
path: root/doc/manual/src/hacking.md
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-09-15 14:08:35 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-09-15 14:08:35 +0000
commitc08c9f08c75bf379439348cccb5b8871a27bf498 (patch)
treec4a7276366b31047b9f437865bebe21a919382af /doc/manual/src/hacking.md
parent3df78858f2ad91a80e30ba910119a0c16c05c66a (diff)
parent733d2e9402807e54d503c3113e854bfddb3d44e0 (diff)
Merge remote-tracking branch 'upstream/master' into remove-storetype-delegate-regStore
Diffstat (limited to 'doc/manual/src/hacking.md')
-rw-r--r--doc/manual/src/hacking.md71
1 files changed, 71 insertions, 0 deletions
diff --git a/doc/manual/src/hacking.md b/doc/manual/src/hacking.md
new file mode 100644
index 000000000..5bd884ce8
--- /dev/null
+++ b/doc/manual/src/hacking.md
@@ -0,0 +1,71 @@
+# Hacking
+
+This section provides some notes on how to hack on Nix. To get the
+latest version of Nix from GitHub:
+
+```console
+$ git clone https://github.com/NixOS/nix.git
+$ cd nix
+```
+
+To build Nix for the current operating system/architecture use
+
+```console
+$ nix-build
+```
+
+or if you have a flake-enabled nix:
+
+```console
+$ nix build
+```
+
+This will build `defaultPackage` attribute defined in the `flake.nix`
+file. To build for other platforms add one of the following suffixes to
+it: aarch64-linux, i686-linux, x86\_64-darwin, x86\_64-linux. i.e.
+
+```console
+$ nix-build -A defaultPackage.x86_64-linux
+```
+
+To build all dependencies and start a shell in which all environment
+variables are set up so that those dependencies can be found:
+
+```console
+$ nix-shell
+```
+
+To build Nix itself in this shell:
+
+```console
+[nix-shell]$ ./bootstrap.sh
+[nix-shell]$ ./configure $configureFlags --prefix=$(pwd)/inst
+[nix-shell]$ make -j $NIX_BUILD_CORES
+```
+
+To install it in `$(pwd)/inst` and test it:
+
+```console
+[nix-shell]$ make install
+[nix-shell]$ make installcheck
+[nix-shell]$ ./inst/bin/nix --version
+nix (Nix) 2.4
+```
+
+To run a functional test:
+
+```console
+make tests/test-name-should-auto-complete.sh.test
+```
+
+If you have a flakes-enabled Nix you can replace:
+
+```console
+$ nix-shell
+```
+
+by:
+
+```console
+$ nix develop
+```