From 701693bfc85d33940f37ada195de5217dae97d51 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 6 Aug 2023 02:00:48 +0300 Subject: [PATCH] add nixd instead of nil-ls --- .../lua/core/plugin_config/lsp_config.lua | 2 +- hosts/sakotop/configuration.nix | 1 + modules/dev/default.nix | 1 + modules/dev/nixd.nix | 19 +++++++++++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 modules/dev/nixd.nix diff --git a/config/nvim/lua/core/plugin_config/lsp_config.lua b/config/nvim/lua/core/plugin_config/lsp_config.lua index 04c17406..7ce57453 100644 --- a/config/nvim/lua/core/plugin_config/lsp_config.lua +++ b/config/nvim/lua/core/plugin_config/lsp_config.lua @@ -30,7 +30,7 @@ local capabilities = require("cmp_nvim_lsp").default_capabilities() mason_null_ls.setup() -- funny lsp config stuff -require('lspconfig').nil_ls.setup({ +require('lspconfig').nixd.setup({ on_attach = on_attach, capabilities = capabilities, }) diff --git a/hosts/sakotop/configuration.nix b/hosts/sakotop/configuration.nix index 1ac96a30..5f399149 100644 --- a/hosts/sakotop/configuration.nix +++ b/hosts/sakotop/configuration.nix @@ -57,6 +57,7 @@ editors = { nvim.enable = true; vscode.enable = true; + nixd.enable = true; }; cc.enable = true; javascript.enable = true; diff --git a/modules/dev/default.nix b/modules/dev/default.nix index e4ea4546..b400938c 100644 --- a/modules/dev/default.nix +++ b/modules/dev/default.nix @@ -6,5 +6,6 @@ ./python.nix ./rust.nix ./unityhub.nix + ./nixd.nix ]; } diff --git a/modules/dev/nixd.nix b/modules/dev/nixd.nix new file mode 100644 index 00000000..88dcdf24 --- /dev/null +++ b/modules/dev/nixd.nix @@ -0,0 +1,19 @@ +# nixd nix lsp using nix and nixpkgs +# where has this been my whole life +{ outputs, options, config, lib, pkgs, ...}: +with lib; +let + cfg = config.modules.dev.nixd; +in +{ + options.modules.dev.nixd = { + enable = mkEnableOption false; + }; + + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + nixd + nixpkgs-fmt + ]; + }; +}