diff --git a/hosts/default/home.nix b/hosts/default/home.nix index 5662465..50654bd 100644 --- a/hosts/default/home.nix +++ b/hosts/default/home.nix @@ -106,57 +106,6 @@ "electron-25.9.0" ]; - programs.kitty = { - enable = true; - keybindings = { - # Create a new window splitting the space used by the existing one so that - # the two windows are placed one above the other - "f5" = "launch --location=hsplit"; - - # Create a new window splitting the space used by the existing one so that - # the two windows are placed side by side - "f6" = "launch --location=vsplit"; - - # Create a new window splitting the space used by the existing one so that - # the two windows aew placed side by side if the existing window is wide or - # one above the other if the existing window is tall - "f4" = "launch --location=split"; - - # Rotate the current split, changing its split axis from vertical to - # horizontal or vice versa - "f7" = "layout_action rotate"; - - # Move the active window in the indicated direction - "shift+up" = "move_window up"; - "shift+left" = "move_window left"; - "shift+right" = "move_window right"; - "shift+down" = "move_window down"; - - # Move the window to the indicated screen edge - "ctrl+shift+up" = "layout_action move_to_screen_edge top"; - "ctrl+shift+left" = "layout_action move_to_screen_edge left"; - "ctrl+shift+right" = "layout_action move_to_screen_edge right"; - "ctrl+shift+down" = "layout_action move_to_screen_edge bottom"; - - # Switch focus to the neighboring window in the indicated direction - "ctrl+left" = "neighboring_window left"; - "ctrl+right" = "neighboring_window right"; - "ctrl+up" = "neighboring_window up"; - "ctrl+down" = "neighboring_window down"; - }; - extraConfig = "include ~/.config/kitty/current-theme.conf - font_family JetBrainsMono Nerd Font - bold_font JetBrainsMono NF Bold - italic_font JetBrainsMono NF Italic - bold_italic_font JetBrainsMono NF Bold Italic - wayland_titlebar_color system - hide_window_decorations no - linux_display_server x11 - enabled_layouts splits - confirm_os_window_close 0 - "; - }; - programs.tmux = { enable = true; mouse = true; diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index e55208f..ee9aa6c 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -1,6 +1,7 @@ {lib, ...}: { imports = [ ./bash + ./kitty ./session-vars ./zsh ]; @@ -8,5 +9,6 @@ nixpkgs.config.allowUnfree = true; bash.enable = lib.mkDefault true; + kitty.enable = lib.mkDefault true; zsh.enable = lib.mkDefault true; } diff --git a/modules/home-manager/kitty/default.nix b/modules/home-manager/kitty/default.nix new file mode 100644 index 0000000..b33f225 --- /dev/null +++ b/modules/home-manager/kitty/default.nix @@ -0,0 +1,61 @@ +{ + config, + lib, + ... +}: { + options = { + kitty.enable = lib.mkEnableOption "enable kitty"; + }; + config = lib.mkIf config.kitty.enable { + programs.kitty = { + enable = true; + keybindings = { + # Create a new window splitting the space used by the existing one so that + # the two windows are placed one above the other + "f5" = "launch --location=hsplit"; + + # Create a new window splitting the space used by the existing one so that + # the two windows are placed side by side + "f6" = "launch --location=vsplit"; + + # Create a new window splitting the space used by the existing one so that + # the two windows aew placed side by side if the existing window is wide or + # one above the other if the existing window is tall + "f4" = "launch --location=split"; + + # Rotate the current split, changing its split axis from vertical to + # horizontal or vice versa + "f7" = "layout_action rotate"; + + # Move the active window in the indicated direction + "shift+up" = "move_window up"; + "shift+left" = "move_window left"; + "shift+right" = "move_window right"; + "shift+down" = "move_window down"; + + # Move the window to the indicated screen edge + "ctrl+shift+up" = "layout_action move_to_screen_edge top"; + "ctrl+shift+left" = "layout_action move_to_screen_edge left"; + "ctrl+shift+right" = "layout_action move_to_screen_edge right"; + "ctrl+shift+down" = "layout_action move_to_screen_edge bottom"; + + # Switch focus to the neighboring window in the indicated direction + "ctrl+left" = "neighboring_window left"; + "ctrl+right" = "neighboring_window right"; + "ctrl+up" = "neighboring_window up"; + "ctrl+down" = "neighboring_window down"; + }; + extraConfig = "include ~/.config/kitty/current-theme.conf + font_family JetBrainsMono Nerd Font + bold_font JetBrainsMono NF Bold + italic_font JetBrainsMono NF Italic + bold_italic_font JetBrainsMono NF Bold Italic + wayland_titlebar_color system + hide_window_decorations no + linux_display_server x11 + enabled_layouts splits + confirm_os_window_close 0 + "; + }; + }; +}