11.stylix/modules/kitty/hm.nix
awwpotato 7ffb31da69
treewide: use mkTarget (batch 2) (#1362)
Link: https://github.com/nix-community/stylix/pull/1362

Reviewed-by: Flameopathic <64027365+Flameopathic@users.noreply.github.com>
Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
2025-05-23 19:23:39 +02:00

52 lines
1.1 KiB
Nix

{ mkTarget, lib, ... }:
mkTarget {
name = "kitty";
humanName = "Kitty";
extraOptions = {
variant256Colors = lib.mkOption {
description = ''
Whether to use the [256-color variant](https://github.com/kdrag0n/base16-kitty#256-color-variants)
rather than the default combination of colors.
'';
type = lib.types.bool;
default = false;
};
};
configElements = [
(
{ fonts }:
{
programs.kitty.font = {
inherit (fonts.monospace) package name;
size = fonts.sizes.terminal;
};
}
)
(
{ opacity }:
{
programs.kitty.settings.background_opacity = toString opacity.terminal;
}
)
(
{
cfg,
colors,
inputs,
}:
let
theme = colors {
templateRepo = inputs.tinted-kitty;
target = if cfg.variant256Colors then "base16-256-deprecated" else "base16";
};
in
{
programs.kitty.extraConfig = ''
include ${theme}
'';
}
)
];
}