summaryrefslogtreecommitdiffstats
path: root/doc/manual/src/hacking.md
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-07-31 15:43:25 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-07-31 15:43:25 +0200
commit1d0a7b54fa330b041a720932ee4e05dcad1d2d5c (patch)
tree48627a3530e4d6d58c612864b2e99afb11a0a902 /doc/manual/src/hacking.md
parent0c94c176446bd9e9cb8c7e16fb7c6d88bb4e9a20 (diff)
Enable syntax highlighting
Diffstat (limited to 'doc/manual/src/hacking.md')
-rw-r--r--doc/manual/src/hacking.md50
1 files changed, 34 insertions, 16 deletions
diff --git a/doc/manual/src/hacking.md b/doc/manual/src/hacking.md
index f8375822d..1aa4e6b5f 100644
--- a/doc/manual/src/hacking.md
+++ b/doc/manual/src/hacking.md
@@ -3,45 +3,63 @@
This section provides some notes on how to hack on Nix. To get the
latest version of Nix from GitHub:
- $ git clone https://github.com/NixOS/nix.git
- $ cd nix
+```console
+$ git clone https://github.com/NixOS/nix.git
+$ cd nix
+```
To build Nix for the current operating system/architecture use
- $ nix-build
+```console
+$ nix-build
+```
or if you have a flakes-enabled nix:
- $ nix build
+```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.
- $ nix-build -A defaultPackage.x86_64-linux
+```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:
- $ nix-shell
+```console
+$ nix-shell
+```
To build Nix itself in this shell:
- [nix-shell]$ ./bootstrap.sh
- [nix-shell]$ ./configure $configureFlags
- [nix-shell]$ make -j $NIX_BUILD_CORES
+```console
+[nix-shell]$ ./bootstrap.sh
+[nix-shell]$ ./configure $configureFlags
+[nix-shell]$ make -j $NIX_BUILD_CORES
+```
To install it in `$(pwd)/inst` and test it:
- [nix-shell]$ make install
- [nix-shell]$ make installcheck
- [nix-shell]$ ./inst/bin/nix --version
- nix (Nix) 2.4
+```console
+[nix-shell]$ make install
+[nix-shell]$ make installcheck
+[nix-shell]$ ./inst/bin/nix --version
+nix (Nix) 2.4
+```
-If you have a flakes-enabled nix you can replace:
+If you have a flakes-enabled Nix you can replace:
- $ nix-shell
+```console
+$ nix-shell
+```
by:
- $ nix develop
+```console
+$ nix develop
+```