{"id":45083440,"url":"https://github.com/pebble-dev/pebble.nix","last_synced_at":"2026-02-19T15:07:20.885Z","repository":{"id":47246389,"uuid":"285026984","full_name":"pebble-dev/pebble.nix","owner":"pebble-dev","description":"Tools for building Pebble apps with Nix","archived":false,"fork":false,"pushed_at":"2026-01-18T04:18:39.000Z","size":224,"stargazers_count":50,"open_issues_count":3,"forks_count":9,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-18T14:59:44.756Z","etag":null,"topics":["nix","nix-flake","pebble"],"latest_commit_sha":null,"homepage":"","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pebble-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-08-04T15:49:45.000Z","updated_at":"2026-01-15T11:43:27.000Z","dependencies_parsed_at":"2024-12-23T11:27:13.372Z","dependency_job_id":"6e5c6af7-f5a5-4cac-acd1-eec72152d414","html_url":"https://github.com/pebble-dev/pebble.nix","commit_stats":null,"previous_names":["pebble-dev/pebble.nix","sorixelle/pebble.nix"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pebble-dev/pebble.nix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pebble-dev%2Fpebble.nix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pebble-dev%2Fpebble.nix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pebble-dev%2Fpebble.nix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pebble-dev%2Fpebble.nix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pebble-dev","download_url":"https://codeload.github.com/pebble-dev/pebble.nix/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pebble-dev%2Fpebble.nix/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29619287,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T13:04:20.082Z","status":"ssl_error","status_checked_at":"2026-02-19T13:03:33.775Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nix","nix-flake","pebble"],"created_at":"2026-02-19T15:07:20.296Z","updated_at":"2026-02-19T15:07:20.869Z","avatar_url":"https://github.com/pebble-dev.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pebble.nix\n\n[![CI status badge](https://github.com/pebble-dev/pebble.nix/actions/workflows/buildAndCache.yml/badge.svg)](https://github.com/pebble-dev/pebble.nix/actions/workflows/buildAndCache.yml?query=branch%3Amain)\n\nA collection of tools for setting up Pebble app development environments, and building Pebble apps/watchfaces, using\n[Nix](https://nixos.org/).\n\n## Getting Started\n\n### Step 1: Install Nix\n\nNix is the build system that underlies pebble.nix - you'll need to have it installed on your system to use it. There's a\nfew ways to install Nix out there - if you don't have an install, I recommend one of the following:\n\n- [Lix Installer](https://lix.systems/install/#on-any-other-linuxmacos-system)\n- [Determinate Nix Installer](https://github.com/DeterminateSystems/nix-installer#install-nix)\n\nThere's very little difference between the two - Lix is [a fork of Nix](https://lix.systems/about/) focused on language\nstability and improving the developer experience, while still remaining compatible with upstream Nix (which is what the\nDeterminate Nix Installer sets up). pebble.nix fully supports both implementations, so take your pick!\n\nYou might wonder - why not use the official Nix installer? There's a few rough edges in it that require manual fixup\nafter installation to workaround (doesn't allow using Nix flakes out-of-the-box, lack of Fish shell support, etc.). The\ninstallers listed above don't have these problems, so it's easier to use them instead.\n\n### Step 2: Install Cachix (optional, but recommended)\n\nThe job of pebble.nix is to give Nix instructions on how to build and compile all the pieces needed to get a full Pebble\nSDK and developer tool setup. Compiling everything can take a very long time on some systems, so to cut down on initial\nsetup time, you can use [Cachix](https://cachix.org) to download prebuilt versions of tools from a binary cache, instead\nof compiling everything on your system.\n\nIf you're on NixOS, you can install Cachix through the usual mechanisms there. Otherwise, Cachix can be installed by\nrunning:\n```shell\nnix-env -iA cachix\n```\n\nOnce it's installed, you'll need to use it to add the binary cache to your Nix setup. On non-NixOS systems, you just\nneed to run the following command:\n```shell\ncachix use pebble\n```\n\nOn NixOS systems, that command will add the cache to your NixOS configuration - make sure you rebuild the system for the\nchange to take effect.\n\n### Step 3: Create a new project\n\nNormally, to create a new Pebble project, you'd run `pebble new-project \u003cname\u003e`. But we don't have the Pebble tools\ninstalled yet - instead, we need to run the Pebble tool from pebble.nix. `nix run` allows you to run any program in a\nNix derivation defined in a GitHub repo without installing it - we can use it to bootstrap a new project. In the folder\nyou want to keep your project in, run the following command:\n\n```shell\nnix run github:pebble-dev/pebble.nix#pebble-tool -- new-project \u003cproject name\u003e\n```\n\nYou now have a new Pebble app project, in a folder with the same name as the project name! The `nix run` command\neffectively acts as a substitute for the `pebble` command, where everything after `--` gets passed as arguments to\n`pebble`. For example, if you wanted to list all the available Pebble SDK versions, you could run:\n\n```shell\nnix run github:pebble-dev/pebble.nix#pebble-tool -- sdk list\n```\n\nHaving to type out that full command every time is a bit annoying, though. Also, trying to build the app doesn't work,\nsince there's no ARM compiler setup. We can fix both of those problems by using a development shell.\n\n### Step 4: Create a development shell\n\nDevelopment shells are a feature of Nix, that let you specify a list of packages that you want to temporarily install.\nYou can then \"enter\" that development shell by running `nix develop`, which will run a new shell process that has all of\nthe packages you specified installed and ready to use. As soon as you `exit` the development shell, all those packages\nare removed from your shell session, until you enter the development shell again.\n\nIn Nix, development shells are specified in a flake. Without going into too much detail, a flake is a `flake.nix` file\nat the root of your project that defines all the Nix-related bits of your project - the development shell, any Nix\npackages you create, plus a bunch of other things that aren't important to us. What we want is a development shell that\nhas everything we'll want when writing a Pebble app. pebble.nix has a function called `pebbleEnv` that has all of that\nstuff included - we just need to create a flake that tells Nix to use `pebbleEnv` for our project's devshell.\n\npebble.nix provides a template for setting up a flake with a development shell in an existing project. To use that\ntemplate, run:\n\n```shell\nnix flake init -t github:pebble-dev/pebble.nix\n```\n\nYou should now have a `flake.nix` file in your project with a development shell ready to use. To ender the shell, run\n`nix develop` in the project. You'll be dropped into a new shell session, that has everything you need to build Pebble\napps - the `pebble` tool, the emulator, and an ARM compiler! You can use the `pebble` tool exactly like you would in a\nnormal install while you're in here.\n\nYou'll notice a `flake.lock` file was created after running `nix develop`. That file makes sure none of the flake's\ninputs (such as pebble.nix) update out of nowhere and potentially break your setup, similarly to things like npm's\n`package-lock.json`. If you do want to update, you can use `nix flake update` to get the latest versions of your flake's\ninputs. If you make a Git repo in your project, don't forget to commit the `flake.lock` file!\n\n**Important Apple Silicon note:** You might run into an error like the following when trying to build a Pebble app:\n```\nCould not determine the compiler version ['arm-none-eabi-gcc', '-dM', '-E', '-']\n```\nIf you do, running `softwareupdate --install-rosetta` should fix it. The C compiler toolchain pebble.nix includes for macOS is the original one Pebble shipped and built for Intel Macs, so you'll need to have Rosetta installed to be able to use it.\n\n### Step 5: Setup nix-direnv (optional, but recommended)\n\nHaving to run `nix develop` every time you want to use the Pebble tools is a bit annoying. In the Nix ecosystem, there's\na tool called [direnv](https://direnv.net/) that automatically sets up environment variables when you `cd` into a\ndirectory. [nix-direnv](https://github.com/nix-community/nix-direnv) integrates direnv with Nix development shells,\nletting you enter and exit a development shell just by `cd`ing in and out of the folder - no more forgetting to `nix\ndevelop`!\n\nFirst, setup direnv using their [install guide](https://direnv.net/docs/installation.html) (don't forget the shell hook\nstep!). Once it's setup, we can create a `.envrc` file in our project that tells direnv what to do when we enter the\ndirectory. We want it to open the development shell, which we can do by pasting the following shell script into the\nfile:\n``` shell\n# Make sure nix-direnv is setup\nif ! has nix_direnv_version || ! nix_direnv_version 3.0.6; then\n  source_url \"https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.6/direnvrc\" \"sha256-RYcUJaRMf8oF5LznDrlCXbkOQrywm0HDv1VjYGaJGdM=\"\nfi\n\n# Activate the developer shell\nuse flake\n```\n\nAfter saving that file, direnv will prompt you to allow it to run in that folder (it's a security mechanism, to make\nsure you don't unwittingly run potentially malicious code by entering a folder you downloaded with a `.envrc` file) by\nrunning `direnv allow`. Once done, the development shell will be active, and all the Pebble tools will be ready to go as\nsoon as you open your project!\n\nMost code editors have a direnv plugin available (eg.\n[VSCode](https://marketplace.visualstudio.com/items?itemName=mkhl.direnv), [Vim](https://github.com/direnv/direnv.vim),\n[Emacs](https://github.com/wbolster/emacs-direnv)), so you can use the Pebble tools in your editor's integrated\nbuild/debug support.\n\n### Step 6: Build your project with Nix (optional)\n\nTODO\n\n## Usage\n\n### Development shells\n\nDevelopment shells can be configured by specifying the following arguments to `pebbleEnv`:\n\n- `devServerIP`: The default development server IP. You can find this in the Pebble app.\n- `emulatorTarget`: The default target to start the Pebble emulator for.\n- `cloudPebble`: Whether to connect via a CloudPebble connection. Requires logging into Rebble via `pebble login`.\n- `packages`: Any extra tools to use during development.\n- `CFLAGS`: Extra flags to pass to the compiler during app builds.\n- `withCoreDevices`: Whether to use Core Devices' new pebble-tool, updated to work with Python 3. Defaults to `false`.\n\n### App Store Builds\n\n`buildPebbleApp` requires a few specific attributes to create the metadata YAML file the Rebble App Store uses to create\nyour app's page.\n\n- `name`: The name of your app.\n- `type`: The type of app. Must be either `watchapp` or `watchface`.\n- `description`: A description of your app.\n- `releaseNotes`: The release notes for this version of your app.\n- `category`: The category of your app. Only needed for watchapps. The valid values are:\n   - Daily\n   - Tools \u0026 Utilities\n   - Notifications\n   - Remotes\n   - Health \u0026 Fitness\n   - Games\n- `banner`: Path to a 720x320 image that will be displayed as the banner for your app. Optional for watchfaces.\n- `smallIcon`: Path to a 48x48 icon for your app. Optional for watchfaces.\n- `largeIcon`: Path to a 144x144 icon for your app. Optional for watchfaces.\n- `homepage`: A URL to the homepage for your app. Optional.\n- `sourceUrl`: A URL to the source code of your app. Optional.\n- `screenshots`: An attribute set containing screenshots of your app on Pebble watches. Each attribute contains a list\n  of paths to screenshots. At least 1 screenshot in total must be provided. The following attributes are valid:\n  - `aplite`: Screenshots for the aplite platform (Pebble, Pebble Steel)\n  - `basalt`: Screenshots for the basalt platform (Pebble Time, Pebble Time Steel)\n  - `chalk`: Screenshots for the chalk platform (Pebble Time Round)\n  - `diorite`: Screenshots for the diorite platform (Pebble 2, Pebble 2 HR)\n  - `all`: Screenshots to be used for all platforms.\n\nOther options relating to the build process:\n\n- `src`: Path to the project root. Usually `./.` (the same folder your Nix expression is in).\n- `nativeBuildInputs`: Any extra tools/dependencies to be used at build time.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpebble-dev%2Fpebble.nix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpebble-dev%2Fpebble.nix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpebble-dev%2Fpebble.nix/lists"}