From e49228d642b82d6e840fe9b041c4b05d267d0b58 Mon Sep 17 00:00:00 2001 From: Alfarel Date: Thu, 13 Feb 2025 15:17:13 +0000 Subject: [PATCH 1/7] npins: add conform-nvim, nvim-lint (#634) --- npins/sources.json | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/npins/sources.json b/npins/sources.json index 2bcda9ea..9bd3f725 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -231,6 +231,18 @@ "url": "https://github.com/numToStr/Comment.nvim/archive/e30b7f2008e52442154b66f7c519bfd2f1e32acb.tar.gz", "hash": "0dyz78j0kj3j99y5g8wncl7794g6z2qs05gfg9ddxaa4xswhyjc7" }, + "conform-nvim": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "stevearc", + "repo": "conform.nvim" + }, + "branch": "master", + "revision": "363243c03102a531a8203311d4f2ae704c620d9b", + "url": "https://github.com/stevearc/conform.nvim/archive/363243c03102a531a8203311d4f2ae704c620d9b.tar.gz", + "hash": "1lf7a5b30g37ys9f4z9gq68ymzfzsw7bwzqp1bb91cx9df1bdyck" + }, "copilot-cmp": { "type": "Git", "repository": { @@ -1406,6 +1418,18 @@ "url": "https://github.com/kosayoda/nvim-lightbulb/archive/3ac0791be37ba9cc7939f1ad90ebc5e75abf4eea.tar.gz", "hash": "0qc1rl45ykh9552dx5fmhdg0ncfsk2vpcmj5i7hrmdzgkd2f0avg" }, + "nvim-lint": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "mfussenegger", + "repo": "nvim-lint" + }, + "branch": "master", + "revision": "6e9dd545a1af204c4022a8fcd99727ea41ffdcc8", + "url": "https://github.com/mfussenegger/nvim-lint/archive/6e9dd545a1af204c4022a8fcd99727ea41ffdcc8.tar.gz", + "hash": "0b318dahzf9kd043mjsa41rj44zfbs7k8i4bz0rqhcqipr19rwhk" + }, "nvim-lspconfig": { "type": "Git", "repository": { From a86df770c137a95bfff1648555a498119ed3d076 Mon Sep 17 00:00:00 2001 From: Ben Mayer <90480641+Libadoxon@users.noreply.github.com> Date: Fri, 14 Feb 2025 12:57:21 +0100 Subject: [PATCH 2/7] plugins/git: add git-conflict-nvim (#637) * plugins/git: add git-conflict-nvim; modularize * plugins/git: build git-conflict-nvim ourselves --- docs/release-notes/rl-0.8.md | 4 ++ modules/plugins/git/default.nix | 2 + modules/plugins/git/git-conflict/config.nix | 40 +++++++++++++++++++ modules/plugins/git/git-conflict/default.nix | 6 +++ .../plugins/git/git-conflict/git-conflict.nix | 23 +++++++++++ npins/sources.json | 14 ++++++- 6 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 modules/plugins/git/git-conflict/config.nix create mode 100644 modules/plugins/git/git-conflict/default.nix create mode 100644 modules/plugins/git/git-conflict/git-conflict.nix diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 5ff8c5f2..c9b4892a 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -162,3 +162,7 @@ [Mr-Helpful](https://github.com/Mr-Helpful) - Corrects pin names used for nvim themes + +[Libadoxon](https://github.com/Libadoxon) + +- Add [git-conflict](https://github.com/akinsho/git-conflict.nvim) plugin for resolving git conflicts diff --git a/modules/plugins/git/default.nix b/modules/plugins/git/default.nix index 525cbcf7..6ed92217 100644 --- a/modules/plugins/git/default.nix +++ b/modules/plugins/git/default.nix @@ -4,6 +4,7 @@ in { imports = [ ./gitsigns ./vim-fugitive + ./git-conflict ]; options.vim.git = { @@ -13,6 +14,7 @@ in { Enabling this option will enable the following plugins: * gitsigns * vim-fugitive + * git-conflict ''; }; } diff --git a/modules/plugins/git/git-conflict/config.nix b/modules/plugins/git/git-conflict/config.nix new file mode 100644 index 00000000..bc9905d6 --- /dev/null +++ b/modules/plugins/git/git-conflict/config.nix @@ -0,0 +1,40 @@ +{ + config, + lib, + ... +}: let + inherit (lib.modules) mkIf mkMerge; + inherit (lib.nvim.binds) addDescriptionsToMappings mkSetBinding; + inherit (lib.nvim.dag) entryAnywhere; + inherit (lib.nvim.lua) toLuaObject; + + cfg = config.vim.git.git-conflict; + + self = import ./git-conflict.nix {inherit lib config;}; + gcMappingDefinitions = self.options.vim.git.git-conflict.mappings; + + gcMappings = addDescriptionsToMappings cfg.mappings gcMappingDefinitions; +in { + config = mkIf cfg.enable (mkMerge [ + { + vim = { + startPlugins = ["git-conflict-nvim"]; + + maps = { + normal = mkMerge [ + (mkSetBinding gcMappings.ours "(git-conflict-ours)") + (mkSetBinding gcMappings.theirs "(git-conflict-theirs)") + (mkSetBinding gcMappings.both "(git-conflict-both)") + (mkSetBinding gcMappings.none "(git-conflict-none)") + (mkSetBinding gcMappings.prevConflict "(git-conflict-prev-conflict)") + (mkSetBinding gcMappings.nextConflict "(git-conflict-next-conflict)") + ]; + }; + + pluginRC.git-conflict = entryAnywhere '' + require('git-conflict').setup(${toLuaObject ({default_mappings = false;} // cfg.setupOpts)}) + ''; + }; + } + ]); +} diff --git a/modules/plugins/git/git-conflict/default.nix b/modules/plugins/git/git-conflict/default.nix new file mode 100644 index 00000000..89093a72 --- /dev/null +++ b/modules/plugins/git/git-conflict/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./config.nix + ./git-conflict.nix + ]; +} diff --git a/modules/plugins/git/git-conflict/git-conflict.nix b/modules/plugins/git/git-conflict/git-conflict.nix new file mode 100644 index 00000000..bffb926c --- /dev/null +++ b/modules/plugins/git/git-conflict/git-conflict.nix @@ -0,0 +1,23 @@ +{ + config, + lib, + ... +}: let + inherit (lib.options) mkEnableOption; + inherit (lib.nvim.binds) mkMappingOption; + inherit (lib.nvim.types) mkPluginSetupOption; +in { + options.vim.git.git-conflict = { + enable = mkEnableOption "git-conflict" // {default = config.vim.git.enable;}; + setupOpts = mkPluginSetupOption "git-conflict" {}; + + mappings = { + ours = mkMappingOption "Choose Ours [Git-Conflict]" "co"; + theirs = mkMappingOption "Choose Theirs [Git-Conflict]" "ct"; + both = mkMappingOption "Choose Both [Git-Conflict]" "cb"; + none = mkMappingOption "Choose None [Git-Conflict]" "c0"; + prevConflict = mkMappingOption "Go to the previous Conflict [Git-Conflict]" "]x"; + nextConflict = mkMappingOption "Go to the next Conflict [Git-Conflict]" "[x"; + }; + }; +} diff --git a/npins/sources.json b/npins/sources.json index 9bd3f725..82eb60d4 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -423,6 +423,18 @@ "url": "https://github.com/notomo/gesture.nvim/archive/dbd839bda337cb73911aeef06897eb29cb99f76f.tar.gz", "hash": "1cqiahc52xh113l8lgpz3k852vvqkv2srj9shdkyya76a2v2sf9d" }, + "git-conflict-nvim": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "akinsho", + "repo": "git-conflict.nvim" + }, + "branch": "main", + "revision": "a1badcd070d176172940eb55d9d59029dad1c5a6", + "url": "https://github.com/akinsho/git-conflict.nvim/archive/a1badcd070d176172940eb55d9d59029dad1c5a6.tar.gz", + "hash": "05rnwhm1fmg3yb7j2xc9nmw262jc687qxhwabn97qarrk2da0r0a" + }, "gitsigns-nvim": { "type": "Git", "repository": { @@ -2044,4 +2056,4 @@ } }, "version": 3 -} +} \ No newline at end of file From 4196be3ac8d374450314f8595f30d0b86accba11 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Fri, 14 Feb 2025 14:59:52 +0300 Subject: [PATCH 3/7] ci: get rid of magic-nix-cache --- .github/workflows/check-docs.yml | 3 +-- .github/workflows/check.yml | 2 -- .github/workflows/docs-preview.yml | 1 - .github/workflows/editorconfig.yml | 1 - .github/workflows/manual.yml | 1 - 5 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/check-docs.yml b/.github/workflows/check-docs.yml index b543c813..4d133ecd 100644 --- a/.github/workflows/check-docs.yml +++ b/.github/workflows/check-docs.yml @@ -21,7 +21,6 @@ jobs: steps: - name: Install Nix uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/magic-nix-cache-action@main - name: Checkout uses: actions/checkout@v4 @@ -42,13 +41,13 @@ jobs: with: name: "${{ matrix.package }}" path: result/share/doc/nvf + flake-docs-linkcheck: name: Validate hyperlinks in documentation sources runs-on: ubuntu-latest steps: - name: Install Nix uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/magic-nix-cache-action@main - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 8101b8b1..7a7677eb 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -19,7 +19,6 @@ jobs: - name: Install Nix uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/magic-nix-cache-action@main - name: Check Flake run: nix flake check @@ -33,6 +32,5 @@ jobs: - name: Install Nix uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/magic-nix-cache-action@main - run: nix run nixpkgs#alejandra -- -c . diff --git a/.github/workflows/docs-preview.yml b/.github/workflows/docs-preview.yml index e6d2e662..f8f45d05 100644 --- a/.github/workflows/docs-preview.yml +++ b/.github/workflows/docs-preview.yml @@ -26,7 +26,6 @@ jobs: steps: - name: Install Nix uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/magic-nix-cache-action@main - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/editorconfig.yml b/.github/workflows/editorconfig.yml index d411c89f..3d8ca360 100644 --- a/.github/workflows/editorconfig.yml +++ b/.github/workflows/editorconfig.yml @@ -30,7 +30,6 @@ jobs: - name: Install Nix uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/magic-nix-cache-action@main - name: Checking EditorConfig shell: bash diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index 5b66c8a6..1c8ab746 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -45,7 +45,6 @@ jobs: steps: - uses: actions/checkout@v4.1.7 - uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/magic-nix-cache-action@main - run: | nix build .#docs -Lv cp -r result/share/doc/nvf public From 06444754089517680da5cdef6008b920e30c1f30 Mon Sep 17 00:00:00 2001 From: ARCIII <88923299+ArmandoCIII@users.noreply.github.com> Date: Sun, 16 Feb 2025 03:10:32 -0500 Subject: [PATCH 4/7] utility/leetcode-nvim: init (#636) * utility/leetcode-nvim: init * utility/leetcode.nvim: Clean Code Cleaned code upon PR review comments --- configuration.nix | 1 + docs/release-notes/rl-0.8.md | 4 + modules/plugins/utility/default.nix | 1 + .../plugins/utility/leetcode-nvim/config.nix | 26 +++++++ .../plugins/utility/leetcode-nvim/default.nix | 6 ++ .../utility/leetcode-nvim/leetcode-nvim.nix | 74 +++++++++++++++++++ npins/sources.json | 12 +++ 7 files changed, 124 insertions(+) create mode 100644 modules/plugins/utility/leetcode-nvim/config.nix create mode 100644 modules/plugins/utility/leetcode-nvim/default.nix create mode 100644 modules/plugins/utility/leetcode-nvim/leetcode-nvim.nix diff --git a/configuration.nix b/configuration.nix index 15138a2b..c7b0f288 100644 --- a/configuration.nix +++ b/configuration.nix @@ -177,6 +177,7 @@ isMaximal: { surround.enable = isMaximal; diffview-nvim.enable = true; yanky-nvim.enable = false; + leetcode-nvim.enable = isMaximal; motion = { hop.enable = true; leap.enable = true; diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index c9b4892a..621e976f 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -143,8 +143,12 @@ [ARCIII](https://github.com/ArmandoCIII): +[leetcode.nvim]: https://github.com/kawre/leetcode.nvim + - Add `vim.languages.zig.dap` support through pkgs.lldb dap adapter. Code Inspiration from `vim.languages.clang.dap` implementation. +- Add [leetcode.nvim] plugin under `vim.utility.leetcode-nvim`. + [nezia1](https://github.com/nezia1) diff --git a/modules/plugins/utility/default.nix b/modules/plugins/utility/default.nix index 65ef8680..372a4f53 100644 --- a/modules/plugins/utility/default.nix +++ b/modules/plugins/utility/default.nix @@ -15,5 +15,6 @@ ./telescope ./wakatime ./yanky-nvim + ./leetcode-nvim ]; } diff --git a/modules/plugins/utility/leetcode-nvim/config.nix b/modules/plugins/utility/leetcode-nvim/config.nix new file mode 100644 index 00000000..be002727 --- /dev/null +++ b/modules/plugins/utility/leetcode-nvim/config.nix @@ -0,0 +1,26 @@ +{ + config, + lib, + ... +}: let + inherit (lib.modules) mkIf; + + cfg = config.vim.utility.leetcode-nvim; +in { + config = mkIf cfg.enable { + vim = { + startPlugins = [ + "leetcode-nvim" + "plenary-nvim" + "fzf-lua" + "nui-nvim" + ]; + + lazy.plugins.leetcode-nvim = { + package = "leetcode-nvim"; + setupModule = "leetcode"; + inherit (cfg) setupOpts; + }; + }; + }; +} diff --git a/modules/plugins/utility/leetcode-nvim/default.nix b/modules/plugins/utility/leetcode-nvim/default.nix new file mode 100644 index 00000000..4dffd9f8 --- /dev/null +++ b/modules/plugins/utility/leetcode-nvim/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./leetcode-nvim.nix + ./config.nix + ]; +} diff --git a/modules/plugins/utility/leetcode-nvim/leetcode-nvim.nix b/modules/plugins/utility/leetcode-nvim/leetcode-nvim.nix new file mode 100644 index 00000000..f71da02a --- /dev/null +++ b/modules/plugins/utility/leetcode-nvim/leetcode-nvim.nix @@ -0,0 +1,74 @@ +{lib, ...}: let + inherit (lib.options) mkOption mkEnableOption; + inherit (lib.types) enum str bool; + inherit (lib.generators) mkLuaInline; + inherit (lib.nvim.types) mkPluginSetupOption luaInline; +in { + options.vim.utility = { + leetcode-nvim = { + enable = mkEnableOption "complementary neovim plugin for leetcode.nvim"; + + setupOpts = mkPluginSetupOption "leetcode-nvim" { + logging = mkEnableOption "logging for leetcode.nvim status notifications." // {default = true;}; + image_support = mkEnableOption "question description images using image.nvim (image-nvim must be enabled)."; + + lang = mkOption { + type = enum [ + "cpp" + "java" + "python" + "python3" + "c" + "csharp" + "javascript" + "typescript" + "php" + "swift" + "kotlin" + "dart" + "golang" + "ruby" + "scala" + "rust" + "racket" + "erlang" + "elixir" + "bash" + ]; + default = "python3"; + description = "Language to start your session with"; + }; + + arg = mkOption { + type = str; + default = "leetcode.nvim"; + description = "Argument for Neovim"; + }; + + cn = { + enabled = mkEnableOption "leetcode.cn instead of leetcode.com"; + translator = mkEnableOption "translator" // {default = true;}; + translate_problems = mkEnableOption "translation for problem questions" // {default = true;}; + }; + + storage = { + home = mkOption { + type = luaInline; + default = mkLuaInline "vim.fn.stdpath(\"data\") .. \"/leetcode\""; + description = "Home storage directory"; + }; + + cache = mkOption { + type = luaInline; + default = mkLuaInline "vim.fn.stdpath(\"cache\") .. \"/leetcode\""; + description = "Cache storage directory"; + }; + }; + + plugins = { + non_standalone = mkEnableOption "leetcode.nvim in a non-standalone mode"; + }; + }; + }; + }; +} diff --git a/npins/sources.json b/npins/sources.json index 82eb60d4..d6fb562f 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -567,6 +567,18 @@ "url": "https://github.com/ggandor/leap.nvim/archive/c6bfb191f1161fbabace1f36f578a20ac6c7642c.tar.gz", "hash": "1dmy45czi3irjd5qb74yamjam4d1lvqsgfxgh4vaj740b19gyl1w" }, + "leetcode-nvim": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "kawre", + "repo": "leetcode.nvim" + }, + "branch": "master", + "revision": "db7e1cd6b9191b34b4c1f2f96e4e3949cde9f951", + "url": "https://github.com/kawre/leetcode.nvim/archive/db7e1cd6b9191b34b4c1f2f96e4e3949cde9f951.tar.gz", + "hash": "1d3lb7625b2qdzqm74mzrac66rxqc0qgjd3mb37l4v8wqyiyv6pp" + }, "lsp-lines": { "type": "Git", "repository": { From 72ae20dc3dd2a7d78a8cdc2e24cc4c3ac178f104 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Sun, 16 Feb 2025 12:35:13 +0100 Subject: [PATCH 5/7] blink: fix missing inputs.self in HM and NixOS modules (#644) * home-manager: fix missing inputs.self some options in nvf module uses inputs.self but it's not exposed in the inputs we pass to home-manager module: example flake.nix: ``` { inputs = { /* ... */ }; outputs = {nixpkgs, ...}@inputs: { testing = { a = inputs.self # valid b = inputs.self.inputs # valid c = inputs.self.inputs.self # does not exist # prior to this change, inputs.self.inputs was passed to the hm # module, which lacks the self attr # # This change passes in the "top-level" inputs instead. }; }; } ``` * nixos: fix missing inputs.self see previous commit for details --- flake.nix | 4 ++-- flake/modules/home-manager.nix | 6 +++--- flake/modules/nixos.nix | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/flake.nix b/flake.nix index acef6382..30b71f80 100644 --- a/flake.nix +++ b/flake.nix @@ -33,7 +33,7 @@ }; homeManagerModules = { - nvf = import ./flake/modules/home-manager.nix {inherit lib self;}; + nvf = import ./flake/modules/home-manager.nix {inherit lib inputs;}; default = self.homeManagerModules.nvf; neovim-flake = lib.warn '' @@ -44,7 +44,7 @@ }; nixosModules = { - nvf = import ./flake/modules/nixos.nix {inherit lib self;}; + nvf = import ./flake/modules/nixos.nix {inherit lib inputs;}; default = self.nixosModules.nvf; neovim-flake = lib.warn '' diff --git a/flake/modules/home-manager.nix b/flake/modules/home-manager.nix index 715f7537..3b75e49a 100644 --- a/flake/modules/home-manager.nix +++ b/flake/modules/home-manager.nix @@ -1,13 +1,13 @@ # Home Manager module { - self, + inputs, lib, }: { config, pkgs, ... }: let - inherit (self) packages inputs; + inherit (inputs.self) packages; inherit (lib) maintainers; inherit (lib.modules) mkIf mkAliasOptionModule; inherit (lib.lists) optional; @@ -19,7 +19,7 @@ nvfModule = submoduleWith { description = "Nvf module"; class = "nvf"; - specialArgs = { + specialArgs = lib.trace (builtins.attrNames inputs) { inherit pkgs lib inputs; }; modules = import ../../modules/modules.nix {inherit pkgs lib;}; diff --git a/flake/modules/nixos.nix b/flake/modules/nixos.nix index ecc173a1..8f95a12a 100644 --- a/flake/modules/nixos.nix +++ b/flake/modules/nixos.nix @@ -1,13 +1,13 @@ # NixOS module { - self, + inputs, lib, }: { config, pkgs, ... }: let - inherit (self) inputs packages; + inherit (inputs.self) packages; inherit (lib) maintainers; inherit (lib.modules) mkIf mkOverride mkAliasOptionModule; inherit (lib.lists) optional; From 14ca70e490e34f6e45fcfaf0510493cc042a750a Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Sun, 16 Feb 2025 13:13:35 +0100 Subject: [PATCH 6/7] home-manager: forgot to remove trace --- flake/modules/home-manager.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake/modules/home-manager.nix b/flake/modules/home-manager.nix index 3b75e49a..f305558b 100644 --- a/flake/modules/home-manager.nix +++ b/flake/modules/home-manager.nix @@ -19,7 +19,7 @@ nvfModule = submoduleWith { description = "Nvf module"; class = "nvf"; - specialArgs = lib.trace (builtins.attrNames inputs) { + specialArgs = { inherit pkgs lib inputs; }; modules = import ../../modules/modules.nix {inherit pkgs lib;}; From e42bcbe1ecb3392ecd8a7638edf991b9628f4d55 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 17 Feb 2025 03:17:48 +0300 Subject: [PATCH 7/7] lsp/lspsaga: fix npins name incompat --- modules/plugins/lsp/lspsaga/config.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/plugins/lsp/lspsaga/config.nix b/modules/plugins/lsp/lspsaga/config.nix index 66050877..3af6b7f1 100644 --- a/modules/plugins/lsp/lspsaga/config.nix +++ b/modules/plugins/lsp/lspsaga/config.nix @@ -16,7 +16,7 @@ in { config = mkIf (cfg.enable && cfg.lspsaga.enable) { vim = { - startPlugins = ["lspsaga"]; + startPlugins = ["lspsaga-nvim"]; maps = { visual = mkSetLuaBinding mappings.codeAction "require('lspsaga.codeaction').range_code_action";