]> git.donarmstrong.com Git - qmk_firmware.git/blob - shell.nix
Added OLED Display autoscroll during periods of OLED data inactivity (#6546)
[qmk_firmware.git] / shell.nix
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 }:
4
5 with pkgs;
6 let
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;
13
14   avr_incflags = [
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"
22   ];
23   avrgcc = pkgsCross.avr.buildPackages.gcc.overrideAttrs (oldAttrs: rec {
24     name = "avr-gcc-8.1.0";
25     src = fetchurl {
26       url = "mirror://gcc/releases/gcc-8.1.0/gcc-8.1.0.tar.xz";
27       sha256 = "0lxil8x0jjx7zbf90cy1rli650akaa6hpk8wk8s62vk2jbwnc60x";
28     };
29   });
30 in
31
32 stdenv.mkDerivation {
33   name = "qmk-firmware";
34
35   buildInputs = [ dfu-programmer dfu-util diffutils git ]
36     ++ lib.optional avr [ avrbinutils avrgcc avrlibc avrdude ]
37     ++ lib.optional arm [ gcc-arm-embedded ]
38     ++ lib.optional teensy [ teensy-loader-cli ];
39
40   CFLAGS = lib.optional avr avr_incflags;
41   ASFLAGS = lib.optional avr avr_incflags;
42 }