Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Nix derivation for working with tmk_keyboard #619

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# A Nix shell for tmk_keyboard.
# Based on the shell for qmk/qmk_firmware:
# https://github.com/qmk/qmk_firmware/blob/master/shell.nix

with import <nixpkgs> {
config = {
allowUnsupportedSystem = true;
};
};

let
avrbinutils = pkgsCross.avr.buildPackages.binutils;
avrlibc = pkgsCross.avr.libcCross;

avr_incflags = [
"-isystem ${avrlibc}/avr/include"
"-B${avrlibc}/avr/lib/avr5"
"-L${avrlibc}/avr/lib/avr5"
"-B${avrlibc}/avr/lib/avr35"
"-L${avrlibc}/avr/lib/avr35"
"-B${avrlibc}/avr/lib/avr51"
"-L${avrlibc}/avr/lib/avr51"
];

avrgcc = pkgsCross.avr.buildPackages.gcc.overrideAttrs (oldAttrs: rec {
name = "avr-gcc-8.1.0";
src = fetchurl {
url = "mirror://gcc/releases/gcc-8.1.0/gcc-8.1.0.tar.xz";
sha256 = "0lxil8x0jjx7zbf90cy1rli650akaa6hpk8wk8s62vk2jbwnc60x";
};
});
in

stdenv.mkDerivation {
name = "tmk_keyboard";

buildInputs = [
diffutils
dfu-programmer
dfu-util
avrbinutils
avrgcc
avrlibc
avrdude
];

CFLAGS = avr_incflags;
ASFLAGS = avr_incflags;
}
1 change: 1 addition & 0 deletions tmk_core/doc/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Download and Install

If you use PJRC Teensy you don't need step 2 and 3 above, just get [Teensy loader][teensy-loader].

If you use NixOS or the Nix package manager, just run `nix-shell`.

### 2. Download source
You can find firmware source at github:
Expand Down