aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: fa6bac01bfee8443b02eb5a8131839836645a134 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# GSA Parser

## Build Instructions

First, install nix. This is a bit of an effort on a docker image.
The latest version of ymherklotz/polyhedral:1.0 has some of the config files you get when installing nix so everyone has it and if you kill a container you still have your configurations.
But nix is big so we need to use docker volumes and install it once with the follwing steps.

Create a volume that will be mounted to /nix.
It's important it's always mounted to /nix cos that's where nix gets installed. 
```sh
docker volume create nix 
docker run -itd --name gsa-parser -v nix:/nix -v <project_path_on_host>:<project_path_on_image> ymherklotz/polyhedral:1.0
```

Create a temporary user as whom we install nix (it doesn't allow installation as root). 
The final command installs multi-user nix which allows root to run nix after installation.
``` sh
apt install curl bzip2 adduser
adduser --disabled-password --gecos '' nix-installer
chown nix-installer /nix
sudo -u nix-installer /bin/bash
cd /home/nix-installer
sh <(curl -L https://nixos.org/nix/install) --daemon
```

It's recommended to use `flake` in nix, which is experimental:

``` sh
nix-env -iA nixpkgs.nixUnstable
```

Then add the following to `/etc/nix/nix.conf`:

``` text
experimental-features = nix-command flakes
```

For faster compilation, use [cachix](https://www.cachix.org/) to download binary dependencies:

``` sh
nix-env -iA cachix -f https://cachix.org/api/v1/install
```

Then, activate the following caches:

``` sh
USER=root cachix use jmc 
USER=root cachix use ymherklotz
```

Then navigate to this project's directory and build the project using:

``` sh
nix build
```