From d93557d7bf11486666985844f945fa4a1ee2891f Mon Sep 17 00:00:00 2001 From: Timo Bingmann Date: Sun, 21 Sep 2025 16:03:27 -0700 Subject: [PATCH] macos: add yabai window manager --- flake.nix | 1 + system/macos/yabai.nix | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 system/macos/yabai.nix diff --git a/flake.nix b/flake.nix index 19426e1..b84e632 100644 --- a/flake.nix +++ b/flake.nix @@ -31,6 +31,7 @@ ./system/macos/fonts.nix ./system/macos/nix.nix ./system/macos/system.nix + ./system/macos/yabai.nix ]; }; diff --git a/system/macos/yabai.nix b/system/macos/yabai.nix new file mode 100644 index 0000000..345ab7c --- /dev/null +++ b/system/macos/yabai.nix @@ -0,0 +1,33 @@ +{ ... }: +{ + # Enable the Yabai Window Manager + services.yabai = { + enable = true; + + config = { + # default layout (can be bsp, stack or float) + layout = "bsp"; + + # New window spawns to the right if vertical split, or bottom if horizontal split + "window_placement" = "second_child"; + + # padding set to 4px + "top_padding" = "4"; + "bottom_padding" = "4"; + "left_padding" = "4"; + "right_padding" = "4"; + "window_gap" = "4"; + + # center mouse on window with focus + "focus_follows_mouse" = "autofocus"; + "mouse_follows_focus" = "off"; + + # modifier for clicking and dragging with mouse + "mouse_modifier" = "cmd"; + # set modifier + left-click drag to move window + "mouse_action1" = "move"; + # set modifier + right-click drag to resize window + "mouse_action2" = "resize"; + }; + }; +}