1
0
mirror of https://github.com/kmein/niveum synced 2026-03-18 02:51:08 +01:00

modularize colorscheming and more

This commit is contained in:
Kierán Meinhardt
2019-04-19 15:02:05 +02:00
parent a763c63de4
commit 7d6dbc2809
37 changed files with 483 additions and 496 deletions

View File

@@ -1,39 +1,95 @@
{ config, lib, pkgs, ... }:
with lib;
with import <dot/theme.nix>;
let
stringOption = mkOption { type = types.string; };
themeOption = mkOption {
type = types.submodule {
options = {
name = mkOption { type = types.string; };
package = mkOption { type = types.package; };
};
colourScheme = config.niveum.colours;
my-types.hexColour = types.strMatching "#[0-9A-Fa-f]{6}";
my-types.colourPair = types.submodule {
options = {
dark = mkOption { type = my-types.hexColour; };
bright = mkOption { type = my-types.hexColour; };
};
};
my-types.theme = types.submodule {
options = {
name = mkOption { type = types.str; };
package = mkOption { type = types.package; };
};
};
my-types.font = types.submodule {
options = {
name = mkOption { type = types.str; };
size = mkOption { type = types.ints.positive; };
};
};
my-types.colourTheme = types.submodule {
options = {
black = mkOption { type = my-types.colourPair; };
red = mkOption { type = my-types.colourPair; };
green = mkOption { type = my-types.colourPair; };
yellow = mkOption { type = my-types.colourPair; };
blue = mkOption { type = my-types.colourPair; };
magenta = mkOption { type = my-types.colourPair; };
cyan = mkOption { type = my-types.colourPair; };
white = mkOption { type = my-types.colourPair; };
background = mkOption { type = my-types.hexColour; };
foreground = mkOption { type = my-types.hexColour; };
cursor = mkOption { type = my-types.hexColour; };
};
};
in {
options.niveum = {
applications = {
terminal = stringOption;
browser = stringOption;
fileManager = stringOption;
terminal = mkOption { type = types.str; };
browser = mkOption { type = types.str; };
fileManager = mkOption { type = types.str; };
};
colours = mkOption { type = my-types.colourTheme; };
colourPalette = mkOption {
type = types.listOf my-types.hexColour;
default = with config.niveum.colours; [
black.dark
red.dark
green.dark
yellow.dark
blue.dark
magenta.dark
cyan.dark
white.dark
black.bright
red.bright
green.bright
yellow.bright
blue.bright
magenta.bright
cyan.bright
white.bright
];
};
fonts = {
terminal = mkOption { type = my-types.font; };
ui = mkOption { type = my-types.font; };
};
user = {
github = stringOption;
name = stringOption;
email = stringOption;
github = mkOption { type = types.str; };
name = mkOption { type = types.str; };
email = mkOption { type = types.strMatching ".+@.+\\..+"; };
};
ignore = mkOption {
type = types.listOf types.string;
type = types.listOf types.str;
default = [ "*~" ".stack-work/" "__pycache__/" ".mypy_cache/" "*.py[co]" "*.o" "*.hi" "*.aux" "*.bbl" "*.bcf" "*.blg" "*.fdb_latexmk" "*.fls" "*.out" "*.run.xml" "*.toc" "*.bbl" "*.class" "*.dyn_hi" "*.dyn_o" "dist/" ];
};
theme = {
gtk = themeOption;
icon = themeOption;
cursor = themeOption;
gtk = mkOption { type = my-types.theme; };
icon = mkOption { type = my-types.theme; };
cursor = mkOption { type = my-types.theme; };
};
};
}