2024-03-31 21:11:40 +02:00
|
|
|
{ config, lib, materusArg, pkgs, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.materus.profile.wezterm;
|
2024-03-31 23:07:50 +02:00
|
|
|
zshCfg = ''
|
|
|
|
source "${config.programs.wezterm.package}/etc/profile.d/wezterm.sh"
|
|
|
|
'';
|
2024-03-31 21:11:40 +02:00
|
|
|
in
|
|
|
|
{
|
2024-10-21 17:09:26 +02:00
|
|
|
options.materus.profile.wezterm.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable materus wezterm config";
|
2024-03-31 21:11:40 +02:00
|
|
|
options.materus.profile.wezterm.enableHackFont = materusArg.pkgs.lib.mkBoolOpt true "Enable hack nerd font for wezterm";
|
2024-03-31 23:07:50 +02:00
|
|
|
options.materus.profile.wezterm.enableWezcraft = materusArg.pkgs.lib.mkBoolOpt true "Enable alias to start wezcraft with monocraft font";
|
2024-03-31 22:28:57 +02:00
|
|
|
options.materus.profile.wezterm.extraConfig = lib.mkOption {
|
|
|
|
default = "";
|
2024-03-31 21:11:40 +02:00
|
|
|
description = "Config for wezterm";
|
2024-03-31 22:49:39 +02:00
|
|
|
type = lib.types.lines;
|
2024-03-31 21:11:40 +02:00
|
|
|
};
|
2024-03-31 23:07:50 +02:00
|
|
|
config = lib.mkIf cfg.enable
|
|
|
|
{
|
|
|
|
programs.wezterm.enable = true;
|
|
|
|
programs.wezterm.colorSchemes = { };
|
2024-04-01 21:57:25 +02:00
|
|
|
programs.wezterm.enableZshIntegration = false;
|
2024-03-31 23:07:50 +02:00
|
|
|
programs.wezterm.extraConfig = ''
|
2024-03-31 21:11:40 +02:00
|
|
|
|
2024-03-31 22:28:57 +02:00
|
|
|
package.path = package.path .. ";${materusArg.cfg.path}/extraFiles/config/wezterm/?.lua"
|
|
|
|
require("wezterm_config");
|
|
|
|
local config = materus_wezterm_config();
|
2024-03-31 23:07:50 +02:00
|
|
|
${lib.optionalString cfg.enableHackFont "config.font = wezterm.font 'Hack Nerd Font';"}
|
2024-03-31 22:28:57 +02:00
|
|
|
${cfg.extraConfig}
|
2024-03-31 21:11:40 +02:00
|
|
|
|
|
|
|
return config;
|
|
|
|
'';
|
|
|
|
|
2024-03-31 23:07:50 +02:00
|
|
|
home.packages = [
|
|
|
|
(lib.mkIf cfg.enableHackFont (pkgs.nerdfonts.override {
|
|
|
|
fonts = [ "Hack" ];
|
|
|
|
}))
|
|
|
|
(lib.mkIf cfg.enableWezcraft (pkgs.monocraft))
|
2024-03-31 23:15:38 +02:00
|
|
|
(lib.mkIf cfg.enableWezcraft (pkgs.writeShellScriptBin "wezcraft" ''
|
|
|
|
${lib.getExe config.programs.wezterm.package} --config font="wezterm.font 'Monocraft Nerd Font'" $@
|
|
|
|
''))
|
2024-03-31 23:07:50 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
materus.profile.zsh.endConfig = lib.optionalString cfg.enableWezcraft zshCfg;
|
|
|
|
};
|
2024-03-31 21:11:40 +02:00
|
|
|
}
|