mirror of
				https://github.com/NotAShelf/nvf.git
				synced 2025-10-31 02:52:37 +00:00 
			
		
		
		
	visuals/tiny-devicons-auto-colors: init module
This commit is contained in:
		
					parent
					
						
							
								4f93abc2f2
							
						
					
				
			
			
				commit
				
					
						5a95f812ce
					
				
			
		
					 6 changed files with 91 additions and 0 deletions
				
			
		
							
								
								
									
										17
									
								
								flake.lock
									
										
									
										generated
									
									
									
								
							
							
						
						
									
										17
									
								
								flake.lock
									
										
									
										generated
									
									
									
								
							|  | @ -1790,6 +1790,22 @@ | |||
|         "type": "github" | ||||
|       } | ||||
|     }, | ||||
|     "plugin-tiny-devicons-auto-colors": { | ||||
|       "flake": false, | ||||
|       "locked": { | ||||
|         "lastModified": 1724403745, | ||||
|         "narHash": "sha256-Ndkbvxn/x7+fxEYD7JIygqUiItuhoY+4+DaL/pJGKdc=", | ||||
|         "owner": "rachartier", | ||||
|         "repo": "tiny-devicons-auto-colors.nvim", | ||||
|         "rev": "a39fa4c92268832f6034306793b8acbfec2a7549", | ||||
|         "type": "github" | ||||
|       }, | ||||
|       "original": { | ||||
|         "owner": "rachartier", | ||||
|         "repo": "tiny-devicons-auto-colors.nvim", | ||||
|         "type": "github" | ||||
|       } | ||||
|     }, | ||||
|     "plugin-todo-comments": { | ||||
|       "flake": false, | ||||
|       "locked": { | ||||
|  | @ -2112,6 +2128,7 @@ | |||
|         "plugin-sqls-nvim": "plugin-sqls-nvim", | ||||
|         "plugin-tabular": "plugin-tabular", | ||||
|         "plugin-telescope": "plugin-telescope", | ||||
|         "plugin-tiny-devicons-auto-colors": "plugin-tiny-devicons-auto-colors", | ||||
|         "plugin-todo-comments": "plugin-todo-comments", | ||||
|         "plugin-toggleterm-nvim": "plugin-toggleterm-nvim", | ||||
|         "plugin-tokyonight": "plugin-tokyonight", | ||||
|  |  | |||
|  | @ -468,6 +468,11 @@ | |||
|       flake = false; | ||||
|     }; | ||||
| 
 | ||||
|     plugin-tiny-devicons-auto-colors = { | ||||
|       url = "github:rachartier/tiny-devicons-auto-colors.nvim"; | ||||
|       flake = false; | ||||
|     }; | ||||
| 
 | ||||
|     plugin-gitsigns-nvim = { | ||||
|       url = "github:lewis6991/gitsigns.nvim"; | ||||
|       flake = false; | ||||
|  |  | |||
|  | @ -15,5 +15,6 @@ in { | |||
|     ./nvim-cursorline | ||||
|     ./nvim-scrollbar | ||||
|     ./nvim-web-devicons | ||||
|     ./tiny-devicons-auto-colors | ||||
|   ]; | ||||
| } | ||||
|  |  | |||
							
								
								
									
										21
									
								
								modules/plugins/visuals/tiny-devicons-auto-colors/config.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								modules/plugins/visuals/tiny-devicons-auto-colors/config.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,21 @@ | |||
| { | ||||
|   config, | ||||
|   lib, | ||||
|   ... | ||||
| }: let | ||||
|   inherit (lib.modules) mkIf; | ||||
|   inherit (lib.nvim.lua) toLuaObject; | ||||
|   inherit (lib.nvim.dag) entryAnywhere; | ||||
| 
 | ||||
|   cfg = config.vim.visuals.tiny-devicons-auto-colors; | ||||
| in { | ||||
|   config = mkIf cfg.enable { | ||||
|     vim = { | ||||
|       startPlugins = ["tiny-devicons-auto-colors" "nvim-web-devicons"]; | ||||
| 
 | ||||
|       pluginRC.tiny-devicons-auto-colors = entryAnywhere '' | ||||
|         require("tiny-devicons-auto-colors").setup(${toLuaObject cfg.setupOpts}) | ||||
|       ''; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
|  | @ -0,0 +1,6 @@ | |||
| { | ||||
|   imports = [ | ||||
|     ./config.nix | ||||
|     ./tiny-devicons-auto-colors.nix | ||||
|   ]; | ||||
| } | ||||
|  | @ -0,0 +1,41 @@ | |||
| {lib, ...}: let | ||||
|   inherit (lib.options) mkOption mkEnableOption; | ||||
|   inherit (lib.types) int float; | ||||
|   inherit (lib.generators) mkLuaInline; | ||||
|   inherit (lib.nvim.types) mkPluginSetupOption luaInline; | ||||
| in { | ||||
|   options.vim.visuals.tiny-devicons-auto-colors = { | ||||
|     enable = mkEnableOption "alternative nvim-web-devicons icon colors [tiny-devicons-auto-colors]"; | ||||
| 
 | ||||
|     setupOpts = mkPluginSetupOption "tiny-devicons-auto-colors" { | ||||
|       factors = { | ||||
|         lightness = mkOption { | ||||
|           type = float; | ||||
|           default = 1.76; | ||||
|           description = "Lightness factor of icons"; | ||||
|         }; | ||||
| 
 | ||||
|         chroma = mkOption { | ||||
|           type = int; | ||||
|           default = 1; | ||||
|           description = "Chroma factor of icons"; | ||||
|         }; | ||||
| 
 | ||||
|         hue = mkOption { | ||||
|           type = float; | ||||
|           default = 1.25; | ||||
|           description = "Hue factor of icons"; | ||||
|         }; | ||||
| 
 | ||||
|         cache = { | ||||
|           enabled = mkEnableOption "caching of icon colors. This will greatly improve performance" // {default = true;}; | ||||
|           path = mkOption { | ||||
|             type = luaInline; | ||||
|             default = mkLuaInline "vim.fn.stdpath(\"cache\") .. \"/tiny-devicons-auto-colors-cache.json\""; | ||||
|             description = "Path to the cache file"; | ||||
|           }; | ||||
|         }; | ||||
|       }; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue