nix-community.nixvim/plugins/statuslines/airline.nix

84 lines
2.2 KiB
Nix
Raw Normal View History

2021-01-05 11:26:49 +00:00
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.plugins.airline;
2021-01-05 11:26:49 +00:00
helpers = import ../helpers.nix { inherit lib; };
sectionType = with types; nullOr (oneOf [ str (listOf str) ]);
2021-01-05 11:26:49 +00:00
sectionOption = mkOption {
default = null;
type = sectionType;
description = "Configuration for this section. Can be either a statusline-format string or a list of modules to be passed to airline#section#create_*.";
};
in
{
2021-01-05 11:26:49 +00:00
options = {
plugins.airline = {
2023-01-22 03:32:08 +00:00
enable = mkEnableOption "airline";
2021-01-05 11:26:49 +00:00
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.vim-airline;
description = "Plguin to use for airline";
};
general: add package options (#127) * barbar: package option * Base16: package option * gruvbox: package option * nord: package option * one: package option * onedark: package option * tokyonight: package option * nvim-cmp: package option * coq: package option * lspkind: package option * helpers: added package option to mkPlugin * fugitive: package option * gitgutter: package option * gitsigns: package option * neogit: package option * ledger: package option * nix: package option * plantuml-syntax: package option * treesitter-context: package option + formatting * treesitter-refactor: package option + formatting * treesitter: package option * zig: package option * null-ls: package option * null-ls/servers: package option * lsp-lines: package option * lspsaga: package option * trouble: package option * luasnip: added description for package option * airline: package option * lightline: package option * lualine: package option * telescope: package option * telescope/frecency: package option * telescope/fzf-native: package option * telescope/media-files: package option * comment-nvim: package option * vim-commentary: package option * dashboard: package option * easyescape: package option * emmet: package option * endwise: package option * floaterm: package option * goyo: package option * intellitab: package option * mark-radar: package option * notify: package option * nvim-autopairs: package option * nvim-tree: package option * project-nvim: package option * specs: package option * startify: package option * surround: package option * undotree: package option
2023-01-19 10:45:15 +00:00
2021-01-05 11:26:49 +00:00
extensions = mkOption {
default = null;
type = with types; nullOr attrs;
description = "A list of extensions and their configuration";
};
onTop = mkOption {
default = false;
type = types.bool;
description = "Whether to show the statusline on the top instead of the bottom";
};
sections = mkOption {
2022-01-12 12:42:12 +00:00
description = "Statusbar sections";
2021-01-05 11:26:49 +00:00
default = null;
type = with types; nullOr (submodule {
options = {
a = sectionOption;
b = sectionOption;
c = sectionOption;
x = sectionOption;
y = sectionOption;
z = sectionOption;
};
2021-01-05 11:26:49 +00:00
});
};
powerline = mkOption {
default = false;
type = types.bool;
2021-01-05 11:26:49 +00:00
description = "Whether to use powerline symbols";
};
theme = mkOption {
default = config.colorscheme;
2021-01-05 11:26:49 +00:00
type = with types; nullOr str;
description = "The theme to use for vim-airline. If set, vim-airline-themes will be installed.";
};
};
};
config =
let
sections = { };
in
mkIf cfg.enable {
2021-01-05 11:26:49 +00:00
extraPlugins = with pkgs.vimPlugins; [
general: add package options (#127) * barbar: package option * Base16: package option * gruvbox: package option * nord: package option * one: package option * onedark: package option * tokyonight: package option * nvim-cmp: package option * coq: package option * lspkind: package option * helpers: added package option to mkPlugin * fugitive: package option * gitgutter: package option * gitsigns: package option * neogit: package option * ledger: package option * nix: package option * plantuml-syntax: package option * treesitter-context: package option + formatting * treesitter-refactor: package option + formatting * treesitter: package option * zig: package option * null-ls: package option * null-ls/servers: package option * lsp-lines: package option * lspsaga: package option * trouble: package option * luasnip: added description for package option * airline: package option * lightline: package option * lualine: package option * telescope: package option * telescope/frecency: package option * telescope/fzf-native: package option * telescope/media-files: package option * comment-nvim: package option * vim-commentary: package option * dashboard: package option * easyescape: package option * emmet: package option * endwise: package option * floaterm: package option * goyo: package option * intellitab: package option * mark-radar: package option * notify: package option * nvim-autopairs: package option * nvim-tree: package option * project-nvim: package option * specs: package option * startify: package option * surround: package option * undotree: package option
2023-01-19 10:45:15 +00:00
cfg.package
2021-01-05 11:26:49 +00:00
] ++ optional (!isNull cfg.theme) vim-airline-themes;
globals = {
airline.extensions = cfg.extensions;
airline_statusline_ontop = mkIf cfg.onTop 1;
airline_powerline_fonts = mkIf (cfg.powerline) 1;
airline_theme = mkIf (!isNull cfg.theme) cfg.theme;
} // sections;
};
}