/ modules / common / zellij.nix
zellij.nix
 1  { config, lib, ... }:
 2  let
 3    inherit (lib) enabled;
 4  in
 5  {
 6    home-manager.sharedModules = [
 7      {
 8        programs.zellij = enabled {
 9          settings = {
10            theme = "base16";
11            pane_frames = false;
12            ui.pane_frames = {
13              rounded_corners = config.theme.cornerRadius > 0;
14              hide_session_name = true;
15            };
16            simplified_ui = true;
17            default_mode = "normal";
18            mouse_mode = true;
19            scroll_buffer_size = 10000;
20            copy_command = "pbcopy";
21            copy_clipboard = "system";
22            copy_on_select = true;
23            scrollback_editor = "hx";
24            default_layout = "default";
25            auto_layout = true;
26            session_serialization = false;
27            mirror_session = true;
28          };
29        };
30  
31        home.file.".config/zellij/layouts/default.kdl".source = ../../layouts/default.kdl;
32        home.file.".config/zellij/themes/base16.kdl".text = with config.theme; ''
33          themes {
34            base16 {
35              fg "#${base05}"
36              bg "#${base00}"
37              black "#${base00}"
38              red "#${base08}"
39              green "#${base0B}"
40              yellow "#${base0A}"
41              blue "#${base0D}"
42              magenta "#${base0E}"
43              cyan "#${base0C}"
44              white "#${base05}"
45              orange "#${base09}"
46            }
47          }
48        '';
49      }
50    ];
51  }