about summary refs log tree commit diff
path: root/users/flokli/keyboards/k6_pro/default.nix
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-01-19T22·07+0200
committerclbot <clbot@tvl.fyi>2024-01-19T23·00+0000
commit3af72dad390eb26d7c1e84cc79f949dcfa0c4d25 (patch)
tree19eba321ff08d4c03852b87c2095312cd56cc6fb /users/flokli/keyboards/k6_pro/default.nix
parent526295a71d205f68a3000884981b9312fc400469 (diff)
chore(users/flokli): move keyboard to keyboards/k6_pro r/7423
Change-Id: I8039053ee1fb7ed4beb564e20f98adcfc9e79fc6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10665
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/flokli/keyboards/k6_pro/default.nix')
-rw-r--r--users/flokli/keyboards/k6_pro/default.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/users/flokli/keyboards/k6_pro/default.nix b/users/flokli/keyboards/k6_pro/default.nix
new file mode 100644
index 000000000000..708bec7313b6
--- /dev/null
+++ b/users/flokli/keyboards/k6_pro/default.nix
@@ -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" ];
+}