58 lines
1.7 KiB
Nix
58 lines
1.7 KiB
Nix
# Defines the global color theme option.
|
|
|
|
{ lib, ... }:
|
|
|
|
with lib; with types;
|
|
|
|
# Define the type in a let binding to prevent too much rightward
|
|
# drift in the option configuration.
|
|
let themeType =
|
|
|
|
let # Named colors are colors like "red" or "black".
|
|
named = submodule {
|
|
options = {
|
|
normal = mkOption { type = str; };
|
|
bright = mkOption { type = str; };
|
|
pastel = mkOption { type = str; };
|
|
};
|
|
};
|
|
|
|
# Special colors are more abstract, for example
|
|
# "foreground".
|
|
special = submodule {
|
|
options = {
|
|
primary = mkOption { type = str; };
|
|
normal = mkOption { type = str; };
|
|
slight = mkOption { type = str; };
|
|
};
|
|
};
|
|
|
|
in submodule {
|
|
options = {
|
|
foreground = mkOption { type = special; };
|
|
background = mkOption { type = special; };
|
|
grayscales = mkOption { type = listOf str; };
|
|
red = mkOption { type = named; };
|
|
green = mkOption { type = named; };
|
|
blue = mkOption { type = named; };
|
|
yellow = mkOption { type = named; };
|
|
purple = mkOption { type = named; };
|
|
cyan = mkOption { type = named; };
|
|
pink = mkOption { type = named; };
|
|
orange = mkOption { type = named; };
|
|
misc = mkOption { type = attrsOf str; };
|
|
hex = mkOption { type = themeType; };
|
|
};
|
|
};
|
|
|
|
in {
|
|
|
|
options.custom.gui.theme = mkOption {
|
|
type = themeType;
|
|
description = ''
|
|
Color theme used across the installation for various
|
|
GUI elements and terminal colors.
|
|
'';
|
|
};
|
|
|
|
}
|