refactor: complete rewrite
This commit is contained in:
parent
19a4bbda3c
commit
8e81943cf9
399 changed files with 3396 additions and 8042 deletions
74
modules/nixos/appearance/options.nix
Normal file
74
modules/nixos/appearance/options.nix
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
{
|
||||
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 = {
|
||||
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;
|
||||
};
|
||||
};
|
||||
# Credit to github:misterio77/nix-colors
|
||||
colorscheme = {
|
||||
name = mkOption {
|
||||
type = enum ["gruvbox-material-medium"];
|
||||
default = "gruvbox-material-medium";
|
||||
};
|
||||
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 = (import ./palettes/${config.ooknet.appearance.colorscheme.slug}.nix).colorscheme.palette;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue