fork/home-manager

git clone https://git.julia.blue/fork/home-manager

NAHOwezterm: remove automatic config reload callf92a54fe

master
2.4 KiB88 linesraw
1{ ... }:
2
3{
4  programs.wezterm = {
5    enable = true;
6    extraConfig = ''
7      return {
8        font = wezterm.font("JetBrains Mono"),
9        font_size = 16.0,
10        color_scheme = "Tomorrow Night",
11        hide_tab_bar_if_only_one_tab = true,
12        default_prog = { "zsh", "--login", "-c", "tmux attach -t dev || tmux new -s dev" },
13        keys = {
14          {key="n", mods="SHIFT|CTRL", action="ToggleFullScreen"},
15        }
16      }
17    '';
18    colorSchemes.test = {
19      ansi = [
20        "#222222"
21        "#D14949"
22        "#48874F"
23        "#AFA75A"
24        "#599797"
25        "#8F6089"
26        "#5C9FA8"
27        "#8C8C8C"
28      ];
29      brights = [
30        "#444444"
31        "#FF6D6D"
32        "#89FF95"
33        "#FFF484"
34        "#97DDFF"
35        "#FDAAF2"
36        "#85F5DA"
37        "#E9E9E9"
38      ];
39      background = "#1B1B1B";
40      cursor_bg = "#BEAF8A";
41      cursor_border = "#BEAF8A";
42      cursor_fg = "#1B1B1B";
43      foreground = "#BEAF8A";
44      selection_bg = "#444444";
45      selection_fg = "#E9E9E9";
46    };
47  };
48
49  test.stubs.wezterm = { };
50
51  nmt.script = let
52    expectedConfig = builtins.toFile "wezterm.lua" ''
53      -- Generated by Home Manager.
54      -- See https://wezfurlong.org/wezterm/
55
56      local wezterm = require 'wezterm';
57
58      return {
59        font = wezterm.font("JetBrains Mono"),
60        font_size = 16.0,
61        color_scheme = "Tomorrow Night",
62        hide_tab_bar_if_only_one_tab = true,
63        default_prog = { "zsh", "--login", "-c", "tmux attach -t dev || tmux new -s dev" },
64        keys = {
65          {key="n", mods="SHIFT|CTRL", action="ToggleFullScreen"},
66        }
67      }
68
69    '';
70    expectedColorScheme = builtins.toFile "test.toml" ''
71      [colors]
72      ansi = ["#222222", "#D14949", "#48874F", "#AFA75A", "#599797", "#8F6089", "#5C9FA8", "#8C8C8C"]
73      background = "#1B1B1B"
74      brights = ["#444444", "#FF6D6D", "#89FF95", "#FFF484", "#97DDFF", "#FDAAF2", "#85F5DA", "#E9E9E9"]
75      cursor_bg = "#BEAF8A"
76      cursor_border = "#BEAF8A"
77      cursor_fg = "#1B1B1B"
78      foreground = "#BEAF8A"
79      selection_bg = "#444444"
80      selection_fg = "#E9E9E9"
81    '';
82  in ''
83    assertFileExists home-files/.config/wezterm/wezterm.lua
84    assertFileContent home-files/.config/wezterm/wezterm.lua ${expectedConfig}
85    assertFileExists home-files/.config/wezterm/colors/test.toml
86    assertFileContent home-files/.config/wezterm/colors/test.toml ${expectedColorScheme}
87  '';
88}