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 = pkgsCross.arm-embedded.buildPackages.gcc;
12 "-isystem ${avrlibc}/avr/include"
13 "-B${avrlibc}/avr/lib/avr5"
14 "-L${avrlibc}/avr/lib/avr5"
15 "-B${avrlibc}/avr/lib/avr35"
16 "-L${avrlibc}/avr/lib/avr35"
17 "-B${avrlibc}/avr/lib/avr51"
18 "-L${avrlibc}/avr/lib/avr51"
20 avrgcc = pkgsCross.avr.buildPackages.gcc.overrideAttrs (oldAttrs: rec {
21 name = "avr-gcc-8.1.0";
23 url = "mirror://gcc/releases/gcc-8.1.0/gcc-8.1.0.tar.xz";
24 sha256 = "0lxil8x0jjx7zbf90cy1rli650akaa6hpk8wk8s62vk2jbwnc60x";
30 name = "qmk-firmware";
32 buildInputs = [ dfu-programmer dfu-util diffutils git ]
33 ++ lib.optional avr [ avrbinutils avrgcc avrlibc avrdude ]
34 ++ lib.optional arm [ gcc-arm-embedded ]
35 ++ lib.optional teensy [ teensy-loader-cli ];
37 CFLAGS = lib.optional avr avr_incflags;
38 ASFLAGS = lib.optional avr avr_incflags;