diff --git a/configs/nixos/modules/desktop/session/hyprland/default.nix b/configs/nixos/modules/desktop/session/hyprland/default.nix index f68ba07..e73441e 100644 --- a/configs/nixos/modules/desktop/session/hyprland/default.nix +++ b/configs/nixos/modules/desktop/session/hyprland/default.nix @@ -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); }; }; };