on master help sign in
Merge pull request #69 from obsidiansystems/nix-mac-setenv

Add macos instructions for setting environment variables for nix daemon

commitde4f336497cae1efc2410247e9c0f930ed149312 authorLuigy Leon <luichi.19@gmail.com> dateMon 21 May 2018, 12:08 (8 years ago) parentb6e748d9e4e5a6
1 file changed+9−1
README.md+9−1
README.md+9−1
@@ -9,13 +9,21 @@
991. Get set up to access private repositories
1010 1. [Get set up to connect to GitHub with SSH](https://help.github.com/articles/connecting-to-github-with-ssh/)
1111 1. [Create a GitHub personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/)
12− 1. Add this to `/etc/nixos/configuration.nix`:
12+ 1. Set environment variables:
13+ * NixOS: Add this to `/etc/nixos/configuration.nix`:
1314 ```
1415 nix.envVars = {
1516 NIX_GITHUB_PRIVATE_USERNAME = "your-github-username";
1617 NIX_GITHUB_PRIVATE_PASSWORD = "your-github-personal-access-token";
1718 };
1819 ```
20+ * MacOS:
21+ ```
22+ sudo launchctl setenv NIX_GITHUB_PRIVATE_USERNAME "your-github-username"
23+ sudo launchctl setenv NIX_GITHUB_PRIVATE_PASSWORD "your-github-personal-access"
24+ sudo launchctl stop org.nixos.nix-daemon
25+ sudo launchctl start org.nixos.nix-daemon
26+ ```
1927 1. `nix-env -i hub` OR `nix-env -iA nixos.gitAndTools.hub`
2028 1. `hub clone obsidiansystems/obelisk`
2129 * NOTE: you must authenticate with hub at least once, because the `ob` command uses `hub` for authentication