Skip to content

Instantly share code, notes, and snippets.

@pauleeeeee
Last active August 27, 2020 00:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pauleeeeee/37942295077da184000f8ac9ab1aad40 to your computer and use it in GitHub Desktop.
Save pauleeeeee/37942295077da184000f8ac9ab1aad40 to your computer and use it in GitHub Desktop.
Recently, a user on the Rebble discord (Sorixelle) has made it very easy to install the Pebble SDK on MacOS X using a package manager called Nix. You don't need to know much about Nix, but you do need to install it. Follow these directions:
1. Install Nix (https://nixos.org/guides/install-nix.html)
a. install with `sh <(curl -L https://nixos.org/nix/install) --daemon` in the terminal
b. close your terminal window and re-open it
c. verify the installation worked with `$ nix-env --version`
d. if it doesn't appear to have installed maybe try a system reboot
2. Install Cachix, which is basically an extension for Nix and will help speed development
a. in terminal, run `nix-env -i cachix` (you might need to use `sudo`)
b. then, point Cachix to the pebble cache with `cachix use pebble`
c. Important: Reboot your system! The reason is because we want to make sure Cachix takes hold.
3. Finally, we will fire up the Nix shell which gives access to the Pebble SDK.
a. First, create a directory for your Pebble project. So for example if I wanted to make a `hello-world` watchface, I might created a folder in `/Users/Me/Development/Pebble-Projects/hello-world-watchface`
b. Here, I will make a file called `shell.nix` and the contents should be:
```
(import
(builtins.fetchTarball https://github.com/Sorixelle/pebble.nix/archive/master.tar.gz)
).devShell { }
```
c. Save the `shell.nix` file in your project directory
d. Use terminal and `cd` into your project directory
e. Once inside the project directory (the one that has the `shell.nix` file in it)... launch the Nix shell with `nix-shell` - it might take a while the first time around
f. Now, as long as you are in this terminal window, you can use the `pebble` command to create, build, and deploy Pebble projects - just like you would had you installed the SDK manually!
g. Note: Each time you close your terminal or restart your computer or whatever, be sure to enter the Nix shell before trying to use the `pebble` command.
h. Note: If the first build is taking a very long time (longer than a few minutes) it might be that the Cachix steps did not take hold. Try to restart your system before the first build.
More information and additional building tools can be found in Sorixelle's project, here: https://github.com/Sorixelle/pebble.nix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment