fix: wezterm on darwin

This commit is contained in:
Ryan Yin
2023-11-30 11:01:53 +08:00
parent b977203d15
commit d9be6f9213
+27 -16
View File
@@ -1,7 +1,4 @@
{ {pkgs, ...}:
pkgs,
...
}:
########################################################### ###########################################################
# #
# Wezterm Configuration # Wezterm Configuration
@@ -13,17 +10,15 @@
# wezterm has catppuccin theme built-in, # wezterm has catppuccin theme built-in,
# it's not necessary to install it separately. # it's not necessary to install it separately.
programs.wezterm = { programs.wezterm =
{
enable = true; enable = true;
package = if pkgs.stdenv.isDarwin
then
pkgs.hello # install wezterm via homebrew on macOS to avoid compilation, dummy package here.
else
pkgs.wezterm;
extraConfig = extraConfig = let
let fontsize =
fontsize = if pkgs.stdenv.isDarwin then "14.0" else "13.0"; if pkgs.stdenv.isDarwin
then "14.0"
else "13.0";
in in
'' ''
-- Pull in the wezterm API -- Pull in the wezterm API
@@ -74,11 +69,27 @@
} }
config.font_size = ${fontsize} config.font_size = ${fontsize}
'' + (if pkgs.stdenv.isDarwin then '' ''
+ (
if pkgs.stdenv.isDarwin
then ''
-- Spawn a fish shell in login mod -- Spawn a fish shell in login mod
config.default_prog = { '/run/current-system/sw/bin/nu', '-l' } config.default_prog = { '/run/current-system/sw/bin/nu', '-l' }
'' else "") + '' ''
else ""
)
+ ''
return config return config
''; '';
}; }
// (
if pkgs.stdenv.isDarwin
then {
# install wezterm via homebrew on macOS to avoid compilation, dummy package here.
package = pkgs.hello;
enableBashIntegration = false;
enableZshIntegration = false;
}
else {}
);
} }