tvl-depot/users/grfn/keyboard/default.nix
sterni 0b64577702 chore(3p/sources): Bump channels & overlays
* //3p/sources: temporarily switch to nixos-unstable-small, since it
  includes:

  - evans update we are interested in, allowing us to drop our evans
    patches.
  - awscli2 update that unbreaks //users/grfn

* //3p/overlays/tvl:

  - drop evans patches
  - update tdlib to 1.8.11 to make tazjin's emacs happy
  - drop obsolete mullvad workaround

* //users/grfn/keyboard: disable -Werror for array-bounds warnings.
  Seems like a non-trivial job to resolve the warning properly,
  hopefully GCC 12 still generates the same working code as GCC 11 used
  to.

* //users/grfn/system/home: remove yubikey-manager-qt.
  Yubico can't seem to keep that on pace with yubikey-manager. It
  requires a <5 version of the latter which is incompatible with the
  recently released cryptography >= 39.

* //3p/gerrit: update changed FOD hash for the fetch step

Change-Id: I590ab996247e69b0ab5059cd173840ef4ebfe939
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8133
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: sterni <sternenseemann@systemli.org>
Reviewed-by: grfn <grfn@gws.fyi>
2023-03-02 14:35:49 +00:00

73 lines
1.8 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ pkgs, ... }:
with pkgs;
let avrlibc = pkgsCross.avr.libcCross; in
rec {
qmkSource = fetchgit {
url = "https://github.com/qmk/qmk_firmware";
rev = "ab1650606c36f85018257aba65d9c3ff8ec42e71";
sha256 = "1k59flkvhjzmfl0yz9z37lqhvad7m9r5wy1p1sjk5274rsmylh79";
fetchSubmodules = true;
};
layout = stdenv.mkDerivation rec {
name = "ergodox_ez_grfn.hex";
src = qmkSource;
buildInputs = [
dfu-programmer
dfu-util
diffutils
git
python3
pkgsCross.avr.buildPackages.binutils
pkgsCross.avr.buildPackages.gcc
avrlibc
avrdude
];
AVR_CFLAGS = [
"-isystem ${avrlibc}/avr/include"
"-L${avrlibc}/avr/lib/avr5"
# GCC 12 has improved array-bounds warnings, failing the build of QMK.
# Newer versions of the firmware would work probably, but they heavily
# altered the build system, so it is non-trivial. Backporting the patch
# that fixes it seems difficult the next change to the offending matrix.c
# after the pinned qmkSource commit is
# https://github.com/qmk/qmk_firmware/commit/11c308d436180974b7719ce78cdffdd83a1302c0
# which heavily changes the way the code works.
#
# TODO(grfn): address this properly
"-Wno-error=array-bounds"
];
AVR_ASFLAGS = AVR_CFLAGS;
patches = [ ./increase-tapping-delay.patch ];
postPatch = ''
mkdir keyboards/ergodox_ez/keymaps/grfn
cp ${./keymap.c} keyboards/ergodox_ez/keymaps/grfn/keymap.c
'';
buildPhase = ''
make ergodox_ez:grfn
'';
installPhase = ''
cp ergodox_ez_grfn.hex $out
'';
};
flash = writeShellScript "flash.sh" ''
${teensy-loader-cli}/bin/teensy-loader-cli \
-v \
--mcu=atmega32u4 \
-w ${layout}
'';
meta.ci.targets = [ "layout" ];
}