From 1dbcebe4950943502c8fbfe0a99b618e1b134daa Mon Sep 17 00:00:00 2001 From: Julia Mertz Date: Tue, 12 Nov 2024 20:42:54 +0100 Subject: [PATCH] cleanup lint --- flake.nix | 40 +++++++++++++++++++++------------------- packages/firmware.nix | 23 ++++++++++------------- 2 files changed, 31 insertions(+), 32 deletions(-) diff --git a/flake.nix b/flake.nix index 8f4f175..321a423 100644 --- a/flake.nix +++ b/flake.nix @@ -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 ]; }; diff --git a/packages/firmware.nix b/packages/firmware.nix index b4771c5..9e3b04f 100644 --- a/packages/firmware.nix +++ b/packages/firmware.nix @@ -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