2020-07-23 00:17:48 +03:00
|
|
|
# Building Nix from Source
|
|
|
|
|
2021-11-02 14:52:35 +02:00
|
|
|
After cloning Nix's Git repository, issue the following commands:
|
2020-07-23 00:17:48 +03:00
|
|
|
|
2020-07-31 16:43:25 +03:00
|
|
|
```console
|
2021-11-02 14:52:35 +02:00
|
|
|
$ ./bootstrap.sh
|
2020-07-31 16:43:25 +03:00
|
|
|
$ ./configure options...
|
|
|
|
$ make
|
|
|
|
$ make install
|
|
|
|
```
|
2020-07-23 00:17:48 +03:00
|
|
|
|
|
|
|
Nix requires GNU Make so you may need to invoke `gmake` instead.
|
|
|
|
|
|
|
|
The installation path can be specified by passing the `--prefix=prefix`
|
|
|
|
to `configure`. The default installation directory is `/usr/local`. You
|
|
|
|
can change this to any location you like. You must have write permission
|
2020-07-23 15:28:05 +03:00
|
|
|
to the *prefix* path.
|
2020-07-23 00:17:48 +03:00
|
|
|
|
|
|
|
Nix keeps its *store* (the place where packages are stored) in
|
|
|
|
`/nix/store` by default. This can be changed using
|
|
|
|
`--with-store-dir=path`.
|
|
|
|
|
|
|
|
> **Warning**
|
|
|
|
>
|
|
|
|
> It is best *not* to change the Nix store from its default, since doing
|
|
|
|
> so makes it impossible to use pre-built binaries from the standard
|
|
|
|
> Nixpkgs channels — that is, all packages will need to be built from
|
|
|
|
> source.
|
|
|
|
|
|
|
|
Nix keeps state (such as its database and log files) in `/nix/var` by
|
|
|
|
default. This can be changed using `--localstatedir=path`.
|