diff options
| -rw-r--r-- | flake.lock | 52 | ||||
| -rw-r--r-- | flake.nix | 6 | ||||
| -rw-r--r-- | hosts/common.nix | 4 | ||||
| -rw-r--r-- | users/seth/programs/neovim/config/plugins/lsp.lua | 21 |
4 files changed, 78 insertions, 5 deletions
@@ -387,6 +387,30 @@ "type": "github" } }, + "nil": { + "inputs": { + "flake-utils": [ + "flake-utils" + ], + "nixpkgs": [ + "nixpkgsUnstable" + ], + "rust-overlay": "rust-overlay_2" + }, + "locked": { + "lastModified": 1683398769, + "narHash": "sha256-9q8kLxA5vHPwRb8SOx/7K9QqLOAl0JbQemRUWC2VDNM=", + "owner": "oxalica", + "repo": "nil", + "rev": "67bfe95a3cc07626fca40b185e627c85d3a555e6", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "nil", + "type": "github" + } + }, "nix-darwin": { "inputs": { "nixpkgs": [ @@ -573,7 +597,7 @@ "nixpkgs": [ "nixpkgsUnstable" ], - "rust-overlay": "rust-overlay_2" + "rust-overlay": "rust-overlay_3" }, "locked": { "lastModified": 1682237245, @@ -600,6 +624,7 @@ "hercules-ci-effects": "hercules-ci-effects", "home-manager": "home-manager", "lanzaboote": "lanzaboote", + "nil": "nil", "nixinate": "nixinate", "nixos-hardware": "nixos-hardware", "nixos-wsl": "nixos-wsl", @@ -639,6 +664,31 @@ "rust-overlay_2": { "inputs": { "flake-utils": [ + "nil", + "flake-utils" + ], + "nixpkgs": [ + "nil", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1682907601, + "narHash": "sha256-FfUAYvRJ+6s9WWjXNPdRzuuvAeu2VHIXIbUkPJr4t14=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "5eaff055dd57128c53ae373dc96af944f5849daa", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "rust-overlay_3": { + "inputs": { + "flake-utils": [ "ragenix", "flake-utils" ], @@ -63,6 +63,12 @@ inputs.flake-parts.follows = "flake-parts"; inputs.pre-commit-hooks-nix.follows = "pre-commit-hooks"; }; + # TODO: remove this when nil is updated in nixpkgs-unstable + nil = { + url = "github:oxalica/nil"; + inputs.nixpkgs.follows = "nixpkgsUnstable"; + inputs.flake-utils.follows = "flake-utils"; + }; nixinate = { url = "github:MatthewCroughan/nixinate"; inputs.nixpkgs.follows = "nixpkgsUnstable"; diff --git a/hosts/common.nix b/hosts/common.nix index df9e6f0..3e2a7ca 100644 --- a/hosts/common.nix +++ b/hosts/common.nix @@ -2,7 +2,7 @@ inputs, self, }: let - inherit (inputs) getchoo home-manager nixpkgs nixpkgsUnstable nur ragenix; + inherit (inputs) getchoo home-manager nil nixpkgs nixpkgsUnstable nur ragenix; in { personal = { system = "x86_64-linux"; @@ -30,7 +30,7 @@ in { }; nixpkgs = { - overlays = [nur.overlay getchoo.overlays.default]; + overlays = [nil.overlays.nil nur.overlay getchoo.overlays.default]; config.allowUnfree = true; }; diff --git a/users/seth/programs/neovim/config/plugins/lsp.lua b/users/seth/programs/neovim/config/plugins/lsp.lua index 0ed0044..ded1504 100644 --- a/users/seth/programs/neovim/config/plugins/lsp.lua +++ b/users/seth/programs/neovim/config/plugins/lsp.lua @@ -48,7 +48,6 @@ local sources = { lsp_servers = { "bashls", "clangd", - "nil_ls", "pyright", "rust_analyzer", "tsserver", @@ -78,7 +77,11 @@ local sources = { } --- lsp config -local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()) +local capabilities = vim.tbl_deep_extend( + "force", + require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()), + { workspace = { didChangeWatchedFiles = { dynamicRegistration = true } } } +) local all_config = { capabilities = capabilities, @@ -106,6 +109,20 @@ servers["lua_ls"] = { }, } +servers["nil_ls"] = { + capabilities = capabilities, + settings = { + ["nil"] = { + nix = { + flake = { + autoArchive = nil, + autoEvalInputs = false, + }, + }, + }, + }, +} + for server, settings in pairs(servers) do require("lspconfig")[server].setup(settings) end |
