modules/ui: switch to explicit lib calls

This commit is contained in:
NotAShelf 2024-03-15 15:01:46 +03:00 committed by Ching Pei Yang
parent db0df5c211
commit 5955d53077
9 changed files with 37 additions and 32 deletions

View file

@ -18,7 +18,7 @@ in {
type = enum defaultStyles;
default = "rounded";
description = ''
The global border style to use
The global border style to use.
'';
};

View file

@ -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 {

View file

@ -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;

View file

@ -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";
};
};
};

View file

@ -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";
};
}

View file

@ -11,7 +11,6 @@ in {
config = mkIf cfg.enable {
vim = {
startPlugins = ["nvim-notify"];
luaConfigRC.nvim-notify = entryAnywhere ''
require('notify').setup {
stages = "${cfg.stages}",

View file

@ -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 = {

View file

@ -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",
})
'';
};
}

View file

@ -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";