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

37 lines
950 B
Nix
Raw Normal View History

{ lib
2022-11-19 00:56:53 +03:00
, plugins
2022-09-24 17:21:16 +03:00
, theme
, lualine-nvim
, lualine-lsp-progress
2022-09-18 12:15:44 +03:00
, nvim-web-devicons
2022-09-19 18:44:57 +03:00
, tabby-nvim
2022-10-22 23:35:27 +03:00
, enableDevIcons ? false
, enableTabby ? false
, themeCfg ? { }
, ...
}:
let
2022-10-22 23:35:27 +03:00
inherit (builtins) readFile;
2022-09-24 17:21:16 +03:00
2022-10-22 23:35:27 +03:00
themeFlavour = if themeCfg ? flavour then theme.flavour else "frappe";
themeConfig = if themeCfg ? config then theme.config else ''
2022-09-24 17:21:16 +03:00
vim.g.catppuccin_flavour = "${themeFlavour}"
require("catppuccin").setup()
vim.cmd([[colorscheme catppuccin]])
'';
2022-09-19 18:44:57 +03:00
2022-11-19 00:56:53 +03:00
lualineSettings = lib.toLua (lib.attrByPath [ "lualine" "settings" ] { } plugins);
2022-09-24 17:21:16 +03:00
lualinePlugins = [ lualine-nvim lualine-lsp-progress ];
in
{
2022-09-24 17:21:16 +03:00
luaConfig = themeConfig
2022-11-19 00:56:53 +03:00
+ (readFile (lib.substituteAll { src = ./lualine.lua; inherit lualineSettings; }))
2022-09-24 17:21:16 +03:00
+ (lib.optional enableTabby (readFile ./tabby-nvim.lua));
2022-09-24 17:21:16 +03:00
plugins = [ theme ]
++ lualinePlugins
2022-09-18 12:15:44 +03:00
++ (lib.optional enableDevIcons [ nvim-web-devicons ])
2022-09-19 18:44:57 +03:00
++ (lib.optional enableTabby [ tabby-nvim ]);
}