Basic mac vs linux modes

This commit is contained in:
2026-03-14 19:02:08 -07:00
committed by Zuckerberg
parent bedac2945a
commit 8431906337
9 changed files with 271 additions and 10 deletions

View File

@@ -3,6 +3,7 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
self.submodules = true;
};
outputs = { self, nixpkgs }:
@@ -23,11 +24,7 @@
shellHook = ''
export QMK_HOME="$PWD/qmk_firmware"
# Symlink tracked keymap into QMK tree
if [ -d "$QMK_HOME/keyboards/system76/launch_3" ]; then
ln -sfn "$PWD/keymaps/custom" "$QMK_HOME/keyboards/system76/launch_3/keymaps/custom"
fi
ln -sfn "$PWD/keymaps/custom" "$QMK_HOME/keyboards/system76/launch_3/keymaps/custom"
'';
};
});
@@ -35,20 +32,32 @@
packages = forAllSystems (system:
let pkgs = nixpkgs.legacyPackages.${system};
in {
default = self.packages.${system}.firmware;
firmware = pkgs.stdenv.mkDerivation {
pname = "launch3-firmware";
version = "0.1.0";
src = ./qmk_firmware;
postUnpack = ''
cp -r ${./keymaps/custom} $sourceRoot/keyboards/system76/launch_3/keymaps/custom
'';
postPatch = ''
patchShebangs util/uf2conv.py
'';
nativeBuildInputs = [
pkgs.qmk
pkgs.python3Packages.appdirs
pkgs.python3
];
buildPhase = ''
export HOME=$(mktemp -d)
export QMK_HOME="$PWD"
export SKIP_GIT=true
qmk compile -kb system76/launch_3 -km custom
'';