Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nix pack updates to nixfmt and nixd #883

Open
luxus opened this issue Apr 14, 2024 · 2 comments · Fixed by #1093
Open

nix pack updates to nixfmt and nixd #883

luxus opened this issue Apr 14, 2024 · 2 comments · Fixed by #1093
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@luxus
Copy link
Member

luxus commented Apr 14, 2024

Is your feature related to a problem?

No response

Describe the new feature

nix pack could some updates
https://github.com/nix-community/nixd looks like the newest and fastest lsp right now.
but it's unstable because of a major rewrite?
i changed it locally via https://github.com/nix-community/nixd/blob/main/nixd/docs/editor-setup.md
alejandra should be replaced by nixfmt if it makes into 2405 release. (waiting for NixOS/nixfmt#153)
it works on unstable with nixpkgs.nixfmt-rfc-style

both is bleeding edge
thats my code right now.

return {
  {
    "nvim-treesitter/nvim-treesitter",
    optional = true,
    opts = function(_, opts)
      if opts.ensure_installed ~= "all" then
        opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "nix" })
      end
    end,
  },
  {
    "AstroNvim/astrolsp",
    -- we must use the function override because table merging
    -- does not play nicely with list-like tables
    ---@param opts AstroLSPOpts
    opts = function(plugin, opts)
      -- safely extend the servers list
      opts.servers = opts.servers or {}
      vim.list_extend(opts.servers, {
        "nixd",
        -- add more servers as needed...
      })
    end,
  },
  {
    "nvimtools/none-ls.nvim",
    optional = true,
    opts = function(_, opts)
      local nls = require "null-ls"
      if type(opts.sources) == "table" then
        vim.list_extend(opts.sources, {
          nls.builtins.code_actions.statix,
          nls.builtins.formatting.nixfmt,
          nls.builtins.diagnostics.deadnix,
        })
      end
    end,
  },
  {
    "stevearc/conform.nvim",
    optional = true,
    opts = {
      formatters_by_ft = {
        nix = { "nixfmt" },
      },
    },
  },
  -- {
  --   "mfussenegger/nvim-lint",
  --   optional = true,
  --   opts = {
  --     linters_by_ft = {
  --       nix = { "statix", "nix" },
  --     },
  --   },
  -- },
}

and i guess it makes sense to add deadnix to nvim-lint too
https://github.com/bondzula/nvim/blob/7a58fd58857a9a121df9703d4ad132b9bb583e56/lua/plugins/nvim-lint.lua#L9-L41

Additional context

No response

@luxus luxus added the enhancement New feature or request label Apr 14, 2024
@mehalter mehalter added the good first issue Good for newcomers label Apr 18, 2024
@Uzaaft
Copy link
Member

Uzaaft commented May 31, 2024

@luxus Feel free to add nixd now that version 2 is released.

@Uzaaft
Copy link
Member

Uzaaft commented Jul 8, 2024

Still missing nixfmt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants