generated from moergo-sc/glove80-zmk-config
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
557a297
commit b1b8e2b
Showing
5 changed files
with
214 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
*~ | ||
env/ | ||
result |
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
{ | ||
inputs = { | ||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; | ||
glove80-zmk = { | ||
url = "github:moergo-sc/zmk"; | ||
flake = false; | ||
}; | ||
flake-parts = { | ||
url = "github:hercules-ci/flake-parts"; | ||
inputs.nixpkgs-lib.follows = "nixpkgs"; | ||
}; | ||
devshell = { | ||
url = "github:numtide/devshell"; | ||
inputs.nixpkgs.follows = "nixpkgs"; | ||
}; | ||
}; | ||
|
||
outputs = { | ||
self, | ||
nixpkgs, | ||
glove80-zmk, | ||
flake-parts, | ||
devshell, | ||
} @ inputs: | ||
flake-parts.lib.mkFlake {inherit inputs;} { | ||
systems = nixpkgs.lib.systems.flakeExposed; | ||
imports = [ | ||
inputs.devshell.flakeModule | ||
]; | ||
|
||
perSystem = { | ||
config, | ||
pkgs, | ||
system, | ||
... | ||
}: { | ||
packages.default = let | ||
firmware = import glove80-zmk {inherit pkgs;}; | ||
|
||
keymap = ./config/glove80.keymap; | ||
kconfig = ./config/glove80.conf; | ||
|
||
glove80_left = firmware.zmk.override { | ||
inherit keymap kconfig; | ||
board = "glove80_lh"; | ||
}; | ||
|
||
glove80_right = firmware.zmk.override { | ||
inherit keymap kconfig; | ||
board = "glove80_rh"; | ||
}; | ||
in | ||
firmware.combine_uf2 glove80_left glove80_right; | ||
|
||
devshells.default.commands = [ | ||
{ | ||
name = "flash"; | ||
command = /*bash*/ '' | ||
set +e | ||
root="/run/media/$(whoami)" | ||
dest_folder_name=$(ls $root | grep GLV80) | ||
dest="$root"/"$dest_folder_name" | ||
if [[ -n "$dest_folder_name" && -d "$dest" ]]; then | ||
echo Flashing to "$dest" | ||
cp ${config.packages.default}/glove80.uf2 "$dest"/CURRENT.UF2 | ||
exit 0 | ||
else | ||
echo "Error: Glove80 keyboard is not plugged-in" | ||
exit 1 | ||
fi | ||
''; | ||
help = "builds the firmware and copies it to the plugged-in keybaord half"; | ||
} | ||
]; | ||
|
||
formatter = pkgs.alejandra; | ||
}; | ||
}; | ||
} |