rose-pine-nix/modules/nixos/console.nix
2024-03-13 18:04:50 -04:00

38 lines
736 B
Nix

{ config
, lib
, sources
, ...
}:
let
cfg = config.console.catppuccin;
enable = cfg.enable && config.console.enable;
palette = (lib.importJSON "${sources.palette}/palette.json").${cfg.flavour}.colors;
in
{
options.console.catppuccin =
lib.ctp.mkCatppuccinOpt "console";
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"
]
);
}