fix: move nixd config to nvim.nix

This commit is contained in:
DACHXY 2025-01-23 13:32:43 +08:00
parent 5d6f5671a6
commit d5fcc2cf5f
5 changed files with 51 additions and 36 deletions

View file

@ -1,6 +1,8 @@
{
lib,
pkgs,
device-name,
username,
...
}:
{
@ -244,6 +246,42 @@
end
},
-- Nix
{
"neovim/nvim-lspconfig",
opts = {
servers = {
nixd = {
cmd = { "nixd" },
filetypes = { "nix" },
single_file_support = true,
root_dir = function(fname)
return require("lspconfig.util").root_pattern("flake.nix")(fname)
or vim.fs.dirname(vim.fs.find(".git", { path = fname, upward = true })[1])
end,
settings = {
nixd = {
nixpkgs = {
expr = "import <nixpkgs> { }",
},
formatting = {
command = { "nixfmt" },
},
-- options = {
-- nixos = {
-- expr = '(builtins.getFlake ("git+file://" + toString ./.)).nixosConfigurations.${device-name}.options',
-- },
-- home_manager = {
-- expr = '(builtins.getFlake ("git+file://" + toString ./.)).homeConfigurations."${username}@${device-name}".options',
-- }
-- }
}
}
}
}
}
},
-- disable DAP
{ "mfussenegger/nvim-dap-python", enabled = false },
{ "mfussenegger/nvim-dap", enabled = false },