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

39 lines
772 B
Nix
Raw Normal View History

2024-03-13 15:04:50 -07:00
{
2024-10-20 16:29:43 -07:00
config,
lib,
...
}: let
inherit (config.rose-pine) sources;
2024-10-20 16:29:43 -07:00
cfg = config.console.rose-pine;
enable = cfg.enable && config.console.enable;
palette = (lib.importJSON "${sources.rose-pine-palette}/palette.json").${cfg.flavor}.colors;
2024-10-20 16:29:43 -07:00
in {
options.console.rose-pine = lib.rp.mkRosePineOpt {name = "console";};
2024-03-13 15:04:50 -07:00
config.console.colors = lib.mkIf enable (
2024-10-20 16:29:43 -07:00
# Manually populate with colors from rose-pine/linux-tty
2024-03-13 15:04:50 -07:00
# Make sure to strip initial # from hex codes
map (color: (builtins.substring 1 6 palette.${color}.hex)) [
"base"
2024-10-20 16:29:43 -07:00
"love"
"foam"
"gold"
"pine"
"iris"
"rose"
"text"
2024-03-13 15:04:50 -07:00
2024-10-20 16:29:43 -07:00
"overlay"
"love"
"foam"
"gold"
"pine"
"iris"
"rose"
"text"
2024-03-13 15:04:50 -07:00
]
);
}