From 8b1d9ff963456d30e12156f14461c1eb9a87d9d2 Mon Sep 17 00:00:00 2001 From: materus Date: Sun, 31 Mar 2024 21:11:40 +0200 Subject: [PATCH] home-profile: init wezterm --- .../profile/common/packages/fonts.nix | 6 ++-- configurations/profile/home/default.nix | 1 + .../profile/home/terminal/default.nix | 8 +++++ .../profile/home/terminal/wezterm.nix | 31 +++++++++++++++++++ 4 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 configurations/profile/home/terminal/default.nix create mode 100644 configurations/profile/home/terminal/wezterm.nix diff --git a/configurations/profile/common/packages/fonts.nix b/configurations/profile/common/packages/fonts.nix index fa599ed..f80c4c6 100644 --- a/configurations/profile/common/packages/fonts.nix +++ b/configurations/profile/common/packages/fonts.nix @@ -16,15 +16,15 @@ let pkgs.noto-fonts-cjk-serif pkgs.wqy_zenhei pkgs.corefonts - (pkgs.nerdfonts.override { fonts = [ "FiraCode" ]; }) + pkgs.hack-font + (pkgs.nerdfonts.override { fonts = [ "Hack" ]; }) ] ++ defaultFonts; moreFonts = [ pkgs.ubuntu_font_family pkgs.monocraft - pkgs.hack-font - (pkgs.nerdfonts.override { fonts = [ "DroidSansMono" "Meslo" "ProFont" ]; }) + (pkgs.nerdfonts.override { fonts = [ "DroidSansMono" "Meslo" "ProFont" "FiraCode"]; }) ]; in { diff --git a/configurations/profile/home/default.nix b/configurations/profile/home/default.nix index c89ca0d..1c533d2 100644 --- a/configurations/profile/home/default.nix +++ b/configurations/profile/home/default.nix @@ -11,6 +11,7 @@ in ./shell ./editor + ./terminal ]; options.materus.profile.enableDesktop = materusArg.pkgs.lib.mkBoolOpt false "Enable settings for desktop"; diff --git a/configurations/profile/home/terminal/default.nix b/configurations/profile/home/terminal/default.nix new file mode 100644 index 0000000..726eb33 --- /dev/null +++ b/configurations/profile/home/terminal/default.nix @@ -0,0 +1,8 @@ +{...}: +{ + + imports = [ + ./wezterm.nix + ]; + +} diff --git a/configurations/profile/home/terminal/wezterm.nix b/configurations/profile/home/terminal/wezterm.nix new file mode 100644 index 0000000..515eb7f --- /dev/null +++ b/configurations/profile/home/terminal/wezterm.nix @@ -0,0 +1,31 @@ +{ config, lib, materusArg, pkgs, ... }: +let + cfg = config.materus.profile.wezterm; + cfgText = '' + config.hide_tab_bar_if_only_one_tab = true; + config.enable_scroll_bar = true; + config.font = wezterm.font 'Hack Nerd Font'; + ''; +in +{ + options.materus.profile.wezterm.enable = materusArg.pkgs.lib.mkBoolOpt config.materus.profile.enableDesktop "Enable materus wezterm config"; + options.materus.profile.wezterm.enableHackFont = materusArg.pkgs.lib.mkBoolOpt true "Enable hack nerd font for wezterm"; + options.materus.profile.wezterm.config = lib.mkOption { + default = cfgText; + description = "Config for wezterm"; + type = lib.types.string; + }; + config = lib.mkIf cfg.enable { + programs.wezterm.enable = true; + programs.wezterm.colorSchemes = { }; + programs.wezterm.extraConfig = '' + local config = wezterm.config_builder(); + + ${cfgText} + + return config; + ''; + + home.packages = lib.mkIf cfg.enableHackFont [ (pkgs.nerdfonts.override { fonts = [ "Hack" ]; }) ]; + }; +}