Nixfiles/gui/terminal/kitty.nix

65 lines
1.7 KiB
Nix
Raw Normal View History

2022-05-01 10:32:31 +02:00
{
config,
lib,
pkgs,
...
}:
2022-04-10 10:57:49 +02:00
with lib;
with builtins;
let
2022-04-10 10:57:49 +02:00
cfg = config.terminal;
cCfg = cfg.colors;
in
{
2022-04-10 10:57:49 +02:00
config = mkIf (cfg.enable && cfg.kind == "kitty") {
terminal.command = mkDefault "${pkgs.kitty}/bin/kitty";
2022-04-10 10:57:49 +02:00
programs.kitty = {
enable = true;
font = {
name = cfg.font.family;
inherit (cfg.font) size;
2022-04-10 10:57:49 +02:00
};
settings =
let
colorCfg = value: mkIf (value != null) "#${value}";
colorCfgNormal = color: colorCfg color.normal;
colorCfgBright = color: if color.bright != null then "#${color.bright}" else colorCfgNormal color;
in
{
confirm_os_window_close = 0;
2022-06-04 20:54:49 +02:00
background = colorCfg cCfg.background;
foreground = colorCfg cCfg.foreground;
2022-04-10 10:57:49 +02:00
color0 = colorCfgNormal cCfg.black;
color8 = colorCfgBright cCfg.black;
2022-04-10 10:57:49 +02:00
color1 = colorCfgNormal cCfg.red;
color9 = colorCfgBright cCfg.red;
2022-04-10 10:57:49 +02:00
color2 = colorCfgNormal cCfg.green;
color10 = colorCfgBright cCfg.green;
2022-04-10 10:57:49 +02:00
color3 = colorCfgNormal cCfg.yellow;
color11 = colorCfgBright cCfg.yellow;
2022-04-10 10:57:49 +02:00
color4 = colorCfgNormal cCfg.blue;
color12 = colorCfgBright cCfg.blue;
2022-04-10 10:57:49 +02:00
color5 = colorCfgNormal cCfg.magenta;
color13 = colorCfgBright cCfg.magenta;
2022-04-10 10:57:49 +02:00
color6 = colorCfgNormal cCfg.cyan;
color14 = colorCfgBright cCfg.cyan;
2022-04-10 10:57:49 +02:00
color7 = colorCfgNormal cCfg.white;
color15 = colorCfgBright cCfg.white;
2022-04-10 10:57:49 +02:00
selection_foreground = colorCfg cCfg.selectionForeground;
};
2022-04-10 10:57:49 +02:00
};
wayland.windowManager.sway.config.terminal = "${config.terminal.command}";
xsession.windowManager.i3.config.terminal = "${config.terminal.command}";
2022-04-10 10:57:49 +02:00
};
}