declarative adapter for build inkwatchy via nix
  • Shell 68.8%
  • Nix 31.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-31 03:08:55 +03:00
lib catalogue 2026-10-31 00:25:58 +03:00
scripts flashing! watchy2 2026-10-31 03:08:55 +03:00
tests flashing! watchy2 2026-10-31 03:08:55 +03:00
.gitignore init 2026-10-30 21:53:32 +03:00
config.nix.example flashing! watchy2 2026-10-31 03:08:55 +03:00
flake.lock init 2026-10-30 21:53:32 +03:00
flake.nix flashing! watchy2 2026-10-31 03:08:55 +03:00
README.md flashing! watchy2 2026-10-31 03:08:55 +03:00

# inkwatchy-nix

nix wrapper for inkwatchy

requirements: linux, nix flakes, network on the first platformio build.

scope: watchy v2 (i can’t test this on other versions ;/ )

~ TODO

  • nix-managed inkwatchy options;
  • secrets
  • Watchy_2 build
  • config.h option catalogue and config.nix overrides
  • flashing
  • scom
  • local patches
  • build descriptors for other Watchy targets
  • condition.h and platformio option coverage

upstream is a flake input, each build uses a temp writable copy.

## commands

# development environment
nix develop

# generate the commented upstream option catalogue
nix run .#init-config
cp config.nix.example config.nix # and edit it

# regenerate only the catalogue after an upstream update
nix run .#update-option-catalogue

# build
nix run .#build-watchy2
bash scripts/check-result.sh out/watchy2

# flash only the application partition at 0x10000
nix run .#flash-watchy2 -- \
  --port /dev/ttyACM0 \
  --confirm

## config

smth like:

{
  inkwatchy = {
    defines = {
      DEBUG = 1;
      SCOM_TASK = 1;
    };

    rawDefines = {
      DEBUG_CPU_SPEED = "normalSpeed";
    };
  };
}

defines: bool, int, c strings. rawDefines: unquoted c tokens.

without config.nix, upstream defaults are used.

## output

 out
└──  watchy2
    ├──  build-info.txt
    └──  firmware.bin

!! flash does not erase or replace bootloader, partition table, or LittleFS.