From 2d39511a082bd570d2acbee14302654acbf05ef6 Mon Sep 17 00:00:00 2001 From: alexion Date: Sun, 11 Oct 2026 12:25:20 -0400 Subject: [PATCH] refactor(hyprland): inline focus options --- .../desktop/session/hyprland/default.nix | 34 ++++++++----------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/configs/nixos/modules/desktop/session/hyprland/default.nix b/configs/nixos/modules/desktop/session/hyprland/default.nix index e919e97..c2f1362 100644 --- a/configs/nixos/modules/desktop/session/hyprland/default.nix +++ b/configs/nixos/modules/desktop/session/hyprland/default.nix @@ -80,26 +80,20 @@ settings = { config.general.layout = "dwindle"; - bind = lib.mapAttrsToList ( - _name: keybind: - let - focusOptions = lib.filterAttrs (_name: value: value != null) { - inherit (keybind.action) direction workspace; - }; - in - { - _args = [ - keybind.keys - (lib.generators.mkLuaInline ( - { - exec = "hl.dsp.exec_cmd(${lib.generators.toLua { } keybind.action.command})"; - focus = "hl.dsp.focus(${lib.generators.toLua { } focusOptions})"; - } - .${keybind.action.kind} - )) - ]; - } - ) (lib.attrByPath [ config.networking.hostName ] { } config.registry.keybind); + bind = lib.mapAttrsToList (_name: keybind: { + _args = [ + keybind.keys + (lib.generators.mkLuaInline ( + { + exec = "hl.dsp.exec_cmd(${lib.generators.toLua { } keybind.action.command})"; + focus = "hl.dsp.focus(${ + lib.generators.toLua { } { inherit (keybind.action) direction workspace; } + })"; + } + .${keybind.action.kind} + )) + ]; + }) (lib.attrByPath [ config.networking.hostName ] { } config.registry.keybind); }; }; };