binds/qmk: init

Create the `vim.binds.qmk` module with `enable` and `setupOpts`.
This commit is contained in:
Cool-Game-Dev 2025-08-13 20:05:08 -05:00
commit ef9609c207
No known key found for this signature in database
7 changed files with 101 additions and 0 deletions

View file

@ -0,0 +1,26 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.lua) toLuaObject;
inherit (lib.nvim.dag) entryAfter;
cfg = config.vim.binds.qmk;
in {
config = mkIf cfg.enable {
vim = {
startPlugins = ["qmk-nvim"];
pluginRC.qmk-nvim = entryAfter ["nvim-notify"] ''
require('qmk').setup(${toLuaObject cfg.setupOpts})
'';
};
assertions = [{
assertion = !(cfg.setupOpts.variant == "zmk") && !(cfg.setupOpts.comment_preview.position == "inside");
message = "comment_preview.position can only be set to inside when using the qmk layoyt";
}];
};
}