mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-04 06:14:32 +02:00
This represents a major rearchitecture for nixvim, so I'm leaving this up to track the progress for now, and to serve as a reference for any breaking changes during transition. The main change is, of course, being able to use nixvim standalone. To do this, you should use the new build function, which takes in two arguments: the system architecture (e.g. x86_64-linux) and the configuration. For the new configuration, do not use the programs.nixvim. prefix. For module development, the main change is that you should no longer prefix your modules with programs.nixvim..
77 lines
2 KiB
Nix
77 lines
2 KiB
Nix
{ pkgs, config, lib, ... }:
|
|
with lib;
|
|
let
|
|
cfg = config.plugins.airline;
|
|
helpers = import ../helpers.nix { inherit lib; };
|
|
|
|
sectionType = with types; nullOr (oneOf [ str (listOf str) ]);
|
|
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
|
|
{
|
|
options = {
|
|
plugins.airline = {
|
|
enable = mkEnableOption "Enable airline";
|
|
|
|
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 {
|
|
description = "Statusbar sections";
|
|
default = null;
|
|
type = with types; nullOr (submodule {
|
|
options = {
|
|
a = sectionOption;
|
|
b = sectionOption;
|
|
c = sectionOption;
|
|
x = sectionOption;
|
|
y = sectionOption;
|
|
z = sectionOption;
|
|
};
|
|
});
|
|
};
|
|
|
|
powerline = mkOption {
|
|
default = false;
|
|
type = types.bool;
|
|
description = "Whether to use powerline symbols";
|
|
};
|
|
|
|
theme = mkOption {
|
|
default = config.colorscheme;
|
|
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 {
|
|
extraPlugins = with pkgs.vimPlugins; [
|
|
vim-airline
|
|
] ++ 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;
|
|
};
|
|
}
|