From 7cccad268087cfe5ffc2ff2767237519eba848f5 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 6 Aug 2023 10:55:44 +0300 Subject: [PATCH] i see why nixd is in unstable --- .../nvim/lua/core/plugin_config/lsp_config.lua | 10 +++++++++- hosts/sakotop/configuration.nix | 3 ++- modules/dev/nil.nix | 16 ++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 modules/dev/nil.nix diff --git a/config/nvim/lua/core/plugin_config/lsp_config.lua b/config/nvim/lua/core/plugin_config/lsp_config.lua index 7ce57453..49a1ed6c 100644 --- a/config/nvim/lua/core/plugin_config/lsp_config.lua +++ b/config/nvim/lua/core/plugin_config/lsp_config.lua @@ -30,9 +30,17 @@ local capabilities = require("cmp_nvim_lsp").default_capabilities() mason_null_ls.setup() -- funny lsp config stuff -require('lspconfig').nixd.setup({ +require('lspconfig').nil_ls.setup({ on_attach = on_attach, capabilities = capabilities, + settings = { + ['nil'] = { + testSetting = 42, + formatting = { + command = { "nixpkgs-fmt" }, + }, + }, + }, }) diff --git a/hosts/sakotop/configuration.nix b/hosts/sakotop/configuration.nix index ca13e40b..5f74dbbe 100644 --- a/hosts/sakotop/configuration.nix +++ b/hosts/sakotop/configuration.nix @@ -58,7 +58,8 @@ nvim.enable = true; vscode.enable = true; }; - nixd.enable = true; + nixd.enable = false; + nil.enable = true; cc.enable = true; javascript.enable = true; python.enable = true; diff --git a/modules/dev/nil.nix b/modules/dev/nil.nix new file mode 100644 index 00000000..a4152cbb --- /dev/null +++ b/modules/dev/nil.nix @@ -0,0 +1,16 @@ +{ outputs, options, config, lib, pkgs, ...}: +with lib; +let + cfg = config.modules.dev.nil; +in +{ + options.modules.dev.nil = { + enable = mkEnableOption false; + }; + + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + nil + ]; + }; +}