This uses the same color mapping as Alacritty [1], WezTerm [2], and Kitty [5], and is consistent with mkSchemeAttrs [3] and base16-shell [4]. [1]: /modules/alacritty/hm.nix [2]: /modules/wezterm/hm.nix [3]: https://github.com/SenchoPens/base16.nix/blob/main/DOCUMENTATION.md#mkschemeattrs [4]: https://github.com/chriskempson/base16-shell [5]: https://github.com/tinted-theming/tinted-kitty/blob/main/templates/base16.mustache Link: https://github.com/danth/stylix/pull/806 Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
58 lines
1.9 KiB
Nix
58 lines
1.9 KiB
Nix
# Documentation is available at:
|
|
# - https://ghostty.org/docs/config/reference
|
|
# - `man 5 ghostty`
|
|
{ config, lib, ... }:
|
|
{
|
|
options.stylix.targets.ghostty.enable =
|
|
config.lib.stylix.mkEnableTarget "Ghostty" true;
|
|
|
|
config =
|
|
lib.mkIf (config.stylix.enable && config.stylix.targets.ghostty.enable)
|
|
{
|
|
programs.ghostty = {
|
|
settings =
|
|
let
|
|
inherit (config.stylix) fonts opacity;
|
|
in
|
|
{
|
|
theme = "stylix";
|
|
font-family = [
|
|
fonts.monospace.name
|
|
fonts.emoji.name
|
|
];
|
|
font-size = fonts.sizes.terminal;
|
|
background-opacity = opacity.terminal;
|
|
};
|
|
themes.stylix =
|
|
let
|
|
inherit (config.lib.stylix) colors;
|
|
inherit (config.lib.stylix.colors) withHashtag;
|
|
in
|
|
{
|
|
palette = [
|
|
"0=${withHashtag.base00}"
|
|
"1=${withHashtag.base08}"
|
|
"2=${withHashtag.base0B}"
|
|
"3=${withHashtag.base0A}"
|
|
"4=${withHashtag.base0D}"
|
|
"5=${withHashtag.base0E}"
|
|
"6=${withHashtag.base0C}"
|
|
"7=${withHashtag.base05}"
|
|
"8=${withHashtag.base03}"
|
|
"9=${withHashtag.base08}"
|
|
"10=${withHashtag.base0B}"
|
|
"11=${withHashtag.base0A}"
|
|
"12=${withHashtag.base0D}"
|
|
"13=${withHashtag.base0E}"
|
|
"14=${withHashtag.base0C}"
|
|
"15=${withHashtag.base07}"
|
|
];
|
|
background = colors.base00;
|
|
foreground = colors.base05;
|
|
cursor-color = colors.base05;
|
|
selection-background = colors.base02;
|
|
selection-foreground = colors.base05;
|
|
};
|
|
};
|
|
};
|
|
}
|