From bff5b61d2f5b9ddce704d1e6fdbea35d4db01d59 Mon Sep 17 00:00:00 2001 From: alexion Date: Sun, 11 Oct 2026 14:52:08 -0400 Subject: [PATCH] refactor(hyprland): inline workspace key text --- .../desktop/session/hyprland/default.nix | 46 ++++++++----------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/configs/nixos/modules/desktop/session/hyprland/default.nix b/configs/nixos/modules/desktop/session/hyprland/default.nix index 16679da..b322f9d 100644 --- a/configs/nixos/modules/desktop/session/hyprland/default.nix +++ b/configs/nixos/modules/desktop/session/hyprland/default.nix @@ -11,34 +11,28 @@ registry.keybind.${config.networking.hostName} = lib.mkMerge [ # Generate numeric workspace keybinds. (lib.listToAttrs ( - lib.concatMap ( - workspace: - let - workspaceText = toString workspace; - in - [ - { - name = "hyprland-workspace-${workspaceText}"; - value = { - keys = "SUPER + ${workspaceText}"; - action = { - kind = "focus"; - inherit workspace; - }; + lib.concatMap (workspace: [ + { + name = "hyprland-workspace-${toString workspace}"; + value = { + keys = "SUPER + ${toString workspace}"; + action = { + kind = "focus"; + inherit workspace; }; - } - { - name = "hyprland-move-to-workspace-${workspaceText}"; - value = { - keys = "SUPER + SHIFT + ${workspaceText}"; - action = { - kind = "move-window"; - inherit workspace; - }; + }; + } + { + name = "hyprland-move-to-workspace-${toString workspace}"; + value = { + keys = "SUPER + SHIFT + ${toString workspace}"; + action = { + kind = "move-window"; + inherit workspace; }; - } - ] - ) (lib.range 1 9) + }; + } + ]) (lib.range 1 9) )) # Generate directional keybinds.