nixd neovim setup

This commit is contained in:
Noah Masur 2024-10-25 08:53:27 -04:00
parent 8cba026f10
commit 6cf5f08fd5
No known key found for this signature in database
3 changed files with 23 additions and 0 deletions

View File

@ -11,6 +11,11 @@
options.terraform = lib.mkEnableOption "Whether to enable Terraform LSP";
options.github = lib.mkEnableOption "Whether to enable GitHub features";
options.kubernetes = lib.mkEnableOption "Whether to enable Kubernetes features";
options.nixosConfiguration = lib.mkOption {
type = lib.types.str;
description = "Configuration to use for nixd options checking";
default = "default";
};
config = {
plugins = [
@ -43,6 +48,21 @@
use.lspconfig.nixd.setup = dsl.callWith {
cmd = [ "${pkgs.nixd}/bin/nixd" ];
capabilities = dsl.rawLua "require('cmp_nvim_lsp').default_capabilities()";
# settings = {
# nixd = {
# options = {
# nixos = {
# expr = "(builtins.getFlake (\"git+file://\" + toString ./.)).nixosConfigurations.${config.nixosConfiguration}.options";
# };
# home-manager = {
# expr = "(builtins.getFlake (\"git+file://\" + toString ./.)).homeConfigurations.${config.nixosConfiguration}.options";
# };
# darwin = {
# expr = "(builtins.getFlake (\"git+file://\" + toString ./.)).darwinConfigurations.${config.nixosConfiguration}.options";
# };
# };
# };
# };
};
use.lspconfig.pyright.setup = dsl.callWith {

View File

@ -13,6 +13,7 @@ let
terraform = config.terraform.enable;
github = true;
kubernetes = config.kubernetes.enable;
nixosConfiguration = config.networking.hostName; # Used for Nixd
};
in
{

View File

@ -32,6 +32,7 @@
terraform ? false,
github ? false,
kubernetes ? false,
nixosConfiguration ? "default",
...
}:
@ -44,6 +45,7 @@ pkgs.neovimBuilder {
terraform
github
kubernetes
nixosConfiguration
;
imports = [
../config/align.nix