feat(nixos:appearance): move appearance options to nixos
This commit is contained in:
parent
cedeb52103
commit
ceb66c03cf
51 changed files with 393 additions and 377 deletions
30
nixos/options/appearance/colors.nix
Normal file
30
nixos/options/appearance/colors.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkOption;
|
||||
inherit (lib.types) str enum attrsOf;
|
||||
|
||||
cfg = config.ooknet.colorscheme;
|
||||
in {
|
||||
# simple colorscheme module bases on misterio77/nix-colors
|
||||
options.ooknet.colorscheme = {
|
||||
name = mkOption {
|
||||
type = enum ["hozen"];
|
||||
default = "hozen";
|
||||
};
|
||||
variant = mkOption {
|
||||
type = enum ["dark" "light"];
|
||||
default = "dark";
|
||||
};
|
||||
slug = mkOption {
|
||||
type = str;
|
||||
default = "${toString cfg.name-cfg.variant}";
|
||||
};
|
||||
palette = {
|
||||
type = attrsOf str;
|
||||
default = (import ./palettes/${cfg.slug}.nix).colorscheme.palette;
|
||||
};
|
||||
};
|
||||
}
|
||||
77
nixos/options/appearance/default.nix
Normal file
77
nixos/options/appearance/default.nix
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) isString hasPrefix removePrefix mkOption mkOptionType;
|
||||
inherit (lib.types) enum str nullOr package path int attrsOf coercedTo;
|
||||
hexColorType = mkOptionType {
|
||||
name = "hex-color";
|
||||
descriptionClass = "noun";
|
||||
description = "RGB color in hex format";
|
||||
check = x: isString x && !(hasPrefix "#" x);
|
||||
};
|
||||
|
||||
mkFontOption = {
|
||||
family = mkOption {
|
||||
type = str;
|
||||
default = "";
|
||||
};
|
||||
package = mkOption {
|
||||
type = package;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
|
||||
cfg = config.ooknet.appearance;
|
||||
in {
|
||||
imports = [./palettes];
|
||||
options.ooknet.appearance = {
|
||||
theme = mkOption {
|
||||
type = nullOr (enum ["minimal" "phone"]);
|
||||
default = null;
|
||||
};
|
||||
fonts = {
|
||||
monospace = mkFontOption;
|
||||
regular = mkFontOption;
|
||||
};
|
||||
wallpaper = {
|
||||
path = mkOption {
|
||||
type = path;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
cursor = {
|
||||
package = mkOption {
|
||||
type = package;
|
||||
default = null;
|
||||
};
|
||||
name = mkOption {
|
||||
type = str;
|
||||
default = "";
|
||||
};
|
||||
size = mkOption {
|
||||
type = int;
|
||||
default = 22;
|
||||
};
|
||||
};
|
||||
colorscheme = {
|
||||
name = mkOption {
|
||||
type = enum ["hozen"];
|
||||
default = "hozen";
|
||||
};
|
||||
variant = mkOption {
|
||||
type = enum ["dark" "light"];
|
||||
default = "dark";
|
||||
};
|
||||
slug = mkOption {
|
||||
type = str;
|
||||
default = "${toString cfg.colorscheme.name}-${toString cfg.colorscheme.variant}";
|
||||
};
|
||||
palette = mkOption {
|
||||
type = attrsOf (coercedTo str (removePrefix "#") hexColorType);
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
3
nixos/options/appearance/palettes/default.nix
Normal file
3
nixos/options/appearance/palettes/default.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
imports = [./hozen-dark.nix];
|
||||
}
|
||||
57
nixos/options/appearance/palettes/hozen-dark.nix
Normal file
57
nixos/options/appearance/palettes/hozen-dark.nix
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.ooknet.appearance.colorscheme;
|
||||
inherit (lib) mkIf;
|
||||
in {
|
||||
ooknet.appearance.colorscheme = mkIf (cfg.name == "hozen" && cfg.variant == "dark") {
|
||||
palette = {
|
||||
crust = "2b2927";
|
||||
mantle = "33312e";
|
||||
base = "3f3b37";
|
||||
surface-0 = "48423c";
|
||||
surface-1 = "534d46";
|
||||
surface-2 = "655c53";
|
||||
overlay-0 = "766b60";
|
||||
overlay-1 = "9c8c7c";
|
||||
overlay-2 = "ac9a86";
|
||||
subtext-0 = "bfaa92";
|
||||
subtext-1 = "c9b39c";
|
||||
text = "d2bda7";
|
||||
red = "cc6666";
|
||||
dull-red = "b87a7a";
|
||||
orange = "cc8566";
|
||||
dull-orange = "b88d7a";
|
||||
yellow = "ccad66";
|
||||
dull-yellow = "ada185";
|
||||
green = "a0cc66";
|
||||
dull-green = "9db87a";
|
||||
cyan = "85ad98";
|
||||
dull-cyan = "92a099";
|
||||
blue = "7A9EBB";
|
||||
dull-blue = "8a94a8";
|
||||
purple = "8166cc";
|
||||
dull-purple = "998aa8";
|
||||
|
||||
base00 = "2b2927";
|
||||
base01 = "33312e";
|
||||
base02 = "48423c";
|
||||
base03 = "534d46";
|
||||
base04 = "655c53";
|
||||
base05 = "c9B39C";
|
||||
base06 = "deccba";
|
||||
base07 = "e7d9cb";
|
||||
|
||||
base08 = "CC6666"; #red
|
||||
base09 = "C28970"; #orange
|
||||
base0A = "C2A970"; #yellow
|
||||
base0B = "ACC270"; #green
|
||||
base0C = "70C296"; #cyan
|
||||
base0D = "7A9EB8"; #blue
|
||||
base0E = "C982B0"; #purple
|
||||
base0F = "B88D7A"; #dim-orange
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./appearance
|
||||
./gaming.nix
|
||||
./host.nix
|
||||
./programs.nix
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue