summary refs log tree commit diff stats
path: root/package.nix
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-12-28 21:09:31 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-12-28 21:09:31 +0100
commit569e1d2c862e213bca257914516aa932ebadf8b9 (patch)
tree16af67acc00c20edb5c1acc6169c27f78e507bce /package.nix
parentfeat(src): Fmt and enable unicode input (diff)
downloadqmk_layout-569e1d2c862e213bca257914516aa932ebadf8b9.zip
fix(src): Add some default stuff
Diffstat (limited to 'package.nix')
-rw-r--r--package.nix22
1 files changed, 15 insertions, 7 deletions
diff --git a/package.nix b/package.nix
index 807a57c..8cde8bf 100644
--- a/package.nix
+++ b/package.nix
@@ -4,10 +4,11 @@
   # deps
   qmk,
   gnumake,
+  git,
 }: let
   layout_id = "KWBYA";
   layout_geometry = "moonlander";
-  FIRMWARE_VERSION = "24";
+  firmware_version = "24";
 in
   stdenv.mkDerivation
   {
@@ -15,16 +16,20 @@ in
     version = "25";
 
     src = fetchgit {
-      url = "https://github.com/zsa/qmk_firmware";
-      rev = "4ae6ea9679fbd4277caa1036d326ddfce278b4d2"; # 2024-12-09T17:43:04 CET
-      hash = "sha256-c+fojw64dHIYoO20cO9Nd1pnQwBDPPbrh6Erf9QTyGw=";
+      url = "https://github.com/qmk/qmk_firmware/";
+      rev = "refs/tags/0.27.1";
+      hash = "sha256-Chq4R8rICY1eyt5r2dkPm34zDOm6TqPKAXQWPp0nByA=";
 
       fetchSubmodules = true;
+
+      # This allows for a compiled in version
+      leaveDotGit = true;
     };
 
     nativeBuildInputs = [
       gnumake
       qmk
+      git
     ];
 
     buildPhase =
@@ -35,7 +40,7 @@ in
         runHook preBuild
 
         ## Set keyboard directory and make prefix based on firmware version
-        if [ "${FIRMWARE_VERSION}" -ge 24 ]; then
+        if [ "${firmware_version}" -ge 24 ]; then
             keyboard_directory="keyboards/zsa"
             keyboard_folder="zsa/${layout_geometry}"
         else
@@ -51,7 +56,6 @@ in
         cp --recursive "${./src}" "$key_dir"
 
         ## Build the layout
-        # qmk setup "zsa/qmk_firmware" -b 'firmware${FIRMWARE_VERSION}' -y
         make "$keyboard_folder:${layout_id}"
 
         runHook postBuild
@@ -60,7 +64,11 @@ in
       runHook preInstall
 
       mkdir --parents "$out/binary_output"
-      cp "./.build/zsa_moonlander_${layout_id}.bin" "$out/binary_output/"
+
+      cp --recursive "./.build" "$out/build"
+      rm --recursive "$out/build/obj_zsa_moonlander_${layout_id}"
+
+      ln --symbolic --relative "$out/build/zsa_moonlander_${layout_id}.bin" "$out/binary_output/"
 
       runHook postInstall
     '';