From 9eae3e015aa5a90daa6880c2a7701900d21032a7 Mon Sep 17 00:00:00 2001 From: "Izel Nakri | izelnakri.eth" Date: Thu, 6 Jun 2024 00:44:43 +0300 Subject: [PATCH] feat(lang): add nix language support (#2956) In the future we can add: - dap / debugger support, if this is ever possible or needed. - extend neotest, if this is ever needed, for most people I suspect not needed. - linting, if this is ever needed. - ~~maybe enhance nvim-cmp behavior with nixpkgs, rust lang extension crates.nvim does smt with nvim-cmp, other language extensions don't.~~ I think its already good to merge this PR, we can add these enhancements later, if they are ever needed. --------- Co-authored-by: Folke Lemaitre --- lua/lazyvim/plugins/extras/lang/nix.lua | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/lang/nix.lua diff --git a/lua/lazyvim/plugins/extras/lang/nix.lua b/lua/lazyvim/plugins/extras/lang/nix.lua new file mode 100644 index 00000000..b349bb2c --- /dev/null +++ b/lua/lazyvim/plugins/extras/lang/nix.lua @@ -0,0 +1,30 @@ +return { + recommended = { + ft = "nix", + root = "flake.nix", + }, + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + opts.ensure_installed = opts.ensure_installed or {} + vim.list_extend(opts.ensure_installed, { "nix" }) + end, + }, + { + "neovim/nvim-lspconfig", + opts = { + servers = { + nil_ls = {}, + }, + }, + }, + { + "stevearc/conform.nvim", + optional = true, + opts = { + formatters_by_ft = { + nix = { "nixfmt" }, + }, + }, + }, +}