rose-pine-nix/modules/nixos/console.nix
punkfairie 190737eca1
fix(palette): Move JSON palette to it's own repo
Nix was complaining that paths weren't absolute so I just made the JSON
file its own repo so I can import it with npins.
2024-10-20 17:53:31 -07:00

38 lines
772 B
Nix

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