From 5955d530776380f39f46c5eeaf446ceeedde89e8 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Fri, 15 Mar 2024 15:01:46 +0300 Subject: [PATCH] modules/ui: switch to explicit lib calls --- modules/ui/borders/borders.nix | 2 +- modules/ui/breadcrumbs/breadcrumbs.nix | 20 +++++++++---------- modules/ui/breadcrumbs/config.nix | 2 +- modules/ui/modes/modes.nix | 18 +++++++++++------ modules/ui/noice/noice.nix | 2 +- .../ui/notifications/nvim-notify/config.nix | 1 - .../notifications/nvim-notify/nvim-notify.nix | 2 +- modules/ui/smartcolumn/config.nix | 20 +++++++++---------- modules/ui/smartcolumn/smartcolumn.nix | 2 +- 9 files changed, 37 insertions(+), 32 deletions(-) diff --git a/modules/ui/borders/borders.nix b/modules/ui/borders/borders.nix index 4d4952b..37589dc 100644 --- a/modules/ui/borders/borders.nix +++ b/modules/ui/borders/borders.nix @@ -18,7 +18,7 @@ in { type = enum defaultStyles; default = "rounded"; description = '' - The global border style to use + The global border style to use. ''; }; diff --git a/modules/ui/breadcrumbs/breadcrumbs.nix b/modules/ui/breadcrumbs/breadcrumbs.nix index 68c2a9f..f56223b 100644 --- a/modules/ui/breadcrumbs/breadcrumbs.nix +++ b/modules/ui/breadcrumbs/breadcrumbs.nix @@ -339,8 +339,8 @@ in { package = mkOption { type = str; - default = " "; - description = "Package icon"; + default = " "; + description = ""; }; class = mkOption { @@ -351,8 +351,8 @@ in { property = mkOption { type = str; - default = " "; - description = "Property icon"; + default = " "; + description = ""; }; field = mkOption { @@ -387,8 +387,8 @@ in { variable = mkOption { type = str; - default = "󰫧 "; - description = "Variable icon"; + default = "󰆧 "; + description = ""; }; constant = mkOption { @@ -399,8 +399,8 @@ in { string = mkOption { type = str; - default = " "; - description = "String icon"; + default = " "; + description = ""; }; number = mkOption { @@ -411,8 +411,8 @@ in { boolean = mkOption { type = str; - default = " "; - description = "Boolean icon"; + default = "◩ "; + description = ""; }; array = mkOption { diff --git a/modules/ui/breadcrumbs/config.nix b/modules/ui/breadcrumbs/config.nix index 5afda30..3dc3713 100644 --- a/modules/ui/breadcrumbs/config.nix +++ b/modules/ui/breadcrumbs/config.nix @@ -3,9 +3,9 @@ lib, ... }: let - inherit (lib.modules) mkIf; inherit (lib.strings) optionalString; inherit (lib.trivial) boolToString; + inherit (lib.modules) mkIf; inherit (lib.lists) optionals; inherit (lib.nvim.lua) nullString; inherit (lib.nvim.dag) entryAfter; diff --git a/modules/ui/modes/modes.nix b/modules/ui/modes/modes.nix index e49251a..af45d30 100644 --- a/modules/ui/modes/modes.nix +++ b/modules/ui/modes/modes.nix @@ -3,31 +3,37 @@ inherit (lib.types) str; in { options.vim.ui.modes-nvim = { - enable = mkEnableOption "prismatic line decorations [modes.nvim]"; - setCursorline = mkEnableOption "colored cursorline on current line"; + enable = mkEnableOption "modes.nvim's prismatic line decorations"; + + setCursorline = mkOption { + type = bool; + description = "Set a colored cursorline on current line"; + default = false; # looks ugly, disabled by default + }; + colors = { copy = mkOption { type = str; - description = "The #RRGGBB color code for the visual mode highlights"; default = "#f5c359"; + description = "The #RRGGBB color code for the visual mode highlights"; }; delete = mkOption { type = str; - description = "The #RRGGBB color code for the visual mode highlights"; default = "#c75c6a"; + description = "The #RRGGBB color code for the visual mode highlights"; }; insert = mkOption { type = str; - description = "The #RRGGBB color code for the visual mode highlights"; default = "#78ccc5"; + description = "The #RRGGBB color code for the visual mode highlights"; }; visual = mkOption { type = str; - description = "The #RRGGBB color code for the visual mode highlights"; default = "#9745be"; + description = "The #RRGGBB color code for the visual mode highlights"; }; }; }; diff --git a/modules/ui/noice/noice.nix b/modules/ui/noice/noice.nix index 3997987..b361d45 100644 --- a/modules/ui/noice/noice.nix +++ b/modules/ui/noice/noice.nix @@ -2,6 +2,6 @@ inherit (lib.options) mkEnableOption; in { options.vim.ui.noice = { - enable = mkEnableOption "UI modification library [noice.nvim]"; + enable = mkEnableOption "noice.nvim UI modification library"; }; } diff --git a/modules/ui/notifications/nvim-notify/config.nix b/modules/ui/notifications/nvim-notify/config.nix index c2c4991..852b94d 100644 --- a/modules/ui/notifications/nvim-notify/config.nix +++ b/modules/ui/notifications/nvim-notify/config.nix @@ -11,7 +11,6 @@ in { config = mkIf cfg.enable { vim = { startPlugins = ["nvim-notify"]; - luaConfigRC.nvim-notify = entryAnywhere '' require('notify').setup { stages = "${cfg.stages}", diff --git a/modules/ui/notifications/nvim-notify/nvim-notify.nix b/modules/ui/notifications/nvim-notify/nvim-notify.nix index ab78d45..57683a4 100644 --- a/modules/ui/notifications/nvim-notify/nvim-notify.nix +++ b/modules/ui/notifications/nvim-notify/nvim-notify.nix @@ -1,5 +1,5 @@ {lib, ...}: let - inherit (lib.options) mkOption mkEnableOption; + inherit (lib) mkOption mkEnableOption; inherit (lib.types) enum int str attrsOf; in { options.vim.notify.nvim-notify = { diff --git a/modules/ui/smartcolumn/config.nix b/modules/ui/smartcolumn/config.nix index 3f4ae05..48b47d2 100644 --- a/modules/ui/smartcolumn/config.nix +++ b/modules/ui/smartcolumn/config.nix @@ -7,21 +7,21 @@ inherit (lib.strings) concatStringsSep; inherit (lib.nvim.lua) attrsetToLuaTable; inherit (lib.nvim.dag) entryAnywhere; + cfg = config.vim.ui.smartcolumn; in { config = mkIf cfg.enable { vim = { startPlugins = ["smartcolumn"]; - luaConfigRC.smartcolumn = entryAnywhere '' - require("smartcolumn").setup({ - colorcolumn = "${toString cfg.showColumnAt}", - -- { "help", "text", "markdown", "NvimTree", "alpha"}, - disabled_filetypes = { ${concatStringsSep ", " (map (x: "\"" + x + "\"") cfg.disabledFiletypes)} }, - custom_colorcolumn = ${attrsetToLuaTable cfg.columnAt.languages}, - scope = "file", - }) - ''; - }; + vim.luaConfigRC.smartcolumn = entryAnywhere '' + require("smartcolumn").setup({ + colorcolumn = "${toString cfg.showColumnAt}", + -- { "help", "text", "markdown", "NvimTree", "alpha"}, + disabled_filetypes = { ${concatStringsSep ", " (map (x: "\"" + x + "\"") cfg.disabledFiletypes)} }, + custom_colorcolumn = ${attrsetToLuaTable cfg.columnAt.languages}, + scope = "file", + }) + ''; }; } diff --git a/modules/ui/smartcolumn/smartcolumn.nix b/modules/ui/smartcolumn/smartcolumn.nix index fe578be..bac4c7d 100644 --- a/modules/ui/smartcolumn/smartcolumn.nix +++ b/modules/ui/smartcolumn/smartcolumn.nix @@ -1,6 +1,6 @@ {lib, ...}: let inherit (lib.options) mkOption mkEnableOption literalExpression; - inherit (lib.types) attrsOf either nullOr listOf int str submodule; + inherit (lib.types) nullOr int str submodule attrsOf either listOf; in { options.vim.ui.smartcolumn = { enable = mkEnableOption "line length indicator";