on master help sign in
Update installation instructions
112dce2Ryan Trinkle
README.md+33−28
@@ -10,40 +10,45 @@ Obelisk provides an easy way to develop and deploy your [Reflex](https://github.
10 - [Android](#android)
10 - [Android](#android)
11
11
12## Installing Obelisk
12## Installing Obelisk
13−1. Install or update to nix 2.x
13+1. [Install Nix](https://nixos.org/nix/)
14+ Make sure you have version 2.0 or higher. To check your current version, run `nix-env --version`.
141. Set up nix caches
151. Set up nix caches
15− 1. Add this to `/etc/nixos/configuration.nix`:
16+ 1. If you are running NixOS, add this to `/etc/nixos/configuration.nix`:
16 ```
17 ```
17− nix.binaryCaches = [ "https://nixcache.reflex-frp.org" ];
18+ nix.binaryCaches = [ "https://cache.nixos.org/" "https://nixcache.reflex-frp.org" ];
18 nix.binaryCachePublicKeys = [ "ryantrinkle.com-1:JJiAKaRv9mWgpVAz8dwewnZe0AzzEAzPkagE9SP5NWI=" ];
19 nix.binaryCachePublicKeys = [ "ryantrinkle.com-1:JJiAKaRv9mWgpVAz8dwewnZe0AzzEAzPkagE9SP5NWI=" ];
19 ```
20 ```
20−1. Install `ob`: `git clone git@github.com:obsidiansystems/obelisk && nix-env -f obelisk -iA command`.
21+ 1. If you are using another operating system or linux distribution, ensure that these lines are present in `/etc/nix/nix.conf`:
21− Alternatively, if you prefer not to install to your user nix environment, you can
22− enter a shell with the `ob` command available: `nix-shell -A shell`.
23− After running `ob init` this becomes `nix-shell .obelisk/impl -A shell`
24− for subsequent shells (since `ob init` overwrites `default.nix`).
25−1. Get set up to access private repositories
26− 1. [Get set up to connect to GitHub with SSH](https://help.github.com/articles/connecting-to-github-with-ssh/)
27− 1. [Create a GitHub personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/)
28− 1. Set environment variables:
29− * NixOS: Add this to `/etc/nixos/configuration.nix`:
30 ```
22 ```
31− nix.envVars = {
23+ substituters = https://cache.nixos.org https://nixcache.reflex-frp.org
32− NIX_GITHUB_PRIVATE_USERNAME = "your-github-username";
24+ trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ryantrinkle.com-1:JJiAKaRv9mWgpVAz8dwewnZe0AzzEAzPkagE9SP5NWI=
33− NIX_GITHUB_PRIVATE_PASSWORD = "your-github-personal-access-token";
34− };
35 ```
25 ```
26+1. Install obelisk: `nix-env -f https://github.com/obsidiansystems/obelisk/archive/master.tar.gz -iA command`
27+
28+### Accessing private repositories
29+To allow the Nix builder to access private git repositories, follow these steps:
30+
31+1. [Get set up to connect to GitHub with SSH](https://help.github.com/articles/connecting-to-github-with-ssh/)
32+1. [Create a GitHub personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/)
33+1. Set environment variables:
34+ * NixOS: Add this to `/etc/nixos/configuration.nix`:
35+ ```
36+ nix.envVars = {
37+ NIX_GITHUB_PRIVATE_USERNAME = "your-github-username";
38+ NIX_GITHUB_PRIVATE_PASSWORD = "your-github-personal-access-token";
39+ };
40+ ```
36− * MacOS:
41+ * MacOS:
37− ```
42+ ```
38− sudo launchctl setenv NIX_GITHUB_PRIVATE_USERNAME "your-github-username"
43+ sudo launchctl setenv NIX_GITHUB_PRIVATE_USERNAME "your-github-username"
39− sudo launchctl setenv NIX_GITHUB_PRIVATE_PASSWORD "your-github-personal-access"
44+ sudo launchctl setenv NIX_GITHUB_PRIVATE_PASSWORD "your-github-personal-access"
40− sudo launchctl stop org.nixos.nix-daemon
45+ sudo launchctl stop org.nixos.nix-daemon
41− sudo launchctl start org.nixos.nix-daemon
46+ sudo launchctl start org.nixos.nix-daemon
42− ```
47+ ```
43− 1. `nix-env -i hub` OR `nix-env -iA nixos.gitAndTools.hub`
48+1. `nix-env -i hub` OR `nix-env -iA nixos.gitAndTools.hub`
44− 1. `hub clone yourusername/yourproject`
49+1. `hub clone yourusername/yourproject`
45− * NOTE: you must authenticate with hub at least once, because the `ob` command uses `hub` for authentication
50+ * NOTE: you must authenticate with hub at least once, because the `ob` command uses `hub` for authentication
46− #TODO: Make ob do this itself (either invoke hub automatically or not depend on hub)
51+ #TODO: Make ob do this itself (either invoke hub automatically or not depend on hub)
47
52
48## Developing an Obelisk project
53## Developing an Obelisk project
49
54