diff --git a/home-manager/home.nix b/home-manager/home.nix index 7bcef43..789f6bf 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -32,6 +32,7 @@ overlays.additions overlays.modifications overlays.unstable-packages + overlays.textobject-fix # overlays.ltrace-fix # overlays.fish-fix diff --git a/home-manager/nvim/lua/plugins/override.lua b/home-manager/nvim/lua/plugins/override.lua index e0c9579..b694df4 100644 --- a/home-manager/nvim/lua/plugins/override.lua +++ b/home-manager/nvim/lua/plugins/override.lua @@ -34,12 +34,44 @@ return { config = true, -- use opts = {} for passing setup options -- this is equivalent to setup({}) function + { + "neovim/nvim-lspconfig", + opts = { + servers = { + nixd = { + settings = { + nixd = { + eval = { + depth = 10, + }, + formatting = { + command = { "alejandra" }, + }, + nixpkgs = { + expr = "import { }", + }, + cmd = { "nixd", "--semantic-tokens=true" }, + options = { + nixos = { + expr = '(builtins.getFlake ("git+file://" + toString ./../..)).nixosConfigurations.sachiel.options', + }, + home_manager = { + expr = '(builtins.getFlake ("git+file://" + toString ./.)).homeConfigurations."${(builtins.getFlake ("git+file://" + toString ./.)).inputs.nix-secrets.username}".options', + }, + }, + }, + }, + }, + }, + }, + }, }, { - "neovim/nvim-lspconfig", + "mfussenegger/nvim-lint", + optional = true, opts = { - servers = { - nixd = {}, + linters_by_ft = { + nix = { "statix" }, }, }, }, diff --git a/home-manager/nvim/nvim.nix b/home-manager/nvim/nvim.nix index 39711e4..b32c75d 100644 --- a/home-manager/nvim/nvim.nix +++ b/home-manager/nvim/nvim.nix @@ -43,14 +43,22 @@ nixd prettierd pyright - (pkgs.python3.withPackages (p: [p.debugpy p.flake8])) + (pkgs.python3.withPackages (p: [ + p.debugpy + p.flake8 + ])) ripgrep ruff (rust-bin.stable.latest.default.override { - extensions = ["rust-analyzer" "rustfmt" "rust-src"]; + extensions = [ + "rust-analyzer" + "rustfmt" + "rust-src" + ]; }) shellcheck shfmt + statix stylua tailwindcss-language-server taplo @@ -165,8 +173,7 @@ path = drv; } else drv; - lazyPath = - pkgs.linkFarm "lazy-plugins" (builtins.map mkEntryFromDrv plugins); + lazyPath = pkgs.linkFarm "lazy-plugins" (map mkEntryFromDrv plugins); in '' vim.g.lazyvim_check_order = false require("lazy").setup({ @@ -204,7 +211,6 @@ { import = "lazyvim.plugins.extras.lang.git" }, { import = "lazyvim.plugins.extras.lang.haskell" }, { import = "lazyvim.plugins.extras.lang.json" }, - -- { import = "lazyvim.plugins.extras.lang.nix" }, { import = "lazyvim.plugins.extras.lang.python" }, { import = "lazyvim.plugins.extras.lang.rust" }, -- { import = "lazyvim.plugins.extras.lang.terraform" }, @@ -213,7 +219,6 @@ { import = "lazyvim.plugins.extras.lang.yaml" }, { import = "lazyvim.plugins.extras.test.core" }, { import = "lazyvim.plugins.extras.util.dot" }, - -- treesitter handled by my.neovim.treesitterParsers, put this line at the end of spec to clear ensure_installed { "nvim-treesitter/nvim-treesitter", opts = function(_, opts) opts.ensure_installed = {} end }, }, defaults = { @@ -253,54 +258,7 @@ xdg.configFile."nvim/parser".source = let parsers = pkgs.symlinkJoin { name = "treesitter-parsers"; - paths = - (pkgs.vimPlugins.nvim-treesitter.withPlugins (plugins: - with plugins; [ - bash - bibtex - c - cmake - cpp - diff - dockerfile - fish - git_config - git_rebase - gitattributes - gitcommit - gitignore - haskell - hcl - html - hyprlang - javascript - jsdoc - json - json5 - jsonc - lua - luadoc - luap - markdown - markdown_inline - ninja - nix - printf - python - query - regex - ron - rst - rust - terraform - toml - tsx - typescript - vim - vimdoc - xml - yaml - ])).dependencies; + paths = pkgs.vimPlugins.nvim-treesitter.withAllGrammars.dependencies; }; in "${parsers}/parser"; diff --git a/overlays/default.nix b/overlays/default.nix index 2a5418a..044cb71 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -39,4 +39,22 @@ } ); }; + textobject-fix = final: prev: { + vimPlugins = + prev.vimPlugins + // { + nvim-treesitter-textobjects = prev.vimUtils.buildVimPlugin { + pname = "nvim-treesitter-textobjects"; + version = "0-unstable-2025-12-27"; + src = prev.fetchFromGitHub { + owner = "nvim-treesitter"; + repo = "nvim-treesitter-textobjects"; + rev = "ecd03f5811eb5c66d2fa420b79121b866feecd82"; + hash = "sha256-mMxCAkrGqTstEgaf/vwQMEF7D8swH3oyUJtaxuXzpcs="; + }; + meta.homepage = "https://github.com/nvim-treesitter/nvim-treesitter-textobjects/"; + meta.hydraPlatforms = []; + }; + }; + }; }