Skip to content

Commit

Permalink
modules
Browse files Browse the repository at this point in the history
rename

fix import order

fix draw
  • Loading branch information
juliamertz committed Nov 9, 2024
1 parent 09a237c commit fe88435
Show file tree
Hide file tree
Showing 9 changed files with 142 additions and 237 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
*~
env/
result
flash/target
flash/debug
.direnv
30 changes: 23 additions & 7 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
Expand Up @@ -5,11 +5,17 @@
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};

glove80-zmk = {
# Community fork with per-layer rgb
url = "github:darknao/zmk/darknao/rgb-dts";
# url = "github:moergo-sc/zmk";
url = "github:juliamertz/zmk";
flake = false;
};
zmk-helpers = {
url = "github:urob/zmk-helpers";
flake = false;
};
firmware-loader = {
Expand All @@ -20,10 +26,6 @@
url = "github:caksoylar/keymap-drawer";
flake = false;
};
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs =
Expand Down
4 changes: 2 additions & 2 deletions packages/dtsfmt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ rustPlatform.buildRustPackage rec {
meta.mainProgram = pname;
src = fetchgit {
url = "https://github.com/juliamertz/${pname}.git";
rev = "b47a3720002ca06d657c7147f7dc56ca7abd68eb";
hash = "sha256-iepKJVZmCPo6TKoy1+kI41N7tDy+Ozf2SjW9bkcVmLo=";
rev = "ce24df4f243130876558d6ddfb958880b6187b13";
hash = "sha256-YVlvwZkr9m5SUY6AsG4dobvgKSeQbtAwOm/I7/kdXXc=";
};
cargoHash = "sha256-5fMoMaDHAAhfaTEdFwMqzD6N2zheh+AIjgCmaZZex84=";
}
7 changes: 4 additions & 3 deletions packages/firmware.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
let
firmware = import inputs.glove80-zmk { inherit pkgs; };

keymap = ../glove80.keymap;
keymap = "${../src}/main.keymap";
kconfig = ../glove80.conf;
extra_modules = [ inputs.zmk-helpers ];

left = firmware.zmk.override {
inherit keymap kconfig;
inherit keymap kconfig extra_modules;
board = "glove80_lh";
};

right = firmware.zmk.override {
inherit keymap kconfig;
inherit keymap kconfig extra_modules;
board = "glove80_rh";
};
in
Expand Down
4 changes: 2 additions & 2 deletions packages/visual.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ stdenvNoCC.mkDerivation {

buildPhase = ''
mkdir -p $out
${keymapDrawer} -c ${configuration} parse -c 10 -z glove80.keymap > $out/layout.yaml
${keymapDrawer} -c ${configuration} draw $out/layout.yaml > $out/layout.svg
${keymapDrawer} -c ${configuration} parse -c 10 -z ${../src/main.dts} > $out/layout.yaml
${keymapDrawer} -c ${configuration} draw --qmk-keyboard glove80 $out/layout.yaml > $out/layout.svg
'';
}
94 changes: 94 additions & 0 deletions src/defaults.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/ {
behaviors {
lower: lower {
compatible = "zmk,behavior-tap-dance";
label = "LAYER_TAP_DANCE";
#binding-cells = <0>;
tapping-term-ms = <200>;
bindings = <&mo LAYER_Lower>, <&to LAYER_Lower>;
};
};
};

/ {
macros {
rgb_ug_status_macro: rgb_ug_status_macro {
label = "RGB_UG_STATUS";
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings = <&rgb_ug RGB_STATUS>;
};
};
};

/ {
behaviors {
magic: magic {
compatible = "zmk,behavior-hold-tap";
label = "MAGIC_HOLD_TAP";
#binding-cells = <2>;
tapping-term-ms = <200>;
bindings = <&mo>, <&rgb_ug_status_macro>;
};
};
};

// Bluetooth behaviors
/ {
behaviors {
bt_0: bt_0 {
compatible = "zmk,behavior-tap-dance";
label = "BT_0";
#binding-cells = <0>;
tapping-term-ms = <200>;
bindings = <&bt_select_0>, <&bt BT_DISC 0>;
};
bt_1: bt_1 {
compatible = "zmk,behavior-tap-dance";
label = "BT_1";
#binding-cells = <0>;
tapping-term-ms = <200>;
bindings = <&bt_select_1>, <&bt BT_DISC 1>;
};
bt_2: bt_2 {
compatible = "zmk,behavior-tap-dance";
label = "BT_2";
#binding-cells = <0>;
tapping-term-ms = <200>;
bindings = <&bt_select_2>, <&bt BT_DISC 2>;
};
bt_3: bt_3 {
compatible = "zmk,behavior-tap-dance";
label = "BT_3";
#binding-cells = <0>;
tapping-term-ms = <200>;
bindings = <&bt_select_3>, <&bt BT_DISC 3>;
};
};
macros {
bt_select_0: bt_select_0 {
label = "BT_SELECT_0";
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings = <&out OUT_BLE>, <&bt BT_SEL 0>;
};
bt_select_1: bt_select_1 {
label = "BT_SELECT_1";
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings = <&out OUT_BLE>, <&bt BT_SEL 1>;
};
bt_select_2: bt_select_2 {
label = "BT_SELECT_2";
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings = <&out OUT_BLE>, <&bt BT_SEL 2>;
};
bt_select_3: bt_select_3 {
label = "BT_SELECT_3";
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings = <&out OUT_BLE>, <&bt BT_SEL 3>;
};
};
};
5 changes: 5 additions & 0 deletions src/keys.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "zmk-helpers/key-labels/glove80.h"

#define KEYS_L LC1 LC2 LC3 LC4 LC5 LN0 LN1 LN2 LN3 LN4 LN5 LT0 LT1 LT2 LT3 LT4 LT5 LM0 LM1 LM2 LM3 LM4 LM5 LB0 LB1 LB2 LB3 LB4 LB5 LF1 LF2 LF3 LF4 LF5
#define KEYS_R RC1 RC2 RC3 RC4 RC5 RN0 RN1 RN2 RN3 RN4 RN5 RT0 RT1 RT2 RT3 RT4 RT5 RM0 RM1 RM2 RM3 RM4 RM5 RB0 RB1 RB2 RB3 RB4 RB5 RF1 RF2 RF3 RF4 RF5
#define THUMBS LH0 LH1 LH2 LH3 LH4 LH5 RH0 RH1 RH2 RH3 RH4 RH5
Loading

0 comments on commit fe88435

Please sign in to comment.