From 4fa23f5a32434b76b288466c1174fd0f4a307bd5 Mon Sep 17 00:00:00 2001 From: winston Date: Wed, 8 Nov 2023 11:54:01 +0100 Subject: [PATCH] feat(wezterm): use nix to clone plugins --- home/apps/wezterm.nix | 30 ++++++++++++++++++------ home/apps/wezterm/{ => config}/keys.lua | 0 home/apps/wezterm/{ => config}/utils.lua | 0 home/apps/wezterm/wezterm.lua | 14 +++++------ 4 files changed, 30 insertions(+), 14 deletions(-) rename home/apps/wezterm/{ => config}/keys.lua (100%) rename home/apps/wezterm/{ => config}/utils.lua (100%) diff --git a/home/apps/wezterm.nix b/home/apps/wezterm.nix index 1abd5ab..989ed47 100644 --- a/home/apps/wezterm.nix +++ b/home/apps/wezterm.nix @@ -1,15 +1,31 @@ { config, flakePath, + pkgs, ... -}: { +}: let + mkSymlink = path: config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/wezterm/${path}"; +in { programs.wezterm.enable = true; - # disable the default config created by Home-Manager - xdg.configFile."wezterm/wezterm.lua".enable = false; - # and use my own config instead - xdg.configFile."wezterm" = { - source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/wezterm"; - recursive = true; + + xdg.configFile = { + "wezterm/wezterm.lua".source = mkSymlink "wezterm.lua"; + "wezterm/config" = { + source = mkSymlink "config"; + recursive = true; + }; + "wezterm/bar".source = pkgs.fetchFromGitHub { + owner = "nekowinston"; + repo = "wezterm-bar"; + sha256 = "sha256-3acxqJ9HMA5hASWq/sVL9QQjfEw5Xrh2fT9nFuGjzHM="; + rev = "e96b81460b3ad11a7461934dcb7889ce5079f97f"; + }; + "wezterm/catppuccin".source = pkgs.fetchFromGitHub { + owner = "catppuccin"; + repo = "wezterm"; + sha256 = "sha256-McSWoZaJeK+oqdK/0vjiRxZGuLBpEB10Zg4+7p5dIGY="; + rev = "b1a81bae74d66eaae16457f2d8f151b5bd4fe5da"; + }; }; programs.zsh.initExtra = '' diff --git a/home/apps/wezterm/keys.lua b/home/apps/wezterm/config/keys.lua similarity index 100% rename from home/apps/wezterm/keys.lua rename to home/apps/wezterm/config/keys.lua diff --git a/home/apps/wezterm/utils.lua b/home/apps/wezterm/config/utils.lua similarity index 100% rename from home/apps/wezterm/utils.lua rename to home/apps/wezterm/config/utils.lua diff --git a/home/apps/wezterm/wezterm.lua b/home/apps/wezterm/wezterm.lua index 842211b..d7d4eb4 100644 --- a/home/apps/wezterm/wezterm.lua +++ b/home/apps/wezterm/wezterm.lua @@ -1,11 +1,12 @@ local wezterm = require("wezterm") local c = wezterm.config_builder() -require("keys").apply(c) +require("config.keys").apply(c) c.font = wezterm.font_with_fallback({ "Cascadia Code", "Symbols Nerd Font", }) +c.front_end = "WebGpu" c.font_size = 13 c.harfbuzz_features = { "calt=1", "ss01=1" } c.command_palette_font_size = c.font_size * 1.1 @@ -13,6 +14,7 @@ c.window_frame = { font = wezterm.font("IBM Plex Sans"), font_size = c.font_size, } + c.window_decorations = "RESIZE" c.window_padding = { left = 0, right = 0, top = 20, bottom = 0 } c.adjust_window_size_when_changing_font_size = false @@ -20,11 +22,9 @@ c.audible_bell = "Disabled" c.default_cursor_style = "BlinkingBar" c.inactive_pane_hsb = { brightness = 0.90 } -wezterm.plugin - .require("https://github.com/catppuccin/wezterm") - .apply_to_config(c, { sync = true }) -wezterm.plugin - .require("https://github.com/nekowinston/wezterm-bar") - .apply_to_config(c) +require("bar.plugin").apply_to_config(c) +require("catppuccin.plugin").apply_to_config(c, { + sync = true, +}) return c