feat(users/flokli/keyboard): init
This packages up my keyboard firmware used for the Keychron K6 Pro. We add a custom keymap to the `keyboards/keychron/k6_pro/ansi/rgb/ keymaps` directory, a copy from the `default` one (with a modified `keymap.c`), and then build that as a makefile target. `via` is *disabled*, as their keybindings take priority over keymap.c. Luckily, only `qmk` seems to be sufficient to build it. A simple `:flash` target/script is provided as well, it relies on some udev rules set in the global system (`hardware.keyboard.qmk.enable = true`). Change-Id: I9f7a7a992e13516c32033127f94e37aec62d6b67 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10020 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
This commit is contained in:
parent
6b6a5a75ec
commit
a49d5d2279
3 changed files with 116 additions and 0 deletions
39
users/flokli/keyboard/default.nix
Normal file
39
users/flokli/keyboard/default.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{ depot, pkgs, ... }:
|
||||
|
||||
rec {
|
||||
firmware = pkgs.stdenv.mkDerivation {
|
||||
name = "keychron-k6_pro-firmware";
|
||||
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "Keychron"; # the Keychron fork of qmk/qmk_firmware
|
||||
repo = "qmk_firmware";
|
||||
rev = "e0a48783e7cde92d1edfc53a8fff511c45e869d4"; # bluetooth_playground branch
|
||||
hash = "sha256-Pk9kXktmej9JyvSt7UMEW2FDrBg7k1lOssh6HjrP5ro=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkgs.qmk
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
mkdir -p keyboards/keychron/k6_pro/ansi/rgb/keymaps/flokli
|
||||
cp ${./keymap.c} keyboards/keychron/k6_pro/ansi/rgb/keymaps/flokli/keymap.c
|
||||
cp ${./rules.mk} keyboards/keychron/k6_pro/ansi/rgb/keymaps/flokli/rules.mk
|
||||
|
||||
make keychron/k6_pro/ansi/rgb:flokli
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
|
||||
cp keychron_k6_pro_ansi_rgb_flokli.bin $out/
|
||||
'';
|
||||
};
|
||||
|
||||
flash = pkgs.writeShellScript "flash.sh" ''
|
||||
${pkgs.qmk}/bin/qmk flash ${firmware}/keychron_k6_pro_ansi_rgb_flokli.bin
|
||||
'';
|
||||
|
||||
meta.ci.targets = [ "firmware" ];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue