74 lines
		
	
	
	
		
			1.7 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			74 lines
		
	
	
	
		
			1.7 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
| {
 | |
|   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;
 | |
|       };
 | |
|     };
 | |
|   };
 | |
| }
 |