refactor(hyprland): split keybind definitions

This commit is contained in:
2026-10-11 12:28:04 -04:00
parent 14a6ea8ea6
commit 337ede3ec5

View File

@@ -7,7 +7,9 @@
{ {
options.modules.desktop.session.hyprland.enable = lib.mkEnableOption "the Hyprland compositor"; options.modules.desktop.session.hyprland.enable = lib.mkEnableOption "the Hyprland compositor";
config = lib.mkIf config.modules.desktop.session.hyprland.enable { config = lib.mkIf config.modules.desktop.session.hyprland.enable (
lib.mkMerge [
{
registry.keybind.${config.networking.hostName} = { registry.keybind.${config.networking.hostName} = {
hyprland-focus-left = { hyprland-focus-left = {
keys = "SUPER + H"; keys = "SUPER + H";
@@ -40,8 +42,10 @@
direction = "right"; direction = "right";
}; };
}; };
};
} }
// lib.listToAttrs ( {
registry.keybind.${config.networking.hostName} = lib.listToAttrs (
map (workspace: { map (workspace: {
name = "hyprland-workspace-${toString workspace}"; name = "hyprland-workspace-${toString workspace}";
value = { value = {
@@ -53,7 +57,8 @@
}; };
}) (lib.range 1 9) }) (lib.range 1 9)
); );
}
{
# This program integration owns the session, portals, and polkit, launched # This program integration owns the session, portals, and polkit, launched
# through the universal Wayland session manager. # through the universal Wayland session manager.
programs.hyprland = { programs.hyprland = {
@@ -96,5 +101,7 @@
}) (lib.attrByPath [ config.networking.hostName ] { } config.registry.keybind); }) (lib.attrByPath [ config.networking.hostName ] { } config.registry.keybind);
}; };
}; };
}; }
]
);
} }