This repository has been archived on 2024-05-17. You can view files and clone it, but cannot push or open issues or pull requests.
neovim/plugins/theme/default.nix

36 lines
948 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.optionalString enableTabby (readFile ./tabby-nvim.lua));
plugins = [ theme ]
++ lualinePlugins
++ (lib.optional enableDevIcons nvim-web-devicons)
++ (lib.optional enableTabby tabby-nvim);
}