### GitHub Actions Workflow for ZMK Firmware Build Source: https://context7.com/moergo-sc/glove80-zmk-config/llms.txt CI workflow in `.github/workflows/build.yml` that automates firmware building on code changes. It checks out repositories, installs Nix, uses Cachix for caching, builds the firmware, and uploads it as an artifact. ```yaml # .github/workflows/build.yml name: Build on: [push, pull_request, workflow_dispatch] jobs: build: runs-on: ubuntu-latest steps: # 1. Check out this config repository (with submodules) - uses: actions/checkout@v4 with: submodules: recursive # 2. Check out the MoErgo-customized ZMK firmware source - uses: actions/checkout@v4 with: repository: moergo-sc/zmk ref: main path: src # 3. Install Nix package manager - uses: cachix/install-nix-action@v25 with: nix_path: nixpkgs=channel:nixos-22.05 # 4. Use Cachix to pull pre-built ZMK toolchain artifacts - uses: cachix/cachix-action@v14 with: name: moergo-glove80-zmk-dev skipPush: true # Read-only; no push token needed # 5. Build both halves and combine into glove80.uf2 - name: Build Glove80 combined firmware run: nix-build config -o combined - name: Copy result out of nix store run: cp combined/glove80.uf2 glove80.uf2 # 6. Upload the firmware as a GitHub Actions artifact - name: Upload result uses: actions/upload-artifact@v4 with: name: glove80.uf2 path: glove80.uf2 # Expected output: # A downloadable artifact named "glove80.uf2" appears under # Actions → Build → → Artifacts ``` -------------------------------- ### Local Docker Build Scripts for Glove80 Firmware Source: https://context7.com/moergo-sc/glove80-zmk-config/llms.txt Scripts for building Glove80 firmware locally using Docker, avoiding the need for a full Nix installation. The `build.sh` (Linux/macOS) and `build.bat` (Windows) scripts automate the process. ```bash # Linux / macOS — build using the default ZMK main branch: ./build.sh # Build against a specific ZMK tag or branch: ./build.sh glove80/v1.0.1 # Expected output: # glove80.uf2 written to the current directory (bind-mounted as /config) # ─── Windows (Command Prompt) ─────────────────────────────────────────────── # build.bat # uses main branch # build.bat glove80/v1.0.1 # ─── What happens internally (Dockerfile entrypoint) ───────────────────────── # BRANCH=main # cd /src && git fetch origin && git checkout --detach "$BRANCH" # cd /config && nix-build ./config \ # --arg firmware 'import /src/default.nix {}' \ # -j2 -o /tmp/combined --show-trace # install -o "$UID" -g "$GID" /tmp/combined/glove80.uf2 ./glove80.uf2 ``` -------------------------------- ### Flashing Glove80 Firmware via UF2 Bootloader Source: https://context7.com/moergo-sc/glove80-zmk-config/llms.txt Follow these steps to enter bootloader mode, copy the firmware, and complete the flashing process for both halves of the Glove80 keyboard. Ensure the correct firmware file (glove80.uf2) is used. ```text # Steps to flash the Glove80: # # 1. Enter bootloader on the LEFT half: # Hold the top-left key while plugging in USB —OR— # Press the Magic key combo that triggers &bootloader # # 2. The keyboard half mounts as a USB drive (e.g., GLV80BOOT). # # 3. Copy the firmware file to the drive: # Linux/macOS: # cp glove80.uf2 /media/$USER/GLV80BOOT/ # # Windows: drag-and-drop glove80.uf2 onto the GLV80BOOT drive # # 4. The drive unmounts automatically when flashing completes. # Repeat steps 1–4 for the RIGHT half using the same glove80.uf2. # # 5. Re-pair both halves if needed via the Magic layer Bluetooth controls. ``` -------------------------------- ### ZMK Keymap Configuration for Glove80 Source: https://context7.com/moergo-sc/glove80-zmk-config/llms.txt Defines keyboard layers, behaviors, and macros using Devicetree syntax. Includes standard headers for keycodes, Bluetooth, RGB, and output selectors. Ensure all 80 key positions are defined within the keymap. ```dts /* * config/glove80.keymap * Minimal working example: two layers (DEFAULT, LOWER) * with * a tap-dance layer key and Bluetooth macros. */ #include #include #include #include #include #define DEFAULT 0 #define LOWER 1 #define MAGIC 2 / { behaviors { /* Tap once → momentary LOWER; tap twice → toggle LOWER */ layer_td: tap_dance_0 { compatible = "zmk,behavior-tap-dance"; label = "LAYER_TAP_DANCE"; #binding-cells = <0>; tapping-term-ms = <200>; bindings = <&mo LOWER>, <&to LOWER>; }; /* Hold → activate MAGIC layer; tap → run rgb_ug_status_macro */ magic: magic_hold_tap { compatible = "zmk,behavior-hold-tap"; label = "MAGIC_HOLD_TAP"; #binding-cells = <2>; flavor = "tap-preferred"; tapping-term-ms = <200>; bindings = <&mo>, <&rgb_ug_status_macro>; }; }; macros { rgb_ug_status_macro: rgb_ug_status_macro_0 { label = "RGB_UG_STATUS"; compatible = "zmk,behavior-macro"; #binding-cells = <0>; bindings = <&rgb_ug RGB_STATUS>; }; /* Switch output to BLE and select profile 0 */ bt_0: bt_profile_macro_0 { label = "BT_0"; compatible = "zmk,behavior-macro"; #binding-cells = <0>; bindings = <&out OUT_BLE>, <&bt BT_SEL 0>; }; }; keymap { compatible = "zmk,keymap"; default_layer { bindings = < // Row 1 (top function row) &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 // ... (all 80 key positions required) // Thumb cluster example: &kp LSHFT &kp LCTRL &layer_td &kp LGUI &kp RCTRL &kp RSHFT &kp BSPC &kp DEL &kp LALT &kp RALT &kp RET &kp SPACE // Bottom-left special key uses magic hold-tap: &magic MAGIC 0 >; }; lower_layer { bindings = < // Media controls on top row &kp C_BRI_DN &kp C_BRI_UP &kp C_PREV &kp C_NEXT &kp C_PP &kp C_MUTE &kp C_VOL_DN &kp C_VOL_UP &none &kp PAUSE_BREAK // Numpad cluster (right side) &kp KP_N7 &kp KP_N8 &kp KP_N9 &kp KP_MINUS &kp KP_N4 &kp KP_N5 &kp KP_N6 &kp KP_PLUS &kp KP_N1 &kp KP_N2 &kp KP_N3 &kp KP_ENTER &kp KP_N0 &kp KP_DOT &kp KP_ENTER // Return to default layer &to DEFAULT // Transparent keys inherit from layer below &trans >; }; magic_layer { bindings = < // RGB controls &rgb_ug RGB_TOG &rgb_ug RGB_BRI &rgb_ug RGB_BRD &rgb_ug RGB_HUI &rgb_ug RGB_HUD &rgb_ug RGB_SAI &rgb_ug RGB_SAD &rgb_ug RGB_SPI &rgb_ug RGB_SPD &rgb_ug RGB_EFF // Bluetooth profile selection (via macros) &bt_0 &bt_1 &bt_2 &bt_3 // USB output &out OUT_USB // Clear active BT pairing / all pairings &bt BT_CLR &bt BT_CLR_ALL // Bootloader / reset &bootloader &sys_reset >; }; }; }; ``` -------------------------------- ### Nix Build Definition for Glove80 Firmware Source: https://context7.com/moergo-sc/glove80-zmk-config/llms.txt Define the Nix expression in `default.nix` to build the combined `glove80.uf2` firmware binary. This involves overriding the ZMK firmware build for both keyboard halves with local keymap and kconfig settings, then merging them. ```nix # config/default.nix { pkgs ? import {} , firmware ? import ../src {} # ZMK source tree, provided by CI or Docker }: let config = ./.; # Points to this config/ directory # Build left half with custom keymap + kconfig glove80_left = firmware.zmk.override { board = "glove80_lh"; keymap = "${config}/glove80.keymap"; kconfig = "${config}/glove80.conf"; }; # Build right half with the same keymap + kconfig glove80_right = firmware.zmk.override { board = "glove80_rh"; keymap = "${config}/glove80.keymap"; kconfig = "${config}/glove80.conf"; }; in # Merge both halves into one glove80.uf2 artifact firmware.combine_uf2 glove80_left glove80_right # To build locally (requires Nix): # nix-build config -o combined # ls combined/glove80.uf2 ``` -------------------------------- ### Enable Deep Sleep and RGB in Glove80 Firmware Source: https://context7.com/moergo-sc/glove80-zmk-config/llms.txt Configure ZMK Kconfig options in `glove80.conf` to enable features like deep sleep for battery life and RGB underglow. Adjust Bluetooth transmit power and optionally enable USB logging for debugging. ```ini # config/glove80.conf # Example: enable deep sleep to extend battery life CONFIG_ZMK_SLEEP=y CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=900000 # 15 minutes in milliseconds # Enable RGB underglow CONFIG_ZMK_RGB_UNDERGLOW=y CONFIG_ZMK_RGB_UNDERGLOW_AUTO_OFF_IDLE=y # Adjust Bluetooth transmit power (range vs battery) CONFIG_BT_CTLR_TX_PWR_PLUS_8=y # Enable USB logging for debugging (disable in production builds) # CONFIG_ZMK_USB_LOGGING=y ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.