Przeglądaj źródła

refactor: ghostty and tmux

Zander Hawke 10 miesięcy temu
rodzic
commit
9eba7ba61e

+ 1 - 0
devenv.nix

@@ -13,6 +13,7 @@
     '';
     hms.exec = ''
       ${lib.getExe pkgs.home-manager} switch --flake .#$(whoami)@$(hostname);
+      zen --ProfileManager
     '';
 
     nrb.exec = ''

+ 11 - 25
home/features/cli/tmux.nix

@@ -17,17 +17,10 @@
     terminal = "tmux-256color";
 
     plugins = with pkgs.tmuxPlugins; [
+      sensible
       tmux-select-pane-no-wrap
-      {
-        plugin = catppuccin;
-        extraConfig = ''
-          set -g @catppuccin_flavor 'frappe' # latte, frappe, macchiato or mocha
-          set -g @catppuccin_window_text " #W"
-          set -g @catppuccin_window_current_text " #W"
-        '';
-      }
-      vim-tmux-focus-events
       vim-tmux-navigator
+      yank
       {
         plugin = tmux-floax;
         extraConfig = ''
@@ -35,22 +28,15 @@
         '';
       }
       {
-        plugin = yank;
-        extraConfig = ''
-          bind-key -T copy-mode-vi v send-keys -X begin-selection
-          bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
-          bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
-        '';
-      }
-      {
-        plugin = resurrect;
-        extraConfig = "set -g @resurrect-strategy-nvim 'session'";
-      }
-      {
-        plugin = continuum;
+        plugin = kanagawa;
         extraConfig = ''
-          set -g @continuum-restore 'on'
-          set -g @continuum-save-interval '60' # minutes
+          set -g @kanagawa-theme 'dragon'
+          set -g @kanagawa-refresh-rate 60
+          set -g @kanagawa-show-left-icon window
+          set -g @kanagawa-show-battery true
+          set -g @kanagawa-show-powerline true
+          set -g @kanagawa-show-location false
+          set -g window-style 'fg=colour250'
         '';
       }
     ];
@@ -75,7 +61,7 @@
       set-option -sa terminal-features ',xterm-256color:RGB'
 
       # default layout
-      set-hook -g after-new-window 'split-window -v -p 20'
+      # set-hook -g after-new-window 'split-window -v -p 20'
     '';
   };
 }

+ 0 - 184
home/features/desktop/alacritty.nix

@@ -1,184 +0,0 @@
-{ pkgs, ... }: {
-  programs.alacritty = {
-    enable = true;
-
-    settings = {
-      env = {
-        LC_ALL = "en_US.UTF-8";
-        LC_CTYPE = "en_US.UTF-8";
-        TERM = "xterm-256color";
-      };
-
-      font = {
-        normal = {
-          family = "FiraCode Nerd Font";
-          style = "Regular";
-        };
-        bold = {
-          family = "FiraCode Nerd Font";
-          style = "Bold";
-        };
-        italic = {
-          family = "FiraCode Nerd Font";
-          style = "Italic";
-        };
-        bold_italic = {
-          family = "FiraCode Nerd Font";
-          style = "Bold Italic";
-        };
-        size = 11.0;
-      };
-
-      colors = {
-        primary = {
-          background = "#303446";
-          foreground = "#c6d0f5";
-          dim_foreground = "#838ba7";
-          bright_foreground = "#c6d0f5";
-        };
-
-        cursor = {
-          text = "#303446";
-          cursor = "#f2d5cf";
-        };
-
-        vi_mode_cursor = {
-          text = "#303446";
-          cursor = "#babbf1";
-        };
-
-        search.matches = {
-          foreground = "#303446";
-          background = "#a5adce";
-        };
-
-        search.focused_match = {
-          foreground = "#303446";
-          background = "#a6d189";
-        };
-
-        footer_bar = {
-          foreground = "#303446";
-          background = "#a5adce";
-        };
-
-        hints.start = {
-          foreground = "#303446";
-          background = "#e5c890";
-        };
-
-        hints.end = {
-          foreground = "#303446";
-          background = "#a5adce";
-        };
-
-        selection = {
-          text = "#303446";
-          background = "#f2d5cf";
-        };
-
-        normal = {
-          black = "#51576d";
-          red = "#e78284";
-          green = "#a6d189";
-          yellow = "#e5c890";
-          blue = "#8caaee";
-          magenta = "#f4b8e4";
-          cyan = "#81c8be";
-          white = "#b5bfe2";
-        };
-
-        bright = {
-          black = "#626880";
-          red = "#e78284";
-          green = "#a6d189";
-          yellow = "#e5c890";
-          blue = "#8caaee";
-          magenta = "#f4b8e4";
-          cyan = "#81c8be";
-          white = "#a5adce";
-        };
-
-        # indexed_colors = {
-        #   index = 16;
-        #   color = "#ef9f76";
-        # };
-        #
-        # indexed_colors = {
-        #   index = 17;
-        #   color = "#f2d5cf";
-        # };
-      };
-
-      bell = {
-        animation = "EaseOutExpo";
-        duration = 400;
-        color = "#ffffff";
-      };
-
-      window = {
-        padding = {
-          x = 12;
-          y = 12;
-        };
-        opacity = 0.8;
-      };
-
-      terminal.shell = {
-        program = "${pkgs.fish}/bin/fish";
-        args = [ "--login" ];
-      };
-
-      keyboard.bindings = [
-        {
-          key = "Space";
-          mods = "Shift";
-          mode = "~Search";
-          action = "ToggleViMode";
-        }
-
-        # TODO: figure out why I set these
-        # { key = "Up"; mods = "Alt"; chars = "\x1b[1;5A"; }
-        # { key = "Down"; mods = "Alt"; chars = "\x1b[1;5B"; }
-        # { key = "Left"; mods = "Alt"; chars = "\x1bb"; }
-        # { key = "Right"; mods = "Alt"; chars = "\x1bf"; }
-        # { key = "A"; mods = "Alt"; chars = "\x1ba"; }
-        # { key = "B"; mods = "Alt"; chars = "\x1bb"; }
-        # { key = "C"; mods = "Alt"; chars = "\x1bc"; }
-        # { key = "D"; mods = "Alt"; chars = "\x1bd"; }
-        # { key = "E"; mods = "Alt"; chars = "\x1be"; }
-        # { key = "F"; mods = "Alt"; chars = "\x1bf"; }
-        # { key = "G"; mods = "Alt"; chars = "\x1bg"; }
-        # { key = "H"; mods = "Alt"; chars = "\x1bh"; }
-        # { key = "I"; mods = "Alt"; chars = "\x1bi"; }
-        # { key = "J"; mods = "Alt"; chars = "\x1bj"; }
-        # { key = "K"; mods = "Alt"; chars = "\x1bk"; }
-        # { key = "L"; mods = "Alt"; chars = "\x1bl"; }
-        # { key = "M"; mods = "Alt"; chars = "\x1bm"; }
-        # { key = "N"; mods = "Alt"; chars = "\x1bn"; }
-        # { key = "O"; mods = "Alt"; chars = "\x1bo"; }
-        # { key = "P"; mods = "Alt"; chars = "\x1bp"; }
-        # { key = "Q"; mods = "Alt"; chars = "\x1bq"; }
-        # { key = "R"; mods = "Alt"; chars = "\x1br"; }
-        # { key = "S"; mods = "Alt"; chars = "\x1bs"; }
-        # { key = "T"; mods = "Alt"; chars = "\x1bt"; }
-        # { key = "U"; mods = "Alt"; chars = "\x1bu"; }
-        # { key = "V"; mods = "Alt"; chars = "\x1bv"; }
-        # { key = "W"; mods = "Alt"; chars = "\x1bw"; }
-        # { key = "X"; mods = "Alt"; chars = "\x1bx"; }
-        # { key = "Y"; mods = "Alt"; chars = "\x1by"; }
-        # { key = "Z"; mods = "Alt"; chars = "\x1bz"; }
-        # { key = "Key0"; mods = "Alt"; chars = "º"; }
-        # { key = "Key1"; mods = "Alt"; chars = "¡"; }
-        # { key = "Key2"; mods = "Alt"; chars = "€"; }
-        # { key = "Key3"; mods = "Alt"; chars = "#"; }
-        # { key = "Key4"; mods = "Alt"; chars = "¢"; }
-        # { key = "Key5"; mods = "Alt"; chars = "∞"; }
-        # { key = "Key6"; mods = "Alt"; chars = "§"; }
-        # { key = "Key7"; mods = "Alt"; chars = "¶"; }
-        # { key = "Key8"; mods = "Alt"; chars = "•"; }
-        # { key = "Key9"; mods = "Alt"; chars = "ª"; }
-      ];
-    };
-  };
-}

+ 0 - 1
home/features/desktop/default.nix

@@ -1,7 +1,6 @@
 {
   imports = [
     ./aerospace.nix
-    ./alacritty.nix
     ./fonts.nix
     ./ghostty.nix
     ./syncthing.nix

+ 19 - 62
home/features/desktop/ghostty.nix

@@ -4,96 +4,53 @@
 , ...
 }:
 let
-  ghosttyCatppuccinSrc = pkgs.fetchFromGitHub {
-    owner = "catppuccin";
-    repo = "ghostty";
-    rev = "9e38fc2";
-    sha256 = "sha256-RlgTeBkjEvZpkZbhIss3KxQcvt0goy4WU+w9d2XCOnw=";
+  kanagawaSrc = pkgs.fetchFromGitHub {
+    owner = "rebelot";
+    repo = "kanagawa.nvim";
+    rev = "master";
+    sha256 = "sha256-i54hTf4AEFTiJb+j5llC5+Xvepj43DiNJSq0vPZCIAg=";
   };
 in
 {
   xdg.configFile = {
-    "ghostty/themes/catppuccin-frappe.conf".text =
+    "ghostty/themes/kanagawa-dragon".text =
       lib.strings.fileContents
-        (ghosttyCatppuccinSrc + "/themes/catppuccin-frappe.conf");
+        (kanagawaSrc + "/extras/ghostty/kanagawa-dragon");
 
-    "ghostty/themes/catppuccin-latte.conf".text =
+    "ghostty/themes/kanagawa-lotus".text =
       lib.strings.fileContents
-        (ghosttyCatppuccinSrc + "/themes/catppuccin-latte.conf");
+        (kanagawaSrc + "/extras/ghostty/kanagawa-lotus");
 
-    "ghostty/themes/catppuccin-macchiato.conf".text =
+    "ghostty/themes/kanagawa-wave".text =
       lib.strings.fileContents
-        (ghosttyCatppuccinSrc + "/themes/catppuccin-macchiato.conf");
-
-    "ghostty/themes/catppuccin-mocha.conf".text =
-      lib.strings.fileContents
-        (ghosttyCatppuccinSrc + "/themes/catppuccin-mocha.conf");
+        (kanagawaSrc + "/extras/ghostty/kanagawa-wave");
   };
 
   programs.ghostty = {
     enable = true;
-    package = null;
+    # Ghostty is a terminal emulator for macOS, it is not available in Nixpkgs
+    # TODO: https://github.com/NixOS/nixpkgs/blob/76efb9f313b326ed24dfae33ff0496a6df370e5a/pkgs/by-name/gh/ghostty/package.nix#L192
+    package = null; # installed via brew cask
 
     installBatSyntax = false;
     installVimSyntax = false;
 
-    enableBashIntegration = true;
-    enableZshIntegration = true;
     enableFishIntegration = true;
 
-    themes = {
-      iceberg-dark = {
-        background = "161821";
-        foreground = "c6c8d1";
-
-        selection-background = "1e2132";
-        selection-foreground = "c6c8d1";
-
-        cursor-color = "#d2d4de";
-
-        palette = [
-          # black
-          "0=#161821"
-          "8=#6b7089"
-          # red
-          "1=#e27878"
-          "9=#e98989"
-          # green
-          "2=#b4be82"
-          "10=#c0ca8e"
-          # yellow
-          "3=#e2a478"
-          "11=#e9b189"
-          # blue
-          "4=#84a0c6"
-          "12=#91acd1"
-          # magenta
-          "5=#a093c7"
-          "13=#ada0d3"
-          # cyan
-          "6=#89b8c2"
-          "14=#95c4ce"
-          # white
-          "7=#c6c8d1"
-          "15=#d2d4de"
-        ];
-      };
-    };
-
     settings = {
-      command = "${pkgs.lib.meta.getExe config.programs.fish.package}";
+      command = "${lib.getExe config.programs.fish.package}";
 
       background-opacity = 0.9;
       font-family = "FiraCode Nerd Font";
-      font-size = 11.0;
+      font-size = 16.0;
 
       macos-titlebar-style = "hidden";
-      theme = "catppuccin-mocha";
+      theme = "kanagawa-dragon";
 
       window-padding-balance = true;
       window-padding-color = "extend";
-      window-padding-x = 5;
-      window-padding-y = 0;
+      window-padding-x = 10;
+      window-padding-y = "10,0";
       window-theme = "ghostty";
     };
   };

+ 3 - 2
packages/tmux-select-pane-no-wrap.nix

@@ -3,11 +3,12 @@
 ,
 }:
 tmuxPlugins.mkTmuxPlugin rec {
-  pluginName = "tmux-select-pane-no-wrap";
+  pluginName = "select-pane-no-wrap";
   version = "00add78";
+  rtpFilePath = "${pluginName}.tmux";
   src = fetchFromGitHub {
     owner = "dalejung";
-    repo = pluginName;
+    repo = "tmux-${pluginName}";
     rev = version;
     sha256 = "sha256-ot0cHvk1TXvHOw9z+7TLSiHT77jHwvV2PSHcNuhOorQ=";
   };