diff --git a/lua/plugins/completion/conform.lua b/lua/plugins/completion/conform.lua index 95b1b2c..5734c18 100644 --- a/lua/plugins/completion/conform.lua +++ b/lua/plugins/completion/conform.lua @@ -12,7 +12,7 @@ require("conform").setup({ html = { "prettier" }, svelte = { "prettier" }, python = { "black" }, - nix = { "nixfmt" }, + nix = { "alejandra" }, css = { "prettier" }, rust = { "rustfmt" }, }, diff --git a/lua/plugins/completion/lspconfig.lua b/lua/plugins/completion/lspconfig.lua index 4ebff05..a69a117 100644 --- a/lua/plugins/completion/lspconfig.lua +++ b/lua/plugins/completion/lspconfig.lua @@ -4,6 +4,32 @@ vim.pack.add({ { src = "https://github.com/saghen/blink.lib", name = "blink-lib" }, }) +local hostname = vim.uv.os_gethostname() +local lowerHostname = string.lower(hostname) + +vim.lsp.config("nixd", { + cmd = { "nixd" }, + filetypes = { "nix" }, + root_markers = { "flake.nix", ".git" }, + settings = { + nixd = { + nixpkgs = { + expr = "import { }", + }, + formatting = { + command = { "alejandra" }, + }, + options = { + nixos = { + expr = '(builtins.getFlake "~/.dotfiles/.nixos").nixosConfigurations.' + .. lowerHostname + .. ".options", + }, + }, + }, + }, +}) + vim.lsp.config("lua_ls", { settings = { Lua = { @@ -43,6 +69,7 @@ require("blink.cmp").setup({ trigger = { show_on_insert = true, show_on_trigger_character = true, + show_on_keyword = true, show_on_backspace = true, }, list = {