From 2d417b21445635c8e7194439238b3b58038247d1 Mon Sep 17 00:00:00 2001 From: alexion Date: Sun, 11 Oct 2026 14:47:50 -0400 Subject: [PATCH] refactor(hyprland): combine directional keybind loop --- .../desktop/session/hyprland/default.nix | 46 +++++++++---------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/configs/nixos/modules/desktop/session/hyprland/default.nix b/configs/nixos/modules/desktop/session/hyprland/default.nix index f612930..da16e5a 100644 --- a/configs/nixos/modules/desktop/session/hyprland/default.nix +++ b/configs/nixos/modules/desktop/session/hyprland/default.nix @@ -62,34 +62,30 @@ in )) # Generate directional keybinds. (lib.listToAttrs ( - map ( + lib.concatMap ( { direction, key }: - { - name = "hyprland-focus-${direction}"; - value = { - keys = "SUPER + ${key}"; - action = { - kind = "focus"; - inherit direction; + [ + { + name = "hyprland-focus-${direction}"; + value = { + keys = "SUPER + ${key}"; + action = { + kind = "focus"; + inherit direction; + }; }; - }; - } - ) directions - )) - # Generate directional window movement keybinds. - (lib.listToAttrs ( - map ( - { direction, key }: - { - name = "hyprland-move-${direction}"; - value = { - keys = "SUPER + SHIFT + ${key}"; - action = { - kind = "move-window"; - inherit direction; + } + { + name = "hyprland-move-${direction}"; + value = { + keys = "SUPER + SHIFT + ${key}"; + action = { + kind = "move-window"; + inherit direction; + }; }; - }; - } + } + ] ) directions )) ];