From b13166fc6bf07355f7077ca7be413ca57191b130 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Sat, 8 Apr 2023 11:11:43 -0400 Subject: [PATCH] Split up terminal.nix further --- home/default.nix | 3 +-- home/kitty.nix | 23 +++++++++++++++++++++++ home/terminal.nix | 41 +---------------------------------------- home/tmux.nix | 15 +++++++++++++++ home/zsh.nix | 2 ++ 5 files changed, 42 insertions(+), 42 deletions(-) create mode 100644 home/kitty.nix diff --git a/home/default.nix b/home/default.nix index 5ea3167..ddc240a 100644 --- a/home/default.nix +++ b/home/default.nix @@ -25,10 +25,9 @@ imports = [ self.homeModules.common ./zsh.nix + ./kitty.nix # ./emacs.nix ]; - - }; }; }; diff --git a/home/kitty.nix b/home/kitty.nix new file mode 100644 index 0000000..35deb8e --- /dev/null +++ b/home/kitty.nix @@ -0,0 +1,23 @@ +{ + # Better terminal, with good rendering. + programs.kitty = { + enable = true; + # Pick "name" from https://github.com/kovidgoyal/kitty-themes/blob/master/themes.json + theme = "Tokyo Night"; + font = { + name = "Monaco"; + size = 14; + }; + keybindings = { + "kitty_mod+e" = "kitten hints"; # https://sw.kovidgoyal.net/kitty/kittens/hints/ + }; + settings = { + # https://github.com/kovidgoyal/kitty/issues/371#issuecomment-1095268494 + # mouse_map = "left click ungrabbed no-op"; + # Ctrl+Shift+click to open URL. + confirm_os_window_close = "0"; + # https://github.com/kovidgoyal/kitty/issues/847 + macos_option_as_alt = "yes"; + }; + }; +} diff --git a/home/terminal.nix b/home/terminal.nix index e28230f..13410a0 100644 --- a/home/terminal.nix +++ b/home/terminal.nix @@ -8,19 +8,6 @@ ripgrep htop nix-output-monitor - - # Open tmux for current project. - (pkgs.writeShellApplication { - name = "pux"; - runtimeInputs = [ pkgs.tmux ]; - text = '' - PRJ="''$(zoxide query -i)" - echo "Launching tmux for ''$PRJ" - set -x - cd "''$PRJ" && \ - exec tmux -S "''$PRJ".tmux attach - ''; - }) ]; programs = { @@ -29,32 +16,6 @@ zoxide.enable = true; fzf.enable = true; jq.enable = true; - - # Better terminal, with good rendering. - kitty = { - enable = true; - # Pick "name" from https://github.com/kovidgoyal/kitty-themes/blob/master/themes.json - theme = "Tokyo Night"; - font = { - name = "Monaco"; - size = 14; - }; - keybindings = { - "kitty_mod+e" = "kitten hints"; # https://sw.kovidgoyal.net/kitty/kittens/hints/ - }; - settings = { - # https://github.com/kovidgoyal/kitty/issues/371#issuecomment-1095268494 - # mouse_map = "left click ungrabbed no-op"; - # Ctrl+Shift+click to open URL. - confirm_os_window_close = "0"; - # https://github.com/kovidgoyal/kitty/issues/847 - macos_option_as_alt = "yes"; - }; - }; - - nix-index = { - enable = true; - enableZshIntegration = true; - }; + nix-index.enable = true; }; } diff --git a/home/tmux.nix b/home/tmux.nix index 686bf0b..d0f8bcd 100644 --- a/home/tmux.nix +++ b/home/tmux.nix @@ -36,4 +36,19 @@ # FIXME: This causes tmate to hang. # extraConfig = config.xdg.configFile."tmux/tmux.conf".text; }; + + home.packages = [ + # Open tmux for current project. + (pkgs.writeShellApplication { + name = "pux"; + runtimeInputs = [ pkgs.tmux ]; + text = '' + PRJ="''$(zoxide query -i)" + echo "Launching tmux for ''$PRJ" + set -x + cd "''$PRJ" && \ + exec tmux -S "''$PRJ".tmux attach + ''; + }) + ]; } diff --git a/home/zsh.nix b/home/zsh.nix index 409444c..2f48958 100644 --- a/home/zsh.nix +++ b/home/zsh.nix @@ -14,4 +14,6 @@ # cf. https://developer.1password.com/docs/ssh/get-started#step-4-configure-your-ssh-or-git-client export SSH_AUTH_SOCK=~/Library/Group\ Containers/2BUA8C4S2C.com.1password/t/agent.sock ''; + + programs.nix-index.enableZshIntegration = true; }