66 lines
1.7 KiB
Nix
66 lines
1.7 KiB
Nix
|
{ config, lib, pkgs, ... }:
|
||
|
|
||
|
with lib;
|
||
|
|
||
|
let
|
||
|
|
||
|
cfg = config.programs.wezterm;
|
||
|
|
||
|
in {
|
||
|
options.programs.wezterm = {
|
||
|
enable = mkEnableOption "wezterm";
|
||
|
|
||
|
package = mkOption {
|
||
|
type = types.package;
|
||
|
default = pkgs.wezterm;
|
||
|
defaultText = literalExpression "pkgs.wezterm";
|
||
|
description = "The Wezterm package to install.";
|
||
|
};
|
||
|
|
||
|
extraConfig = mkOption {
|
||
|
type = types.lines;
|
||
|
default = ''
|
||
|
return {}
|
||
|
'';
|
||
|
example = literalExpression ''
|
||
|
-- Your lua code / config here
|
||
|
local mylib = require 'mylib';
|
||
|
return {
|
||
|
usemylib = mylib.do_fun();
|
||
|
font = wezterm.font("JetBrains Mono"),
|
||
|
font_size = 16.0,
|
||
|
color_scheme = "Tomorrow Night",
|
||
|
hide_tab_bar_if_only_one_tab = true,
|
||
|
default_prog = { "zsh", "--login", "-c", "tmux attach -t dev || tmux new -s dev" },
|
||
|
keys = {
|
||
|
{key="n", mods="SHIFT|CTRL", action="ToggleFullScreen"},
|
||
|
}
|
||
|
}
|
||
|
'';
|
||
|
description = ''
|
||
|
Extra configuration written to
|
||
|
<filename>$XDG_CONFIG_HOME/wezterm/wezterm.lua</filename>. See
|
||
|
<link xlink:href="https://wezfurlong.org/wezterm/config/files.html"/>
|
||
|
how to configure.
|
||
|
'';
|
||
|
};
|
||
|
};
|
||
|
|
||
|
config = mkIf cfg.enable {
|
||
|
home.packages = [ cfg.package ];
|
||
|
|
||
|
xdg.configFile."wezterm/wezterm.lua" = {
|
||
|
text = ''
|
||
|
-- Generated by Home Manager.
|
||
|
-- See https://wezfurlong.org/wezterm/
|
||
|
|
||
|
-- Add config folder to watchlist for config reloads.
|
||
|
local wezterm = require 'wezterm';
|
||
|
wezterm.add_to_config_reload_watch_list(wezterm.config_dir)
|
||
|
|
||
|
${cfg.extraConfig}
|
||
|
'';
|
||
|
};
|
||
|
};
|
||
|
}
|