1 # dfu-programmer doesn't have darwin on it's list of supported platforms
2 { pkgs ? import <nixpkgs> { config = { allowUnsupportedSystem = true; }; }
3 , avr ? true, arm ? true, teensy ? true }:
7 avrbinutils = pkgsCross.avr.buildPackages.binutils;
8 avrlibc = pkgsCross.avr.libcCross;
9 gcc-arm-embedded = (import (builtins.fetchTarball {
10 url = "https://github.com/NixOS/nixpkgs-channels/archive/87f146a41c463a64c93022b11cf19716b3a22037.tar.gz";
11 sha256 = "0rk8haf19plw6vyvq0am99rik0hrrysknjw0f2vs7985awngy3q2";
12 }) {}).gcc-arm-embedded;
15 "-isystem ${avrlibc}/avr/include"
16 "-B${avrlibc}/avr/lib/avr5"
17 "-L${avrlibc}/avr/lib/avr5"
18 "-B${avrlibc}/avr/lib/avr35"
19 "-L${avrlibc}/avr/lib/avr35"
20 "-B${avrlibc}/avr/lib/avr51"
21 "-L${avrlibc}/avr/lib/avr51"
23 avrgcc = pkgsCross.avr.buildPackages.gcc.overrideAttrs (oldAttrs: rec {
24 name = "avr-gcc-8.1.0";
26 url = "mirror://gcc/releases/gcc-8.1.0/gcc-8.1.0.tar.xz";
27 sha256 = "0lxil8x0jjx7zbf90cy1rli650akaa6hpk8wk8s62vk2jbwnc60x";
33 name = "qmk-firmware";
35 buildInputs = [ dfu-programmer dfu-util diffutils git python3 ]
36 ++ lib.optional avr [ avrbinutils avrgcc avrlibc avrdude ]
37 ++ lib.optional arm [ gcc-arm-embedded ]
38 ++ lib.optional teensy [ teensy-loader-cli ];
40 CFLAGS = lib.optional avr avr_incflags;
41 ASFLAGS = lib.optional avr avr_incflags;