Peter's keyboard firmware (QMK) https://qmk.fm/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

shell.nix 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. with pkgs;
  5. let
  6. avrbinutils = pkgsCross.avr.buildPackages.binutils;
  7. avrlibc = pkgsCross.avr.libcCross;
  8. gcc-arm-embedded = pkgsCross.arm-embedded.buildPackages.gcc;
  9. avr_incflags = [
  10. "-isystem ${avrlibc}/avr/include"
  11. "-B${avrlibc}/avr/lib/avr5"
  12. "-L${avrlibc}/avr/lib/avr5"
  13. "-B${avrlibc}/avr/lib/avr35"
  14. "-L${avrlibc}/avr/lib/avr35"
  15. "-B${avrlibc}/avr/lib/avr51"
  16. "-L${avrlibc}/avr/lib/avr51"
  17. ];
  18. avrgcc = pkgsCross.avr.buildPackages.gcc.overrideAttrs (oldAttrs: rec {
  19. name = "avr-gcc-8.1.0";
  20. src = fetchurl {
  21. url = "mirror://gcc/releases/gcc-8.1.0/gcc-8.1.0.tar.xz";
  22. sha256 = "0lxil8x0jjx7zbf90cy1rli650akaa6hpk8wk8s62vk2jbwnc60x";
  23. };
  24. });
  25. in
  26. stdenv.mkDerivation {
  27. name = "qmk-firmware";
  28. buildInputs = [ dfu-programmer dfu-util diffutils git ]
  29. ++ lib.optional avr [ avrbinutils avrgcc avrlibc avrdude ]
  30. ++ lib.optional arm [ gcc-arm-embedded ]
  31. ++ lib.optional teensy [ teensy-loader-cli ];
  32. CFLAGS = lib.optional avr avr_incflags;
  33. ASFLAGS = lib.optional avr avr_incflags;
  34. }