aboutsummaryrefslogtreecommitdiff
path: root/modules/qmk.nix
diff options
context:
space:
mode:
authorChris Wells <chris@mathematicaster.org>2025-10-21 10:38:26 -0500
committerChris Wells <chris@mathematicaster.org>2025-10-21 10:38:26 -0500
commit7aa390883104725c64c65d20a0713cfcd654f637 (patch)
treea3a33e5423e9136ad064b48aee0e41966329c1f0 /modules/qmk.nix
parente3343bc80dc54416d4e8ee6a60a8e92b630810de (diff)
downloadfw-manager-7aa390883104725c64c65d20a0713cfcd654f637.tar
fw-manager-7aa390883104725c64c65d20a0713cfcd654f637.tar.gz
fw-manager-7aa390883104725c64c65d20a0713cfcd654f637.tar.bz2
fw-manager-7aa390883104725c64c65d20a0713cfcd654f637.tar.lz
fw-manager-7aa390883104725c64c65d20a0713cfcd654f637.tar.xz
fw-manager-7aa390883104725c64c65d20a0713cfcd654f637.tar.zst
fw-manager-7aa390883104725c64c65d20a0713cfcd654f637.zip
More correct dfu-util flash script + rearranged personal devices
Diffstat (limited to 'modules/qmk.nix')
-rw-r--r--modules/qmk.nix32
1 files changed, 19 insertions, 13 deletions
diff --git a/modules/qmk.nix b/modules/qmk.nix
index c083b06..3834369 100644
--- a/modules/qmk.nix
+++ b/modules/qmk.nix
@@ -73,6 +73,8 @@ in {
name = "qmk:${config.qmk.keyboard._path}:${config.qmk.keymap.name}";
src = config.qmk.qmk_firmware;
+ allowSubstitutes = false;
+
# hardeningDisable = [ "pic" "pie" ];
nativeBuildInputs = [
@@ -81,22 +83,23 @@ in {
# dontFixup = true;
- preBuild = lib.optionalString (ksrc != null) ''
+ postPatch = lib.optionalString (ksrc != null) /* bash */ ''
mkdir -pv "${config.qmk.keymap._path}"
cp -v "${ksrc}"/* "${config.qmk.keymap._path}"
'';
- buildPhase = ''
- # SKIP_GIT=true BUILD_DIR=build \
- # make "${config.qmk.keyboard._path}:${config.qmk.keymap.name}"
- qmk compile \
- --env SKIP_GIT=yes \
- --env BUILD_DIR=build \
- --env SKIP_VERSION=yes \
- --env VERBOSE=true \
- --env ALLOW_WARNINGS=yes \
- --keyboard "${config.qmk.keyboard._path}" \
- --keymap "${config.qmk.keymap.name}"
+ buildPhase = /* bash */ ''
+ runHook preBuild
+
+ qmk compile \
+ --env SKIP_GIT=yes \
+ --env BUILD_DIR=build \
+ --env SKIP_VERSION=yes \
+ --env VERBOSE=true \
+ --keyboard "${config.qmk.keyboard._path}" \
+ --keymap "${config.qmk.keymap.name}"
+
+ runHook postBuild
'';
installPhase = ''
@@ -108,7 +111,10 @@ in {
};
};
flash = mkOption {
- type = types.functionTo (types.either types.package types.str);
+ type = types.functionTo <| types.either types.package types.str;
+ default = hex: ''
+ "${pkgs.dfu-util}/bin/dfu-util" --alt 0 --dfuse-address 0x08000000:leave -D "${hex}.hex"
+ '';
};
};