nvf/modules/plugins/utility/binds/qmk/config.nix
Cool-Game-Dev ef9609c207
binds/qmk: init
Create the `vim.binds.qmk` module with `enable` and `setupOpts`.
2025-08-13 20:11:51 -05:00

26 lines
624 B
Nix

{
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";
}];
};
}