From b4999306614e6300657cdb3c2db53b4fe8f18c31 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Tue, 18 Apr 2023 01:53:08 +0300 Subject: [PATCH] feat(lualine): minor refactor --- modules/statusline/lualine/config.nix | 1 + modules/statusline/lualine/lualine.nix | 14 +++----------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/modules/statusline/lualine/config.nix b/modules/statusline/lualine/config.nix index deb78fb..7d4d879 100644 --- a/modules/statusline/lualine/config.nix +++ b/modules/statusline/lualine/config.nix @@ -22,6 +22,7 @@ in { always_divide_middle = true, globalstatus = ${boolToString cfg.globalStatus}, ignore_focus = {'NvimTree'}, + extensions = {${optionalString config.vim.filetree.nvimTreeLua.enable "'nvim-tree'"}}, refresh = { statusline = ${toString cfg.refresh.statusline}, tabline = ${toString cfg.refresh.tabline}, diff --git a/modules/statusline/lualine/lualine.nix b/modules/statusline/lualine/lualine.nix index f95850a..5cd51e8 100644 --- a/modules/statusline/lualine/lualine.nix +++ b/modules/statusline/lualine/lualine.nix @@ -8,11 +8,7 @@ with builtins; let supported_themes = import ./supported_themes.nix; in { options.vim.statusline.lualine = { - enable = mkOption { - type = types.bool; - description = "Enable lualine statusline"; - default = true; - }; + enable = mkEnableOption "lualine"; icons = { enable = mkOption { @@ -47,6 +43,7 @@ in { }; theme = mkOption { + description = "Theme for lualine"; default = "auto"; type = types.enum ( [ @@ -82,13 +79,8 @@ in { "tomorrow" "wombat" ] - ++ ( - if elem config.vim.theme.name supported_themes - then [config.vim.theme.name] - else [] - ) + ++ optional (elem config.vim.theme.name supported_themes) config.vim.theme.name ); - description = "Theme for lualine"; }; sectionSeparator = {