neovim/plugins/theme/default.nix

37 lines
950 B
Nix

{ lib
, plugins
, theme
, lualine-nvim
, lualine-lsp-progress
, nvim-web-devicons
, tabby-nvim
, enableDevIcons ? false
, enableTabby ? false
, themeCfg ? { }
, ...
}:
let
inherit (builtins) readFile;
themeFlavour = if themeCfg ? flavour then theme.flavour else "frappe";
themeConfig = if themeCfg ? config then theme.config else ''
vim.g.catppuccin_flavour = "${themeFlavour}"
require("catppuccin").setup()
vim.cmd([[colorscheme catppuccin]])
'';
lualineSettings = lib.toLua (lib.attrByPath [ "lualine" "settings" ] { } plugins);
lualinePlugins = [ lualine-nvim lualine-lsp-progress ];
in
{
luaConfig = themeConfig
+ (readFile (lib.substituteAll { src = ./lualine.lua; inherit lualineSettings; }))
+ (lib.optional enableTabby (readFile ./tabby-nvim.lua));
plugins = [ theme ]
++ lualinePlugins
++ (lib.optional enableDevIcons [ nvim-web-devicons ])
++ (lib.optional enableTabby [ tabby-nvim ]);
}