2024-01-19 23:54:50 +01:00
|
|
|
{ depot, pkgs, ... }:
|
|
|
|
|
|
|
|
rec {
|
2024-05-11 14:25:40 +02:00
|
|
|
qmk_firmware_src = pkgs.fetchFromGitHub {
|
|
|
|
owner = "qmk";
|
|
|
|
repo = "qmk_firmware";
|
|
|
|
rev = "728aa576b0cd65c6fb7cf77132fdcd06fcedb643"; # develop branch
|
|
|
|
hash = "sha256-YmdX8nEsB1R8d265HAmvwejPjEHJdoTnm4QNigzrcyw=";
|
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2024-01-19 23:54:50 +01:00
|
|
|
firmware = pkgs.stdenv.mkDerivation {
|
|
|
|
name = "keychron-bastardkb-dilemma-firmware";
|
|
|
|
|
2024-05-11 14:25:40 +02:00
|
|
|
src = qmk_firmware_src;
|
2024-01-19 23:54:50 +01:00
|
|
|
|
2024-01-23 10:47:06 +01:00
|
|
|
patches = [ ./enable-taps.patch ];
|
|
|
|
|
2024-01-19 23:54:50 +01:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs util/uf2conv.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkgs.python3
|
|
|
|
pkgs.qmk
|
|
|
|
];
|
|
|
|
|
|
|
|
buildPhase = ''
|
2024-01-20 10:47:22 +01:00
|
|
|
mkdir -p keyboards/bastardkb/dilemma/3x5_3/keymaps/flokli
|
|
|
|
cp ${./keymap.c} keyboards/bastardkb/dilemma/3x5_3/keymaps/flokli/keymap.c
|
|
|
|
cp ${./rules.mk} keyboards/bastardkb/dilemma/3x5_3/keymaps/flokli/rules.mk
|
|
|
|
|
|
|
|
make bastardkb/dilemma/3x5_3:flokli
|
2024-01-19 23:54:50 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
2024-01-20 10:47:22 +01:00
|
|
|
cp bastardkb_dilemma_3x5_3_flokli.uf2 $out/
|
2024-01-19 23:54:50 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
flash = pkgs.writeShellScript "flash.sh" ''
|
2024-05-11 14:25:40 +02:00
|
|
|
QMK_HOME=${qmk_firmware_src} ${pkgs.qmk}/bin/qmk flash ${firmware}/bastardkb_dilemma_3x5_3_flokli.uf2
|
2024-01-19 23:54:50 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta.ci.targets = [ "firmware" ];
|
|
|
|
}
|