feat(nix): migrate WezTerm

This commit is contained in:
Stefan Imhoff
2024-07-18 17:44:43 +02:00
parent 412f4dea86
commit 4606d1cb9c
7 changed files with 44 additions and 4 deletions

View File

@@ -16,7 +16,6 @@
~/.tmux-cht-command: tmux/tmux-cht-command
~/.tmux-cht-languages: tmux/tmux-cht-languages
~/.tmux.conf: tmux/tmux.conf
~/.wezterm.lua: wezterm/wezterm.lua
~/.zsh.d: zsh/zsh.d
~/.zshrc: zsh/zshrc

View File

@@ -12,6 +12,7 @@
casks = [
"hammerspoon"
"raycast"
"wezterm"
"zed"
];
masApps = { };

View File

@@ -27,6 +27,7 @@ in
./ruby
./sesh
./skhd
./wezterm
./wget
./yabai
./yazi
@@ -36,6 +37,37 @@ in
config = {
home.stateVersion = "23.05";
home.activation = {
# Install terminfo for wezterm
installWeztermProfile = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
tempfile=$(mktemp) \
&& ${pkgs.curl}/bin/curl -o $tempfile https://raw.githubusercontent.com/wez/wezterm/main/termwiz/data/wezterm.terminfo \
&& tic -x -o ~/.terminfo $tempfile \
&& rm $tempfile
'';
# Install custom icon for WezTerm
setupWezTermCustomIcon = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
icon_path="$HOME/.config/wezterm/terminal.icns"
app_path="/Applications/WezTerm.app"
$DRY_RUN_CMD mkdir -p "$(dirname "$icon_path")"
$DRY_RUN_CMD cp -f ${./wezterm/wezterm.icns} "$icon_path"
if [ -d "$app_path" ]; then
$DRY_RUN_CMD cp "$icon_path" "$app_path"/Contents/Resources/terminal.icns
# Touch the app to refresh Finder
$DRY_RUN_CMD touch "$app_path"
$DRY_RUN_CMD ${pkgs.darwin.xattr}/bin/xattr -rc "$app_path"
$VERBOSE_ECHO "Applied custom icon to WezTerm.app"
$DRY_RUN_CMD touch "$app_path"
else
$VERBOSE_ECHO "WezTerm.app not found in /Applications. Custom icon not applied."
fi
'';
};
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
@@ -51,6 +83,7 @@ in
comma # Comma runs software without installing it
nixd # Nix language server
nixpkgs-fmt # Nix code formatter
darwin.xattr # Display and manipulate extended attributes
];
};
}

View File

@@ -0,0 +1,10 @@
{ pkgs, ... }:
{
programs.wezterm = {
enable = true;
extraConfig = builtins.readFile ./wezterm.lua;
};
home.packages = [ pkgs.wezterm ];
}

Binary file not shown.

View File

@@ -7,9 +7,6 @@ sudo -v
echo "Installing Xcode Developer Tools"
xcode-select --install
# Download wezterm.terminfo
curl https://raw.githubusercontent.com/wez/wezterm/master/termwiz/data/wezterm.terminfo | tic -x -
# TMUX Plugin Manager
echo "Installing TMUX Plugin Manager"
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm