Skip to content

Commit

Permalink
Emphasize how to pin/change release
Browse files Browse the repository at this point in the history
  • Loading branch information
urob committed Dec 18, 2024
1 parent a0f1b1a commit 99506a8
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 26 deletions.
33 changes: 33 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,36 @@ update:
# upgrade zephyr-sdk and python dependencies
upgrade-sdk:
nix flake update --flake .

[no-cd]
test $testpath:
#!/usr/bin/env bash
set -euo pipefail
testcase=$(basename "$testpath")
build_dir="{{ build / "tests" / '$testcase' }}"
config_dir="{{ '$(pwd)' / '$testpath' }}"
cd {{ justfile_directory() }}
echo "Running $testcase..."
rm -rf "$build_dir"
west build -s zmk/app -d "$build_dir" -b native_posix_64 -- -DCONFIG_ASSERT=y -DZMK_CONFIG="$config_dir"

${build_dir}/zephyr/zmk.exe | sed -e "s/.*> //" |
tee ${build_dir}/keycode_events.full.log |
sed -n -f ${config_dir}/events.patterns > ${build_dir}/keycode_events.log
diff -auZ ${config_dir}/keycode_events.snapshot ${build_dir}/keycode_events.log

[no-cd]
parse-test $testpath:
#!/usr/bin/env bash
set -euo pipefail
testcase=$(basename "$testpath")
build_dir="{{ build / "tests" / '$testcase' }}"
config_dir="{{ '$(pwd)' / '$testpath' }}"
cd {{ justfile_directory() }}
${build_dir}/zephyr/zmk.exe | sed -e "s/.*> //" |
tee ${build_dir}/keycode_events.full.log |
sed -n -f ${config_dir}/events.patterns > ${build_dir}/keycode_events.log
cat ${build_dir}/keycode_events.log
diff -auZ ${config_dir}/keycode_events.snapshot ${build_dir}/keycode_events.log
1 change: 1 addition & 0 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
include:
- board: planck_rev6
- board: corneish_zen_v2_left
# snippet: zmk-usb-logging
- board: corneish_zen_v2_right
- board: glove80_lh
- board: glove80_rh
19 changes: 18 additions & 1 deletion config/base.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,26 @@ MASK_MODS(masked_end, (MOD_LCTL), &kp END)

/* Caps-word, num-word and smart-mouse */

/ {
behaviors {
magic: adaptive_key {
compatible = "zmk,behavior-adaptive-key";
#binding-cells = <0>;
bindings = <&sk LSHFT>;

repeat {
trigger-keys = <A B C D E F G H I J K L M N O P Q R S T U V W X Y Z>;
bindings = <&key_repeat>;
max-prior-idle-ms = <1200>;
strict-modifiers;
};
};
};
};

// tap: sticky-shift | shift + tap/ double-tap: caps-word | hold: shift
ZMK_MOD_MORPH(smart_shft,
bindings = <&sk LSHFT>, <&caps_word>;
bindings = <&magic>, <&caps_word>;
mods = <(MOD_LSFT)>;
)
&caps_word { // mods deactivate caps-word, requires PR #1451
Expand Down
2 changes: 1 addition & 1 deletion config/corneish_zen.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

/* map Zen's extra keys */
#define X_LH &kp LGUI // thumb row, left
#define X_RH &smart_mouse // thumb row, right
#define X_RH &leader // thumb row, right

/* activate bluetooth */
#define CONFIG_WIRELESS
Expand Down
2 changes: 1 addition & 1 deletion config/west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
manifest:
defaults:
remote: urob
revision: v0.1
revision: v0.1 # Pin everything to v0.1

remotes:
- name: urob
Expand Down
54 changes: 38 additions & 16 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 9 additions & 7 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";

# Version of requirements.txt installed in pythonEnv
zephyr.url = "github:zephyrproject-rtos/zephyr/v3.5.0";
zephyr.url = "github:zmkfirmware/zephyr/v3.5.0+zmk-fixes";
zephyr.flake = false;

# Zephyr sdk and toolchain
zephyr-nix.url = "github:urob/zephyr-nix";
zephyr-nix.url = "github:adisbladis/zephyr-nix";
zephyr-nix.inputs.zephyr.follows = "zephyr";
zephyr-nix.inputs.nixpkgs.follows = "nixpkgs";
};
Expand All @@ -22,17 +22,19 @@
keymap_drawer = pkgs.python3Packages.callPackage ./draw { };

in {
default = pkgs.mkShell {
default = pkgs.mkShellNoCC {
packages = [
keymap_drawer

zephyr.pythonEnv
(zephyr.sdk.override { targets = [ "arm-zephyr-eabi" ]; })
(zephyr.sdk-0_16.override { targets = [ "arm-zephyr-eabi" ]; })

pkgs.cmake
pkgs.cmake # part of the toolchain? not detected by which
pkgs.dtc
pkgs.ninja
pkgs.qemu # needed for native_posix target
# pkgs.ccache
# pkgs.dfu-util
# pkgs.qemu # needed for native_posix target

# Uncomment these if you don't have system-wide versions:
# pkgs.gawk # awk
Expand Down

0 comments on commit 99506a8

Please sign in to comment.