about summary refs log tree commit diff
path: root/users/glittershark/keyboard
diff options
context:
space:
mode:
Diffstat (limited to 'users/glittershark/keyboard')
-rw-r--r--users/glittershark/keyboard/default.nix34
-rwxr-xr-xusers/glittershark/keyboard/flash2
2 files changed, 24 insertions, 12 deletions
diff --git a/users/glittershark/keyboard/default.nix b/users/glittershark/keyboard/default.nix
index 18169b5be1ba..7227c1d318a8 100644
--- a/users/glittershark/keyboard/default.nix
+++ b/users/glittershark/keyboard/default.nix
@@ -1,7 +1,8 @@
-{ nixpkgs ? import <nixpkgs> {}
-}:
+{ pkgs, ... }:
 
-with nixpkgs;
+with pkgs;
+
+let avrlibc = pkgsCross.avr.libcCross; in
 
 rec {
   qmkSource = fetchgit {
@@ -11,18 +12,29 @@ rec {
     fetchSubmodules = true;
   };
 
-  qmk = import "${qmkSource}/shell.nix" {
-    avr = true;
-    teensy = true;
-    arm = false;
-  };
-
-  layout = stdenv.mkDerivation {
+  layout = stdenv.mkDerivation rec {
     name = "ergodox_ez_grfn.hex";
 
     src = qmkSource;
 
-    inherit (qmk) buildInputs AVR_CFLAGS AVR_ASFLAGS;
+    buildInputs = [
+      dfu-programmer
+      dfu-util
+      diffutils
+      git
+      python3
+      pkgsCross.avr.buildPackages.binutils
+      pkgsCross.avr.buildPackages.gcc8
+      avrlibc
+      avrdude
+    ];
+
+    AVR_CFLAGS = [
+      "-isystem ${avrlibc}/avr/include"
+      "-L${avrlibc}/avr/lib/avr5"
+    ];
+
+    AVR_ASFLAGS = AVR_CFLAGS;
 
     patches = [ ./increase-tapping-delay.patch ];
 
diff --git a/users/glittershark/keyboard/flash b/users/glittershark/keyboard/flash
index 64f721f4193a..efc89463c84b 100755
--- a/users/glittershark/keyboard/flash
+++ b/users/glittershark/keyboard/flash
@@ -1,2 +1,2 @@
 #!/usr/bin/env bash
-exec "$(nix-build --no-out-link . -A flash)"
+exec "$(nix-build --no-out-link ../../.. -A users.glittershark.keyboard.flash)"