From caca36afaf27926e4cc419d66b009f867508ef6a Mon Sep 17 00:00:00 2001 From: Uttarayan Date: Wed, 14 Feb 2024 20:01:31 +0530 Subject: [PATCH] [feat] Add wezterm.nix --- config/nix/fzf.nix | 8 +++++ config/nix/home.nix | 67 ++++-------------------------------------- config/nix/tmux.nix | 40 +++++++++++++++++++++---- config/nix/wezterm.nix | 63 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 110 insertions(+), 68 deletions(-) create mode 100644 config/nix/fzf.nix create mode 100644 config/nix/wezterm.nix diff --git a/config/nix/fzf.nix b/config/nix/fzf.nix new file mode 100644 index 00000000..dafc14d6 --- /dev/null +++ b/config/nix/fzf.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: { + programs.fzf = { + enable = true; + package = pkgs.fzf; + enableFishIntegration = true; + enableShellIntegration = true; + }; +} diff --git a/config/nix/home.nix b/config/nix/home.nix index f2e691f5..931be0fe 100644 --- a/config/nix/home.nix +++ b/config/nix/home.nix @@ -11,6 +11,7 @@ imports = [ # Include the results of the hardware scan. ./tmux.nix + ./wezterm.nix ]; programs = { @@ -56,77 +57,19 @@ nushell = { enable = true; package = pkgs.nushellFull; + shellAliases = { + "cd" = "z"; + }; }; keychain = { enable = true; + keys = ["id_ed25519" "hetzner_rsa"]; enableFishIntegration = true; enableNushellIntegration = true; }; - wezterm = { - enable = true; - extraConfig = '' - local wezterm = require 'wezterm'; - return { - -- -- font = wezterm.font("Hasklug Nerd Font Mono", { weight = "Regular", stretch = "Normal", style = "Normal" }), - -- font = wezterm.font_with_fallback({ - -- "Hasklig", - -- "Symbols Nerd Font Mono" - -- }), - - font_size = 16, - colors = { - -- The default text color - foreground = "#f8f8f2", - -- The default background color - -- background = "#282a36", - -- Overrides the cell background color when the current cell is occupied by the - -- cursor and the cursor style is set to Block - cursor_bg = "#f8f8f2", - -- Overrides the text color when the current cell is occupied by the cursor - cursor_fg = "#000", - -- Specifies the border color of the cursor when the cursor style is set to Block, - -- or the color of the vertical or horizontal bar when the cursor style is set to - -- Bar or Underline. - cursor_border = "#52ad70", - -- the foreground color of selected text - selection_fg = "#ffffff", - -- the background color of selected text - selection_bg = "#ffffff", - -- The color of the scrollbar "thumb"; the portion that represents the current viewport - scrollbar_thumb = "#222222", - -- The color of the split lines between panes - split = "#444444", - ansi = { "#21222c", "#ff5555", "#50fa7b", "#f1fa8c", "#bd93f9", "#ff79c6", "#8be9fd", "#f8f8f2" }, - brights = { "#6272a4", "#ff6e6e", "#69ff94", "#ffffa5", "#d6acff", "#ff92df", "#a4ffff", "#ffffff" }, - -- Arbitrary colors of the palette in the range from 16 to 255 - indexed = { [136] = "#af8700" }, - -- Since: nightly builds only - -- When the IME, a dead key or a leader key are being processed and are effectively - -- holding input pending the result of input composition, change the cursor - -- to this color to give a visual cue about the compose state. - compose_cursor = "orange", - }, - initial_cols = 120, - hide_tab_bar_if_only_one_tab = true, - window_background_opacity = 0.8, - cursor_blink_rate = 8, - default_cursor_style = "BlinkingBlock", - default_prog = { "${pkgs.fish.outPath}/bin/fish", "-l" }, - window_padding = { - left = 2, - right = 0, - top = 2, - bottom = 0, - }, - window_decorations = "RESIZE", - use_ime = false, - } - ''; - }; - }; home.packages = [ diff --git a/config/nix/tmux.nix b/config/nix/tmux.nix index 781559fc..b54a42a3 100644 --- a/config/nix/tmux.nix +++ b/config/nix/tmux.nix @@ -3,30 +3,58 @@ let tmux-super-fingers = pkgs.tmuxPlugins.mkTmuxPlugin { pluginName = "tmux-super-fingers"; - version = "unstable-2023-01-06"; + version = "v1-2024-02-14"; src = pkgs.fetchFromGitHub { owner = "artemave"; repo = "tmux_super_fingers"; - rev = "2c12044984124e74e21a5a87d00f844083e4bdf7"; - sha256 = "sha256-cPZCV8xk9QpU49/7H8iGhQYK6JwWjviL29eWabuqruc="; + rev = "518044ef78efa1cf3c64f2e693fef569ae570ddd"; + sha256 = "sha256-iKfx9Ytk2vSuINvQTB6Kww8Vv7i51cFEnEBHLje+IJw="; }; }; in { programs.tmux = { enable = true; - shell = "${pkgs.fish}/bin/fish"; + shell = "${pkgs.nushellFull}/bin/nu"; terminal = "tmux-256color"; + prefix = "C-q"; historyLimit = 100000; plugins = with pkgs; [ + tmuxPlugins.better-mouse-mode { plugin = tmux-super-fingers; - extraConfig = "set -g @super-fingers-key f"; + extraConfig = "set -g @super-fingers-key o"; + } + { + plugin = tmuxPlugins.catppuccin; + extraConfig = '' + set -g @catppuccin_flavour 'mocha' + set -g @catppuccin_window_tabs_enabled on + set -g @catppuccin_status_modules_right "" + set -g @catppuccin_status_modules_right "battery application session date_time" + ''; + } + { + plugin = tmuxPlugins.battery; + extraConfig = '' + set -g @catppuccin_status_modules_right "application session user host date_time" + ''; } - tmuxPlugins.better-mouse-mode ]; extraConfig = '' + set -gw mode-keys vi + set -g status-keys vi + bind h select-pane -L + bind j select-pane -D + bind k select-pane -U + bind l select-pane -R + bind h set status + set -g allow-passthrough on + set -ga update-environment TERM + set -ga update-environment TERM_PROGRAM + if-shell 'uname | grep -q "Darwin"' { set -s copy-command "pbcopy" } + if-shell 'uname | grep -q "Linux"' { set -s copy-command "wl-copy" } ''; }; } diff --git a/config/nix/wezterm.nix b/config/nix/wezterm.nix new file mode 100644 index 00000000..6e67f45e --- /dev/null +++ b/config/nix/wezterm.nix @@ -0,0 +1,63 @@ +{pkgs, ...}: { + programs.wezterm = { + enable = true; + extraConfig = '' + local wezterm = require 'wezterm'; + return { + -- -- font = wezterm.font("Hasklug Nerd Font Mono", { weight = "Regular", stretch = "Normal", style = "Normal" }), + -- font = wezterm.font_with_fallback({ + -- "Hasklig", + -- "Symbols Nerd Font Mono" + -- }), + + font_size = 16, + colors = { + -- The default text color + foreground = "#f8f8f2", + -- The default background color + -- background = "#282a36", + -- Overrides the cell background color when the current cell is occupied by the + -- cursor and the cursor style is set to Block + cursor_bg = "#f8f8f2", + -- Overrides the text color when the current cell is occupied by the cursor + cursor_fg = "#000", + -- Specifies the border color of the cursor when the cursor style is set to Block, + -- or the color of the vertical or horizontal bar when the cursor style is set to + -- Bar or Underline. + cursor_border = "#52ad70", + -- the foreground color of selected text + selection_fg = "#ffffff", + -- the background color of selected text + selection_bg = "#ffffff", + -- The color of the scrollbar "thumb"; the portion that represents the current viewport + scrollbar_thumb = "#222222", + -- The color of the split lines between panes + split = "#444444", + ansi = { "#21222c", "#ff5555", "#50fa7b", "#f1fa8c", "#bd93f9", "#ff79c6", "#8be9fd", "#f8f8f2" }, + brights = { "#6272a4", "#ff6e6e", "#69ff94", "#ffffa5", "#d6acff", "#ff92df", "#a4ffff", "#ffffff" }, + -- Arbitrary colors of the palette in the range from 16 to 255 + indexed = { [136] = "#af8700" }, + -- Since: nightly builds only + -- When the IME, a dead key or a leader key are being processed and are effectively + -- holding input pending the result of input composition, change the cursor + -- to this color to give a visual cue about the compose state. + compose_cursor = "orange", + }, + initial_cols = 120, + hide_tab_bar_if_only_one_tab = true, + window_background_opacity = 0.8, + cursor_blink_rate = 8, + default_cursor_style = "BlinkingBlock", + default_prog = { "${pkgs.fish.outPath}/bin/fish", "-l" }, + window_padding = { + left = 2, + right = 0, + top = 2, + bottom = 0, + }, + window_decorations = "RESIZE", + use_ime = false, + } + ''; + }; +}