From d107efcd24bb3938a4f918d967fafc01b5ae23bb Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Sat, 12 Oct 2024 17:41:56 -0700 Subject: [PATCH] feat: configure nixd with more options --- flake.nix | 5 +++++ lua/lsp/init.lua | 25 ++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 421ad55..37f6b04 100644 --- a/flake.nix +++ b/flake.nix @@ -203,6 +203,11 @@ websocat = "${pkgs.websocat}/bin/websocat"; tinymist = "${pkgs.tinymist}/bin/tinymist"; }; + nixdExtras = { + nixpkgs = inputs.nixpkgs.outPath; + flake-path = inputs.self.outPath; + system = pkgs.system; + }; }; }; }; diff --git a/lua/lsp/init.lua b/lua/lsp/init.lua index 8efe794..715dcbd 100644 --- a/lua/lsp/init.lua +++ b/lua/lsp/init.lua @@ -33,7 +33,30 @@ M.setup = function() }, }) - lspconfig.nixd.setup({}) + lspconfig.nixd.setup({ + nixd = { + nixpkgs = { + expr = [[import (builtins.getFlake ")]] .. nixCats("nixdExtras.nixpkgs") .. [[") { } ]], + }, + -- options = { + -- nixos = { + -- expr = [[(builtins.getFlake "]] + -- .. nixCats("nixdExtras.flake-path") + -- .. [[").nixosConfigurations."]] + -- .. nixCats("nixdExtras.systemCFGname") + -- .. [[".options]], + -- }, + -- -- (builtins.getFlake "").homeConfigurations."".options + -- ["home-manager"] = { + -- expr = [[(builtins.getFlake "]] + -- .. nixCats("nixdExtras.flake-path") + -- .. [[").homeConfigurations."]] + -- .. nixCats("nixdExtras.homeCFGname") + -- .. [[".options]], + -- }, + -- }, + }, + }) lspconfig.marksman.setup({}) lspconfig.tinymist.setup({}) end