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.terraform = lib.mkEnableOption "Whether to enable Terraform LSP";
options.github = lib.mkEnableOption "Whether to enable GitHub features"; options.github = lib.mkEnableOption "Whether to enable GitHub features";
options.kubernetes = lib.mkEnableOption "Whether to enable Kubernetes 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 = { config = {
plugins = [ plugins = [
@ -43,6 +48,21 @@
use.lspconfig.nixd.setup = dsl.callWith { use.lspconfig.nixd.setup = dsl.callWith {
cmd = [ "${pkgs.nixd}/bin/nixd" ]; cmd = [ "${pkgs.nixd}/bin/nixd" ];
capabilities = dsl.rawLua "require('cmp_nvim_lsp').default_capabilities()"; 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 { use.lspconfig.pyright.setup = dsl.callWith {

View File

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

View File

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