refactor(hyprland): inline keybind rendering

This commit is contained in:
2026-10-10 15:07:17 -04:00
parent 5d2083d40a
commit 2f2fdb2b31

View File

@@ -4,24 +4,6 @@
...
}:
# The Hyprland compositor.
let
mkBind = keybind: {
_args = [
keybind.keys
(mkAction keybind.action)
];
};
mkAction =
action:
lib.generators.mkLuaInline ({ exec = "hl.dsp.exec_cmd(${toLua action.command})"; }.${action.kind});
keybinds = lib.attrValues (
lib.attrByPath [ config.networking.hostName ] { } config.registry.keybind
);
toLua = lib.generators.toLua { };
in
{
options.modules.desktop.session.hyprland.enable = lib.mkEnableOption "the Hyprland compositor";
@@ -53,7 +35,12 @@ in
settings = {
config.general.layout = "dwindle";
bind = map mkBind keybinds;
bind = lib.mapAttrsToList (_name: keybind: {
_args = [
keybind.keys
(lib.generators.mkLuaInline "hl.dsp.exec_cmd(${lib.generators.toLua { } keybind.action.command})")
];
}) (lib.attrByPath [ config.networking.hostName ] { } config.registry.keybind);
};
};
};