mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-14 11:14:36 +02:00
nixvim: support standalone nixvim
This represents a major rearchitecture for nixvim, so I'm leaving this up to track the progress for now, and to serve as a reference for any breaking changes during transition. The main change is, of course, being able to use nixvim standalone. To do this, you should use the new build function, which takes in two arguments: the system architecture (e.g. x86_64-linux) and the configuration. For the new configuration, do not use the programs.nixvim. prefix. For module development, the main change is that you should no longer prefix your modules with programs.nixvim..
This commit is contained in:
parent
bd6f978d51
commit
4ddd3969e5
52 changed files with 1410 additions and 904 deletions
|
@ -1,7 +1,7 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.programs.nixvim.plugins.lsp;
|
||||
cfg = config.plugins.lsp;
|
||||
helpers = (import ../helpers.nix { inherit lib; });
|
||||
in
|
||||
{
|
||||
|
@ -10,25 +10,28 @@ in
|
|||
];
|
||||
|
||||
options = {
|
||||
programs.nixvim.plugins.lsp = {
|
||||
plugins.lsp = {
|
||||
enable = mkEnableOption "Enable neovim's built-in LSP";
|
||||
|
||||
enabledServers = mkOption {
|
||||
type = with types; listOf (oneOf [str (submodule {
|
||||
options = {
|
||||
name = mkOption {
|
||||
type = str;
|
||||
description = "The server's name";
|
||||
};
|
||||
type = with types; listOf (oneOf [
|
||||
str
|
||||
(submodule {
|
||||
options = {
|
||||
name = mkOption {
|
||||
type = str;
|
||||
description = "The server's name";
|
||||
};
|
||||
|
||||
extraOptions = mkOption {
|
||||
type = attrs;
|
||||
description = "Extra options for the server";
|
||||
extraOptions = mkOption {
|
||||
type = attrs;
|
||||
description = "Extra options for the server";
|
||||
};
|
||||
};
|
||||
};
|
||||
})]);
|
||||
})
|
||||
]);
|
||||
description = "A list of enabled LSP servers. Don't use this directly.";
|
||||
default = [];
|
||||
default = [ ];
|
||||
};
|
||||
|
||||
onAttach = mkOption {
|
||||
|
@ -40,7 +43,7 @@ in
|
|||
setupWrappers = mkOption {
|
||||
type = with types; listOf (functionTo str);
|
||||
description = "Code to be run to wrap the setup args. Takes in an argument containing the previous results, and returns a new string of code.";
|
||||
default = [];
|
||||
default = [ ];
|
||||
};
|
||||
|
||||
preConfig = mkOption {
|
||||
|
@ -51,12 +54,13 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = let
|
||||
runWrappers = wrappers: s:
|
||||
if wrappers == [] then s
|
||||
else (head wrappers) (runWrappers (tail wrappers) s);
|
||||
in mkIf cfg.enable {
|
||||
programs.nixvim = {
|
||||
config =
|
||||
let
|
||||
runWrappers = wrappers: s:
|
||||
if wrappers == [ ] then s
|
||||
else (head wrappers) (runWrappers (tail wrappers) s);
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
extraPlugins = [ pkgs.vimPlugins.nvim-lspconfig ];
|
||||
|
||||
# Enable all LSP servers
|
||||
|
@ -85,5 +89,4 @@ in
|
|||
-- }}}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue