From 3766db3503bb440594f958d857f6fba99b7705c4 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Fri, 19 Apr 2024 21:28:07 +0200 Subject: [PATCH] fix: bad rebase --- modules/plugins/assistant/copilot/copilot.nix | 2 +- .../lsp/lsp-signature/lsp-signature.nix | 3 ++- .../lsp/nvim-docs-view/nvim-docs-view.nix | 14 ++++++----- modules/plugins/notes/obsidian/obsidian.nix | 15 +++++++----- .../plugins/notes/todo-comments/config.nix | 2 +- .../notes/todo-comments/todo-comments.nix | 15 +++++++----- .../plugins/projects/project-nvim/config.nix | 8 ++++--- .../projects/project-nvim/project-nvim.nix | 23 +++++++++++-------- .../terminal/toggleterm/toggleterm.nix | 2 +- 9 files changed, 49 insertions(+), 35 deletions(-) diff --git a/modules/plugins/assistant/copilot/copilot.nix b/modules/plugins/assistant/copilot/copilot.nix index c8aba32..b19a7d6 100644 --- a/modules/plugins/assistant/copilot/copilot.nix +++ b/modules/plugins/assistant/copilot/copilot.nix @@ -4,7 +4,7 @@ lib, ... }: let - inherit (lib) mkRenamedOptionModule; + inherit (lib.modules) mkRenamedOptionModule; inherit (lib.options) mkEnableOption mkOption; inherit (lib.types) nullOr str enum float; inherit (lib.nvim.types) mkPluginSetupOption; diff --git a/modules/plugins/lsp/lsp-signature/lsp-signature.nix b/modules/plugins/lsp/lsp-signature/lsp-signature.nix index be7b6cd..4589018 100644 --- a/modules/plugins/lsp/lsp-signature/lsp-signature.nix +++ b/modules/plugins/lsp/lsp-signature/lsp-signature.nix @@ -1,10 +1,11 @@ {lib, ...}: let inherit (lib.options) mkEnableOption; + inherit (lib.nvim.types) mkPluginSetupOption; in { options.vim.lsp = { lspSignature = { enable = mkEnableOption "lsp signature viewer"; - setupOpts = lib.nvim.types.mkPluginSetupOption "lsp-signature" {}; + setupOpts = mkPluginSetupOption "lsp-signature" {}; }; }; } diff --git a/modules/plugins/lsp/nvim-docs-view/nvim-docs-view.nix b/modules/plugins/lsp/nvim-docs-view/nvim-docs-view.nix index e75c385..105aebe 100644 --- a/modules/plugins/lsp/nvim-docs-view/nvim-docs-view.nix +++ b/modules/plugins/lsp/nvim-docs-view/nvim-docs-view.nix @@ -1,7 +1,9 @@ {lib, ...}: let inherit (lib.options) mkEnableOption mkOption; inherit (lib.nvim.binds) mkMappingOption; - inherit (lib) types mkRenamedOptionModule; + inherit (lib.nvim.types) mkPluginSetupOption; + inherit (lib.types) enum int; + inherit (lib.modules) mkRenamedOptionModule; in { imports = let renamedSetupOption = oldPath: newPath: @@ -18,9 +20,9 @@ in { options.vim.lsp.nvim-docs-view = { enable = mkEnableOption "nvim-docs-view, for displaying lsp hover documentation in a side panel."; - setupOpts = lib.nvim.types.mkPluginSetupOption "nvim-docs-view" { + setupOpts = mkPluginSetupOption "nvim-docs-view" { position = mkOption { - type = types.enum ["left" "right" "top" "bottom"]; + type = enum ["left" "right" "top" "bottom"]; default = "right"; description = '' Where to open the docs view panel @@ -28,7 +30,7 @@ in { }; height = mkOption { - type = types.int; + type = int; default = 10; description = '' Height of the docs view panel if the position is set to either top or bottom @@ -36,7 +38,7 @@ in { }; width = mkOption { - type = types.int; + type = int; default = 60; description = '' Width of the docs view panel if the position is set to either left or right @@ -44,7 +46,7 @@ in { }; update_mode = mkOption { - type = types.enum ["auto" "manual"]; + type = enum ["auto" "manual"]; default = "auto"; description = '' Determines the mechanism used to update the docs view panel content. diff --git a/modules/plugins/notes/obsidian/obsidian.nix b/modules/plugins/notes/obsidian/obsidian.nix index c7152fb..6727430 100644 --- a/modules/plugins/notes/obsidian/obsidian.nix +++ b/modules/plugins/notes/obsidian/obsidian.nix @@ -3,7 +3,10 @@ lib, ... }: let - inherit (lib) mkEnableOption mkOption types mkRenamedOptionModule; + inherit (lib.options) mkEnableOption mkOption; + inherit (lib.types) bool str nullOr; + inherit (lib.modules) mkRenamedOptionModule; + inherit (lib.nvim.types) mkPluginSetupOption; in { imports = let renamedSetupOption = oldPath: newPath: @@ -20,21 +23,21 @@ in { obsidian = { enable = mkEnableOption "complementary neovim plugins for Obsidian editor"; - setupOpts = lib.nvim.types.mkPluginSetupOption "Obsidian.nvim" { + setupOpts = mkPluginSetupOption "Obsidian.nvim" { dir = mkOption { - type = types.str; + type = str; default = "~/my-vault"; description = "Obsidian vault directory"; }; daily_notes = { folder = mkOption { - type = types.nullOr types.str; + type = nullOr str; default = null; description = "Directory in which daily notes should be created"; }; date_format = mkOption { - type = types.nullOr types.str; + type = nullOr str; default = null; description = "Date format used for creating daily notes"; }; @@ -43,7 +46,7 @@ in { completion = { nvim_cmp = mkOption { # if using nvim-cmp, otherwise set to false - type = types.bool; + type = bool; description = "If using nvim-cmp, otherwise set to false"; default = config.vim.autocomplete.type == "nvim-cmp"; }; diff --git a/modules/plugins/notes/todo-comments/config.nix b/modules/plugins/notes/todo-comments/config.nix index 730a14d..cb7d628 100644 --- a/modules/plugins/notes/todo-comments/config.nix +++ b/modules/plugins/notes/todo-comments/config.nix @@ -4,7 +4,7 @@ lib, ... }: let - inherit (lib) mkMerge mkIf; + inherit (lib.modules) mkMerge mkIf; inherit (lib.nvim.binds) mkBinding; inherit (lib.nvim.lua) toLuaObject; diff --git a/modules/plugins/notes/todo-comments/todo-comments.nix b/modules/plugins/notes/todo-comments/todo-comments.nix index 7f7caed..b5bb76f 100644 --- a/modules/plugins/notes/todo-comments/todo-comments.nix +++ b/modules/plugins/notes/todo-comments/todo-comments.nix @@ -3,8 +3,11 @@ lib, ... }: let - inherit (lib) mkEnableOption mkOption types mkRenamedOptionModule; + inherit (lib.modules) mkRenamedOptionModule; + inherit (lib.options) mkOption mkEnableOption; + inherit (lib.types) str listOf; inherit (lib.nvim.binds) mkMappingOption; + inherit (lib.nvim.types) mkPluginSetupOption; in { imports = let renamedSetupOption = oldPath: newPath: @@ -19,10 +22,10 @@ in { options.vim.notes.todo-comments = { enable = mkEnableOption "todo-comments: highlight and search for todo comments like TODO, HACK, BUG in your code base"; - setupOpts = lib.nvim.types.mkPluginSetupOption "todo-comments.nvim" { + setupOpts = mkPluginSetupOption "todo-comments.nvim" { highlight = { pattern = mkOption { - type = types.str; + type = str; default = ''.*<(KEYWORDS)(\([^\)]*\))?:''; description = "vim regex pattern used for highlighting comments"; }; @@ -30,19 +33,19 @@ in { search = { pattern = mkOption { - type = types.str; + type = str; default = ''\b(KEYWORDS)(\([^\)]*\))?:''; description = "ripgrep regex pattern used for searching comments"; }; command = mkOption { - type = types.str; + type = str; default = "${pkgs.ripgrep}/bin/rg"; description = "search command"; }; args = mkOption { - type = types.listOf types.str; + type = listOf str; default = ["--color=never" "--no-heading" "--with-filename" "--line-number" "--column"]; description = "arguments to pass to the search command"; }; diff --git a/modules/plugins/projects/project-nvim/config.nix b/modules/plugins/projects/project-nvim/config.nix index 435476d..0f85968 100644 --- a/modules/plugins/projects/project-nvim/config.nix +++ b/modules/plugins/projects/project-nvim/config.nix @@ -3,7 +3,9 @@ lib, ... }: let - inherit (lib) mkIf nvim; + inherit (lib.modules) mkIf; + inherit (lib.nvim.dag) entryAnywhere; + inherit (lib.nvim.lua) toLuaObject; cfg = config.vim.projects.project-nvim; in { @@ -12,8 +14,8 @@ in { "project-nvim" ]; - vim.luaConfigRC.project-nvim = nvim.dag.entryAnywhere '' - require('project_nvim').setup(${nvim.lua.toLuaObject cfg.setupOpts}) + vim.luaConfigRC.project-nvim = entryAnywhere '' + require('project_nvim').setup(${toLuaObject cfg.setupOpts}) ''; }; } diff --git a/modules/plugins/projects/project-nvim/project-nvim.nix b/modules/plugins/projects/project-nvim/project-nvim.nix index 234e4f0..b9a9eff 100644 --- a/modules/plugins/projects/project-nvim/project-nvim.nix +++ b/modules/plugins/projects/project-nvim/project-nvim.nix @@ -3,7 +3,10 @@ lib, ... }: let - inherit (lib) mkEnableOption mkOption types mkRenamedOptionModule; + inherit (lib.options) mkEnableOption mkOption; + inherit (lib.modules) mkRenamedOptionModule; + inherit (lib.types) bool listOf str enum; + inherit (lib.nvim.types) mkPluginSetupOption; in { imports = let renamedSetupOption = oldPath: newPath: @@ -24,54 +27,54 @@ in { options.vim.projects.project-nvim = { enable = mkEnableOption "project-nvim for project management"; - setupOpts = lib.nvim.types.mkPluginSetupOption "Project.nvim" { + setupOpts = mkPluginSetupOption "Project.nvim" { manual_mode = mkOption { - type = types.bool; + type = bool; default = true; description = "don't automatically change the root directory so the user has the option to manually do so using `:ProjectRoot` command"; }; # detection methods should accept one or more strings from a list detection_methods = mkOption { - type = types.listOf types.str; + type = listOf str; default = ["lsp" "pattern"]; description = "Detection methods to use"; }; # patterns patterns = mkOption { - type = types.listOf types.str; + type = listOf str; default = [".git" "_darcs" ".hg" ".bzr" ".svn" "Makefile" "package.json" "flake.nix" "cargo.toml"]; description = "Patterns to use for pattern detection method"; }; # table of lsp servers to ignore by name lsp_ignored = mkOption { - type = types.listOf types.str; + type = listOf str; default = []; description = "LSP servers no ignore by name"; }; exclude_dirs = mkOption { - type = types.listOf types.str; + type = listOf str; default = []; description = "Directories to exclude from project root search"; }; show_hidden = mkOption { - type = types.bool; + type = bool; default = false; description = "Show hidden files in telescope picker"; }; silent_chdir = mkOption { - type = types.bool; + type = bool; default = true; description = "Silently change directory when changing project"; }; scope_chdir = mkOption { - type = types.enum ["global" "tab" "win"]; + type = enum ["global" "tab" "win"]; default = "global"; description = "What scope to change the directory"; }; diff --git a/modules/plugins/terminal/toggleterm/toggleterm.nix b/modules/plugins/terminal/toggleterm/toggleterm.nix index 865e66f..d6c25c1 100644 --- a/modules/plugins/terminal/toggleterm/toggleterm.nix +++ b/modules/plugins/terminal/toggleterm/toggleterm.nix @@ -6,7 +6,7 @@ inherit (lib.options) mkOption mkEnableOption; inherit (lib.nvim.binds) mkMappingOption; inherit (lib.types) nullOr str enum bool package either int; - inherit (lib) mkRenamedOptionModule; + inherit (lib.modules) mkRenamedOptionModule; inherit (lib.nvim.types) mkPluginSetupOption luaInline; inherit (lib.generators) mkLuaInline; in {