Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
lint
  • Loading branch information
juliamertz committed Nov 12, 2024
1 parent dd5e818 commit 1dbcebe
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 32 deletions.
40 changes: 21 additions & 19 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,28 @@
dtsfmt = inputs.dtsfmt.packages.${system}.default;
in
{
packages.firmware = callPackage ./packages/firmware.nix { inherit inputs; };
packages.visual = callPackage ./packages/visual.nix { inherit inputs; };
packages.flash = writeShellScriptBin "flash" ''
${lib.getExe firmwareLoader} --file ${packages.firmware}/glove80.uf2 --mount
'';
packages.format =
let
dtsfmtrc =
writeText ".dtsfmtrc.toml" # toml
''
layout = "moergo:glove80"
[options]
separate_sections = true
indent_size = 4
'';
in
writeShellScriptBin "dtsfmt" ''
${lib.getExe dtsfmt} --config-file ${dtsfmtrc} $@
packages = {
firmware = callPackage ./packages/firmware.nix { inherit inputs; };
visual = callPackage ./packages/visual.nix { inherit inputs; };
flash = writeShellScriptBin "flash" ''
${lib.getExe firmwareLoader} --file ${packages.firmware}/glove80.uf2 --mount
'';
format =
let
dtsfmtrc =
writeText ".dtsfmtrc.toml" # toml
''
layout = "moergo:glove80"
[options]
separate_sections = true
indent_size = 4
'';
in
writeShellScriptBin "dtsfmt" ''
${lib.getExe dtsfmt} --config-file ${dtsfmtrc} $@
'';
};

devShells.default = pkgs.mkShell { packages = [ packages.format ]; };

Expand Down
23 changes: 10 additions & 13 deletions packages/firmware.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
{ pkgs, inputs, ... }:
let
firmware = import inputs.glove80-zmk { inherit pkgs; };
board =
board:
firmware.zmk.override {
inherit board;
keymap = "${../src}/main.dts";
kconfig = ../glove80.conf;
extra_modules = [ inputs.zmk-helpers ];
};

keymap = "${../src}/main.dts";
kconfig = ../glove80.conf;
extra_modules = [ inputs.zmk-helpers ];

left = firmware.zmk.override {
inherit keymap kconfig extra_modules;
board = "glove80_lh";
};

right = firmware.zmk.override {
inherit keymap kconfig extra_modules;
board = "glove80_rh";
};
left = board "glove80_lh";
right = board "glove80_rh";
in
firmware.combine_uf2 left right

0 comments on commit 1dbcebe

Please sign in to comment.