1 { avr ? true, arm ? true, teensy ? true }:
5 let addDarwinSupport = pkg: pkg.overrideAttrs (oldAttrs: {
6 meta.platforms = (oldAttrs.meta.platforms or []) ++ self.lib.platforms.darwin;
9 dfu-programmer = addDarwinSupport super.dfu-programmer;
10 teensy-loader-cli = addDarwinSupport super.teensy-loader-cli;
12 avrgcc = super.avrgcc.overrideAttrs (oldAttrs: rec {
13 name = "avr-gcc-8.1.0";
14 src = super.fetchurl {
15 url = "mirror://gcc/releases/gcc-8.1.0/gcc-8.1.0.tar.xz";
16 sha256 = "0lxil8x0jjx7zbf90cy1rli650akaa6hpk8wk8s62vk2jbwnc60x";
21 nixpkgs = builtins.fetchTarball {
22 url = "https://github.com/NixOS/nixpkgs/archive/0260747427737b980f0.tar.gz";
23 sha256 = "1p2yc6b40xvvxvmlqd9wb440pkrimnlc2wsbpa5rddlpx1dn8qmf";
26 pkgs = import nixpkgs { overlays = [ overlay ]; };
31 "-isystem ${avrlibc}/avr/include"
32 "-B${avrlibc}/avr/lib/avr5"
33 "-L${avrlibc}/avr/lib/avr5"
34 "-B${avrlibc}/avr/lib/avr35"
35 "-L${avrlibc}/avr/lib/avr35"
36 "-B${avrlibc}/avr/lib/avr51"
37 "-L${avrlibc}/avr/lib/avr51"
41 name = "qmk-firmware";
43 buildInputs = [ dfu-programmer dfu-util diffutils git python3 ]
44 ++ lib.optional avr [ avrbinutils avrgcc avrlibc avrdude ]
45 ++ lib.optional arm [ gcc-arm-embedded ]
46 ++ lib.optional teensy [ teensy-loader-cli ];
48 CFLAGS = lib.optional avr avr_incflags;
49 ASFLAGS = lib.optional avr avr_incflags;