tvl-depot/users/grfn/keyboard/default.nix
Griffin Smith 6266c5d32f refactor(users/glittershark): Rename to grfn
Rename my //users directory and all places that refer to glittershark to
grfn, including nix references and documentation.

This may require some extra attention inside of gerrit's database after
it lands to allow me to actually push things.

Change-Id: I4728b7ec2c60024392c1c1fa6e0d4a59b3e266fa
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2933
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Reviewed-by: lukegb <lukegb@tvl.fyi>
Reviewed-by: glittershark <grfn@gws.fyi>
2021-04-12 14:45:51 +00:00

63 lines
1.2 KiB
Nix

{ 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.gcc8
avrlibc
avrdude
];
AVR_CFLAGS = [
"-isystem ${avrlibc}/avr/include"
"-L${avrlibc}/avr/lib/avr5"
];
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.targets = [ "layout" ];
}