From 132c3da8ece1f2518992257985a612690b2eeb90 Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Thu, 6 Feb 2025 13:08:31 +0100 Subject: [PATCH 1/5] languages/nix: add nixd This adds the [nixd](https://github.com/nix-community/nixd) language server. --- docs/release-notes/rl-0.8.md | 4 ++++ modules/plugins/languages/nix.nix | 34 +++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 661aee1d..3a09171b 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -139,3 +139,7 @@ - Add `vim.languages.zig.dap` support through pkgs.lldb dap adapter. Code Inspiration from `vim.languages.clang.dap` implementation. + +[nezia1](https://github.com/nezia1) + +- Add support for [nixd](https://github.com/nix-community/nixd) language server. diff --git a/modules/plugins/languages/nix.nix b/modules/plugins/languages/nix.nix index 4056a415..d6ca6d32 100644 --- a/modules/plugins/languages/nix.nix +++ b/modules/plugins/languages/nix.nix @@ -59,6 +59,40 @@ } ''; }; + + nixd = { + package = pkgs.nixd; + internalFormatter = true; + lspConfig = '' + lspconfig.nixd.setup{ + capabilities = capabilities, + ${ + if cfg.format.enable + then useFormat + else noFormat + }, + cmd = ${packageToCmd cfg.lsp.package "nixd"}, + ${optionalString cfg.format.enable '' + settings = { + nixd = { + ${optionalString (cfg.format.type == "alejandra") + '' + formatting = { + command = {"${cfg.format.package}/bin/alejandra", "--quiet"}, + }, + ''} + ${optionalString (cfg.format.type == "nixfmt") + '' + formatting = { + command = {"${cfg.format.package}/bin/nixfmt"}, + }, + ''} + }, + }, + ''} + } + ''; + }; }; defaultFormat = "alejandra"; From 75b402e9f03ebf0ad83dd72f3825a700de956ede Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Fri, 7 Feb 2025 15:49:24 +0300 Subject: [PATCH 2/5] neovim/init: deprecate `vim.disableArrows`; add missing rename --- modules/extra/deprecations.nix | 12 +++++++++++- modules/neovim/init/basic.nix | 6 ------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/modules/extra/deprecations.nix b/modules/extra/deprecations.nix index 8d27d7ac..541d2894 100644 --- a/modules/extra/deprecations.nix +++ b/modules/extra/deprecations.nix @@ -4,6 +4,7 @@ inherit (lib.nvim.config) batchRenameOptions; renamedVimOpts = batchRenameOptions ["vim"] ["vim" "options"] { + # 2024-12-01 colourTerm = "termguicolors"; mouseSupport = "mouse"; cmdHeight = "cmdheight"; @@ -15,6 +16,9 @@ autoIndent = "autoindent"; wordWrap = "wrap"; showSignColumn = "signcolumn"; + + # 2025-02-07 + scrollOf = "scrolloff"; }; in { imports = concatLists [ @@ -93,9 +97,15 @@ in { # 2024-12-02 (mkRenamedOptionModule ["vim" "enableEditorconfig"] ["vim" "globals" "editorconfig"]) + + # 2025-02-06 + (mkRemovedOptionModule ["vim" "disableArrows"] '' + Top-level convenience options are now in the process of being removed from nvf as + their behaviour was abstract, and confusing. Please use 'vim.options' or 'vim.luaConfigRC' + to replicate previous behaviour. + '') ] - # 2024-12-01 # Migrated via batchRenameOptions. Further batch renames must be below this line. renamedVimOpts ]; diff --git a/modules/neovim/init/basic.nix b/modules/neovim/init/basic.nix index b4677de9..47bfe500 100644 --- a/modules/neovim/init/basic.nix +++ b/modules/neovim/init/basic.nix @@ -16,12 +16,6 @@ cfg = config.vim; in { options.vim = { - disableArrows = mkOption { - type = bool; - default = false; - description = "Set to prevent arrow keys from moving cursor"; - }; - hideSearchHighlight = mkOption { type = bool; default = false; From e5ced28b67492838c6756534b9ca4a99a56cc350 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Fri, 7 Feb 2025 16:02:50 +0300 Subject: [PATCH 3/5] ci: remove magic-nix-cache --- .github/workflows/cachix.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/cachix.yml b/.github/workflows/cachix.yml index 4aa0b215..cac8ee51 100644 --- a/.github/workflows/cachix.yml +++ b/.github/workflows/cachix.yml @@ -35,7 +35,6 @@ jobs: - name: Install Nix uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/magic-nix-cache-action@main - uses: cachix/cachix-action@v15 with: From 3f9078d7d94d7f163d165af327f2676a8217af1e Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Fri, 7 Feb 2025 17:00:45 +0300 Subject: [PATCH 4/5] neovim/mappings: remove remnants of `vim.disableArrows` --- modules/neovim/mappings/config.nix | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/modules/neovim/mappings/config.nix b/modules/neovim/mappings/config.nix index 4d7f2417..230df030 100644 --- a/modules/neovim/mappings/config.nix +++ b/modules/neovim/mappings/config.nix @@ -26,34 +26,6 @@ in { config = { vim.keymaps = mkMerge [ - ( - mkIf cfg.disableArrows [ - { - key = ""; - mode = ["n" "i"]; - action = ""; - noremap = false; - } - { - key = ""; - mode = ["n" "i"]; - action = ""; - noremap = false; - } - { - key = ""; - mode = ["n" "i"]; - action = ""; - noremap = false; - } - { - key = ""; - mode = ["n" "i"]; - action = ""; - noremap = false; - } - ] - ) ( pipe cfg.maps [ From 316d4a0825edde5fa84c0cbd32413f4096aee254 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sat, 8 Feb 2025 10:46:02 +0300 Subject: [PATCH 5/5] modules/extra: fix `scrolOf` typo --- modules/extra/deprecations.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/extra/deprecations.nix b/modules/extra/deprecations.nix index 541d2894..5efe2ae2 100644 --- a/modules/extra/deprecations.nix +++ b/modules/extra/deprecations.nix @@ -18,7 +18,7 @@ showSignColumn = "signcolumn"; # 2025-02-07 - scrollOf = "scrolloff"; + scrollOff = "scrolloff"; }; in { imports = concatLists [