-
-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
languages/nix: add nixd to supported LSP servers #458
base: v0.7
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,11 @@ | |
in | ||
flake-parts.lib.mkFlake { | ||
inherit inputs; | ||
specialArgs = {inherit lib;}; | ||
} { | ||
specialArgs = { | ||
inherit lib; | ||
}; | ||
} | ||
{ | ||
# Allow users to bring their own systems. | ||
# «https://github.com/nix-systems/nix-systems» | ||
systems = import inputs.systems; | ||
|
@@ -66,7 +69,12 @@ | |
default = self'.devShells.lsp; | ||
nvim-nix = pkgs.mkShell {packages = [config.packages.nix];}; | ||
lsp = pkgs.mkShell { | ||
packages = with pkgs; [nil statix deadnix alejandra]; | ||
packages = with pkgs; [ | ||
nil | ||
statix | ||
deadnix | ||
alejandra | ||
]; | ||
Comment on lines
+72
to
+77
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Undo. |
||
}; | ||
}; | ||
|
||
|
@@ -111,6 +119,11 @@ | |
inputs.nixpkgs.follows = "nixpkgs"; | ||
inputs.flake-utils.follows = "flake-utils"; | ||
}; | ||
nixd = { | ||
url = "github:nix-community/nixd"; | ||
inputs.nixpkgs.follows = "nixpkgs"; | ||
Elias-Ainsworth marked this conversation as resolved.
Show resolved
Hide resolved
|
||
inputs.flake-utils.follows = "flake-utils"; | ||
}; | ||
|
||
## Plugins | ||
# LSP plugins | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,6 +74,22 @@ | |
} | ||
''; | ||
}; | ||
|
||
nixd = { | ||
package = pkgs.nixd; | ||
internalFormatter = cfg.format.type == "nixpkgs-fmt"; | ||
lspConfig = '' | ||
lspconfig.nixd.setup{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Still missing on_attach. |
||
capabilities = capabilities, | ||
Elias-Ainsworth marked this conversation as resolved.
Show resolved
Hide resolved
|
||
${ | ||
if (cfg.format.enable && cfg.format.type == "nixpkgs-fmt") | ||
then useFormat | ||
else noFormat | ||
}, | ||
Comment on lines
+84
to
+88
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this necessary? Does nixd only support nixpkgs-fmt? |
||
cmd = ${packageToCmd cfg.lsp.package "nixd"}, | ||
} | ||
''; | ||
}; | ||
}; | ||
|
||
defaultFormat = "alejandra"; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Undo formatting changes.