rose-pine-nix/modules/nixos/console.nix

35 lines
770 B
Nix
Raw Normal View History

2024-05-21 14:53:46 -07:00
{ config, lib, ... }:
2024-03-13 15:04:50 -07:00
let
inherit (config.catppuccin) sources;
2024-03-13 15:04:50 -07:00
cfg = config.console.catppuccin;
enable = cfg.enable && config.console.enable;
palette = (lib.importJSON "${sources.palette}/palette.json").${cfg.flavor}.colors;
2024-03-13 15:04:50 -07:00
in
{
options.console.catppuccin = lib.ctp.mkCatppuccinOpt { name = "console"; };
2024-03-13 15:04:50 -07:00
config.console.colors = lib.mkIf enable (
# Manually populate with colors from catppuccin/tty
# Make sure to strip initial # from hex codes
map (color: (builtins.substring 1 6 palette.${color}.hex)) [
"base"
"red"
"green"
"yellow"
"blue"
"pink"
"teal"
"subtext1"
"surface2"
"red"
"green"
"yellow"
"blue"
"pink"
"teal"
"subtext0"
]
);
}