mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 02:11:33 +00:00
dev: rebase on a less personalized neovim flake
This commit is contained in:
commit
9c00808863
70 changed files with 4910 additions and 0 deletions
65
modules/statusline/config.nix
Normal file
65
modules/statusline/config.nix
Normal file
|
@ -0,0 +1,65 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; {
|
||||
config = {
|
||||
vim.statusline.lualine = {
|
||||
enable = mkDefault false;
|
||||
|
||||
icons = mkDefault true;
|
||||
theme = mkDefault "auto";
|
||||
sectionSeparator = {
|
||||
left = mkDefault "";
|
||||
right = mkDefault "";
|
||||
};
|
||||
|
||||
componentSeparator = {
|
||||
left = mkDefault "⏽";
|
||||
right = mkDefault "⏽";
|
||||
};
|
||||
|
||||
activeSection = {
|
||||
a = mkDefault "{'mode'}";
|
||||
b = ''
|
||||
{
|
||||
{
|
||||
"branch",
|
||||
separator = '',
|
||||
},
|
||||
"diff",
|
||||
}
|
||||
'';
|
||||
c = mkDefault "{'filename'}";
|
||||
x = mkDefault ''
|
||||
{
|
||||
{
|
||||
"diagnostics",
|
||||
sources = {'nvim_lsp'},
|
||||
separator = '',
|
||||
symbols = {error = '', warn = '', info = '', hint = ''},
|
||||
},
|
||||
{
|
||||
"filetype",
|
||||
},
|
||||
"fileformat",
|
||||
"encoding",
|
||||
}
|
||||
'';
|
||||
y = mkDefault "{'progress'}";
|
||||
z = mkDefault "{'location'}";
|
||||
};
|
||||
|
||||
inactiveSection = {
|
||||
a = mkDefault "{}";
|
||||
b = mkDefault "{}";
|
||||
c = mkDefault "{'filename'}";
|
||||
x = mkDefault "{'location'}";
|
||||
y = mkDefault "{}";
|
||||
z = mkDefault "{}";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
11
modules/statusline/default.nix
Normal file
11
modules/statusline/default.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./lualine.nix
|
||||
./config.nix
|
||||
];
|
||||
}
|
205
modules/statusline/lualine.nix
Normal file
205
modules/statusline/lualine.nix
Normal file
|
@ -0,0 +1,205 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with builtins; let
|
||||
cfg = config.vim.statusline.lualine;
|
||||
supported_themes = import ./supported_lualine_themes.nix;
|
||||
in {
|
||||
options.vim.statusline.lualine = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
description = "Enable lualine";
|
||||
};
|
||||
|
||||
icons = mkOption {
|
||||
type = types.bool;
|
||||
description = "Enable icons for lualine";
|
||||
};
|
||||
|
||||
theme = mkOption {
|
||||
type = types.enum (
|
||||
[
|
||||
"auto"
|
||||
"16color"
|
||||
"gruvbox"
|
||||
"ayu_dark"
|
||||
"ayu_light"
|
||||
"ayu_mirage"
|
||||
"codedark"
|
||||
"dracula"
|
||||
"everforest"
|
||||
"gruvbox"
|
||||
"gruvbox_light"
|
||||
"gruvbox_material"
|
||||
"horizon"
|
||||
"iceberg_dark"
|
||||
"iceberg_light"
|
||||
"jellybeans"
|
||||
"material"
|
||||
"modus_vivendi"
|
||||
"molokai"
|
||||
"nightfly"
|
||||
"nord"
|
||||
"oceanicnext"
|
||||
"onelight"
|
||||
"palenight"
|
||||
"papercolor_dark"
|
||||
"papercolor_light"
|
||||
"powerline"
|
||||
"seoul256"
|
||||
"solarized_dark"
|
||||
"tomorrow"
|
||||
"wombat"
|
||||
]
|
||||
++ (
|
||||
if elem config.vim.theme.name supported_themes
|
||||
then [config.vim.theme.name]
|
||||
else []
|
||||
)
|
||||
);
|
||||
description = "Theme for lualine";
|
||||
};
|
||||
|
||||
sectionSeparator = {
|
||||
left = mkOption {
|
||||
type = types.str;
|
||||
description = "Section separator for left side";
|
||||
};
|
||||
|
||||
right = mkOption {
|
||||
type = types.str;
|
||||
description = "Section separator for right side";
|
||||
};
|
||||
};
|
||||
|
||||
componentSeparator = {
|
||||
left = mkOption {
|
||||
type = types.str;
|
||||
description = "Component separator for left side";
|
||||
};
|
||||
|
||||
right = mkOption {
|
||||
type = types.str;
|
||||
description = "Component separator for right side";
|
||||
};
|
||||
};
|
||||
|
||||
activeSection = {
|
||||
a = mkOption {
|
||||
type = types.str;
|
||||
description = "active config for: | (A) | B | C X | Y | Z |";
|
||||
};
|
||||
|
||||
b = mkOption {
|
||||
type = types.str;
|
||||
description = "active config for: | A | (B) | C X | Y | Z |";
|
||||
};
|
||||
|
||||
c = mkOption {
|
||||
type = types.str;
|
||||
description = "active config for: | A | B | (C) X | Y | Z |";
|
||||
};
|
||||
|
||||
x = mkOption {
|
||||
type = types.str;
|
||||
description = "active config for: | A | B | C (X) | Y | Z |";
|
||||
};
|
||||
|
||||
y = mkOption {
|
||||
type = types.str;
|
||||
description = "active config for: | A | B | C X | (Y) | Z |";
|
||||
};
|
||||
|
||||
z = mkOption {
|
||||
type = types.str;
|
||||
description = "active config for: | A | B | C X | Y | (Z) |";
|
||||
};
|
||||
};
|
||||
|
||||
inactiveSection = {
|
||||
a = mkOption {
|
||||
type = types.str;
|
||||
description = "inactive config for: | (A) | B | C X | Y | Z |";
|
||||
};
|
||||
|
||||
b = mkOption {
|
||||
type = types.str;
|
||||
description = "inactive config for: | A | (B) | C X | Y | Z |";
|
||||
};
|
||||
|
||||
c = mkOption {
|
||||
type = types.str;
|
||||
description = "inactive config for: | A | B | (C) X | Y | Z |";
|
||||
};
|
||||
|
||||
x = mkOption {
|
||||
type = types.str;
|
||||
description = "inactive config for: | A | B | C (X) | Y | Z |";
|
||||
};
|
||||
|
||||
y = mkOption {
|
||||
type = types.str;
|
||||
description = "inactive config for: | A | B | C X | (Y) | Z |";
|
||||
};
|
||||
|
||||
z = mkOption {
|
||||
type = types.str;
|
||||
description = "inactive config for: | A | B | C X | Y | (Z) |";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config =
|
||||
mkIf cfg.enable
|
||||
{
|
||||
#assertions = [
|
||||
# ({
|
||||
# assertion = if cfg.icons then (config.vim.visuals.enable && config.vim.visuals.nvimWebDevicons.enable) else true;
|
||||
# message = "Must enable config.vim.visual.nvimWebDevicons if using config.vim.visuals.lualine.icons";
|
||||
# })
|
||||
#];
|
||||
|
||||
vim.startPlugins = ["lualine"];
|
||||
vim.luaConfigRC.lualine = nvim.dag.entryAnywhere ''
|
||||
require'lualine'.setup {
|
||||
options = {
|
||||
icons_enabled = ${
|
||||
if cfg.icons
|
||||
then "true"
|
||||
else "false"
|
||||
},
|
||||
theme = "${cfg.theme}",
|
||||
component_separators = {"${cfg.componentSeparator.left}","${cfg.componentSeparator.right}"},
|
||||
section_separators = {"${cfg.sectionSeparator.left}","${cfg.sectionSeparator.right}"},
|
||||
disabled_filetypes = {},
|
||||
},
|
||||
sections = {
|
||||
lualine_a = ${cfg.activeSection.a},
|
||||
lualine_b = ${cfg.activeSection.b},
|
||||
lualine_c = ${cfg.activeSection.c},
|
||||
lualine_x = ${cfg.activeSection.x},
|
||||
lualine_y = ${cfg.activeSection.y},
|
||||
lualine_z = ${cfg.activeSection.z},
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = ${cfg.inactiveSection.a},
|
||||
lualine_b = ${cfg.inactiveSection.b},
|
||||
lualine_c = ${cfg.inactiveSection.c},
|
||||
lualine_x = ${cfg.inactiveSection.x},
|
||||
lualine_y = ${cfg.inactiveSection.y},
|
||||
lualine_z = ${cfg.inactiveSection.z},
|
||||
},
|
||||
tabline = {},
|
||||
extensions = {${
|
||||
if config.vim.filetree.nvimTreeLua.enable
|
||||
then "\"nvim-tree\""
|
||||
else ""
|
||||
}},
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
5
modules/statusline/supported_lualine_themes.nix
Normal file
5
modules/statusline/supported_lualine_themes.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
[
|
||||
"tokyonight"
|
||||
"onedark"
|
||||
"catppuccin"
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue