mirror of
https://github.com/nix-community/nixvim.git
synced 2025-12-19 15:31:13 +01:00
plugins/lsp: inline explicit server option declarations
This commit is contained in:
parent
882eb84c35
commit
771cb3c852
1 changed files with 5 additions and 7 deletions
|
|
@ -32,7 +32,7 @@ let
|
||||||
# Create a server option
|
# Create a server option
|
||||||
# Used below for the `lsp.servers.*` options
|
# Used below for the `lsp.servers.*` options
|
||||||
mkServerOption =
|
mkServerOption =
|
||||||
name: args:
|
{ name, ... }@args:
|
||||||
let
|
let
|
||||||
homepage = lib.pipe options.lsp.servers [
|
homepage = lib.pipe options.lsp.servers [
|
||||||
# Get suboptions of `lsp.servers`
|
# Get suboptions of `lsp.servers`
|
||||||
|
|
@ -59,11 +59,6 @@ let
|
||||||
'';
|
'';
|
||||||
default = { };
|
default = { };
|
||||||
};
|
};
|
||||||
|
|
||||||
# Read package-option defaults from `packages.nix`
|
|
||||||
serverPackages = builtins.mapAttrs (name: package: {
|
|
||||||
inherit name package;
|
|
||||||
}) (import ./packages.nix).packages;
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.lsp = {
|
options.lsp = {
|
||||||
|
|
@ -73,7 +68,10 @@ in
|
||||||
freeformType = types.attrsOf (mkServerType { });
|
freeformType = types.attrsOf (mkServerType { });
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
options = builtins.mapAttrs mkServerOption serverPackages;
|
# Declare explicit options for each `packages.nix` entry with a known package
|
||||||
|
options = builtins.mapAttrs (
|
||||||
|
name: package: mkServerOption { inherit name package; }
|
||||||
|
) (import ./packages.nix).packages;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
# `*` is effectively a meta server, where shared config & defaults can be set.
|
# `*` is effectively a meta server, where shared config & defaults can be set.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue