From 7976adb34034807e9162eb4da2a1d743e098284c Mon Sep 17 00:00:00 2001 From: adityarajagopal Date: Tue, 9 Nov 2021 11:51:25 +0000 Subject: updated README with complete nix installation instructions --- README.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6d17487..bfc91e4 100644 --- a/README.md +++ b/README.md @@ -3,14 +3,22 @@ ## Build Instructions First, install nix. This is a bit of an effort on a docker image. -So I'll push the container I have with it to the image so everyone has it. -But if you want to install it yourself, you need to do the following steps. -Create a temporary user as whom we install nix (it doesn't allow installation as root). +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 the nix gets installed. +```sh +docker volume create nix +docker run -itd --name gsa-parser -v nix:/nix 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 -mkdir -m 0755 /nix && chown nix-installer /nix +chown nix-installer /nix sudo -u nix-installer /bin/bash cd /home/nix-installer sh <(curl -L https://nixos.org/nix/install) --daemon @@ -34,7 +42,7 @@ For faster compilation, use [cachix](https://www.cachix.org/) to download binary nix-env -iA cachix -f https://cachix.org/api/v1/install ``` -Then, activate the following cache: +Then, activate the following caches: ``` sh USER=root cachix use jmc -- cgit