mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-11-09 22:55:58 +01:00
Compare commits
5 commits
74df3a5f03
...
f0f2c08e9f
Author | SHA1 | Date | |
---|---|---|---|
f0f2c08e9f | |||
cfbed8ceb1 | |||
1ce25d7ca3 | |||
eefc7a9d1d | |||
74c94b8a54 |
6 changed files with 66 additions and 37 deletions
|
@ -47,7 +47,7 @@
|
||||||
nixosModules.neovim-flake has been deprecated.
|
nixosModules.neovim-flake has been deprecated.
|
||||||
Please use the nixosModules.nvf instead
|
Please use the nixosModules.nvf instead
|
||||||
''
|
''
|
||||||
self.nixosModules.neovim-flake;
|
self.nixosModules.nvf;
|
||||||
|
|
||||||
nvf = {
|
nvf = {
|
||||||
imports = [(import ./flake/modules/nixos.nix self.packages inputs)];
|
imports = [(import ./flake/modules/nixos.nix self.packages inputs)];
|
||||||
|
|
|
@ -25,7 +25,7 @@ inputs: {
|
||||||
# check can be disabled while calling this file is called
|
# check can be disabled while calling this file is called
|
||||||
# to avoid checking in all modules
|
# to avoid checking in all modules
|
||||||
nvimModules = import ./modules.nix {
|
nvimModules = import ./modules.nix {
|
||||||
inherit check pkgs;
|
inherit pkgs check;
|
||||||
lib = extendedLib;
|
lib = extendedLib;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
|
check ? true,
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
check ? true,
|
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkDefault;
|
inherit (lib.modules) mkDefault;
|
||||||
inherit (lib.lists) concatLists;
|
inherit (lib.lists) concatLists;
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.attrsets) mapAttrs;
|
inherit (lib.attrsets) mapAttrs;
|
||||||
|
inherit (lib.trivial) boolToString;
|
||||||
inherit (lib.nvim.dag) entryAnywhere entryAfter entryBetween;
|
inherit (lib.nvim.dag) entryAnywhere entryAfter entryBetween;
|
||||||
|
|
||||||
cfg = config.vim.lsp;
|
cfg = config.vim.lsp;
|
||||||
|
@ -12,27 +13,37 @@ in {
|
||||||
config = mkIf cfg.null-ls.enable (mkMerge [
|
config = mkIf cfg.null-ls.enable (mkMerge [
|
||||||
{
|
{
|
||||||
vim = {
|
vim = {
|
||||||
lsp.enable = true;
|
startPlugins = [
|
||||||
startPlugins = ["none-ls"];
|
"none-ls"
|
||||||
|
"plenary-nvim"
|
||||||
|
];
|
||||||
|
|
||||||
luaConfigRC.null_ls-setup = entryAnywhere ''
|
# null-ls implies LSP already being set up
|
||||||
|
# since it will hook into LSPs to receive information
|
||||||
|
lsp.enable = true;
|
||||||
|
|
||||||
|
luaConfigRC = {
|
||||||
|
# early setup for null-ls
|
||||||
|
null_ls-setup = entryAnywhere ''
|
||||||
local null_ls = require("null-ls")
|
local null_ls = require("null-ls")
|
||||||
local null_helpers = require("null-ls.helpers")
|
local null_helpers = require("null-ls.helpers")
|
||||||
local null_methods = require("null-ls.methods")
|
local null_methods = require("null-ls.methods")
|
||||||
local ls_sources = {}
|
local ls_sources = {}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
luaConfigRC.null_ls = entryAfter ["null_ls-setup" "lsp-setup"] ''
|
# null-ls setup
|
||||||
|
null_ls = entryAfter ["null_ls-setup" "lsp-setup"] ''
|
||||||
require('null-ls').setup({
|
require('null-ls').setup({
|
||||||
debug = false,
|
debug = ${boolToString cfg.null-ls.debug},
|
||||||
diagnostics_format = "[#{m}] #{s} (#{c})",
|
diagnostics_format = "${cfg.null-ls.diagnostics_format}",
|
||||||
debounce = 250,
|
debounce = ${toString cfg.null-ls.debounce},
|
||||||
default_timeout = 5000,
|
default_timeout = ${toString cfg.null-ls.default_timeout},
|
||||||
sources = ls_sources,
|
sources = ls_sources,
|
||||||
on_attach = default_on_attach
|
on_attach = default_on_attach
|
||||||
})
|
})
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
vim.luaConfigRC = mapAttrs (_: v: (entryBetween ["null_ls"] ["null_ls-setup"] v)) cfg.null-ls.sources;
|
vim.luaConfigRC = mapAttrs (_: v: (entryBetween ["null_ls"] ["null_ls-setup"] v)) cfg.null-ls.sources;
|
||||||
|
|
|
@ -1,10 +1,30 @@
|
||||||
{lib, ...}: let
|
{lib, ...}: let
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
inherit (lib.types) attrsOf str;
|
inherit (lib.types) attrsOf str int;
|
||||||
in {
|
in {
|
||||||
options.vim.lsp.null-ls = {
|
options.vim.lsp.null-ls = {
|
||||||
enable = mkEnableOption "null-ls, also enabled automatically";
|
enable = mkEnableOption "null-ls, also enabled automatically";
|
||||||
|
|
||||||
|
debug = mkEnableOption "debugging information for `null-ls";
|
||||||
|
|
||||||
|
diagnostics_format = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = "[#{m}] #{s} (#{c})";
|
||||||
|
description = "Diagnostic output format for null-ls";
|
||||||
|
};
|
||||||
|
|
||||||
|
debounce = mkOption {
|
||||||
|
type = int;
|
||||||
|
default = 250;
|
||||||
|
description = "Default debounce";
|
||||||
|
};
|
||||||
|
|
||||||
|
default_timeout = mkOption {
|
||||||
|
type = int;
|
||||||
|
default = 5000;
|
||||||
|
description = "Default timeout value, in miliseconds";
|
||||||
|
};
|
||||||
|
|
||||||
sources = mkOption {
|
sources = mkOption {
|
||||||
description = "null-ls sources";
|
description = "null-ls sources";
|
||||||
type = attrsOf str;
|
type = attrsOf str;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
inherit (lib.options) mkOption mkEnableOption literalMD;
|
||||||
inherit (lib.types) package bool str listOf attrsOf;
|
inherit (lib.types) package bool str listOf attrsOf;
|
||||||
inherit (lib.nvim.types) pluginsOpt extraPluginType;
|
inherit (lib.nvim.types) pluginsOpt extraPluginType;
|
||||||
in {
|
in {
|
||||||
|
@ -38,7 +38,7 @@ in {
|
||||||
|
|
||||||
startPlugins = pluginsOpt {
|
startPlugins = pluginsOpt {
|
||||||
default = ["plenary-nvim"];
|
default = ["plenary-nvim"];
|
||||||
example = literalExpression ''
|
example = ''
|
||||||
[pkgs.vimPlugins.telescope-nvim]
|
[pkgs.vimPlugins.telescope-nvim]
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ in {
|
||||||
|
|
||||||
optPlugins = pluginsOpt {
|
optPlugins = pluginsOpt {
|
||||||
default = [];
|
default = [];
|
||||||
example = literalExpression ''
|
example = ''
|
||||||
[pkgs.vimPlugins.vim-ghost]
|
[pkgs.vimPlugins.vim-ghost]
|
||||||
'';
|
'';
|
||||||
description = ''
|
description = ''
|
||||||
|
@ -80,7 +80,8 @@ in {
|
||||||
your custom plugins using nvf's modified DAG library.
|
your custom plugins using nvf's modified DAG library.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
example = literalExpression ''
|
example = literalMD ''
|
||||||
|
```nix
|
||||||
with pkgs.vimPlugins; {
|
with pkgs.vimPlugins; {
|
||||||
aerial = {
|
aerial = {
|
||||||
package = aerial-nvim;
|
package = aerial-nvim;
|
||||||
|
@ -93,13 +94,14 @@ in {
|
||||||
after = ["aerial"]; # place harpoon configuration after aerial
|
after = ["aerial"]; # place harpoon configuration after aerial
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
```
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
extraPackages = mkOption {
|
extraPackages = mkOption {
|
||||||
type = listOf package;
|
type = listOf package;
|
||||||
default = [];
|
default = [];
|
||||||
example = literalExpression ''[pkgs.fzf pkgs.ripgrep]'';
|
example = ''[pkgs.fzf pkgs.ripgrep]'';
|
||||||
description = ''
|
description = ''
|
||||||
List of additional packages to make available to the Neovim
|
List of additional packages to make available to the Neovim
|
||||||
wrapper.
|
wrapper.
|
||||||
|
@ -107,7 +109,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
# this defaults to `true` in the wrapper
|
# this defaults to `true` in the wrapper
|
||||||
# and since we passs this value to the wrapper
|
# and since we pass this value to the wrapper
|
||||||
# with an inherit, it should be `true` here as well
|
# with an inherit, it should be `true` here as well
|
||||||
withRuby =
|
withRuby =
|
||||||
mkEnableOption ''
|
mkEnableOption ''
|
||||||
|
@ -118,29 +120,25 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
withNodeJs = mkEnableOption ''
|
withNodeJs = mkEnableOption ''
|
||||||
NodeJs support in the Neovim wrapper.
|
NodeJs support in the Neovim wrapper
|
||||||
'';
|
'';
|
||||||
|
|
||||||
luaPackages = mkOption {
|
luaPackages = mkOption {
|
||||||
type = listOf str;
|
type = listOf str;
|
||||||
default = [];
|
default = [];
|
||||||
example = literalExpression ''["magick" "serpent"]'';
|
example = ''["magick" "serpent"]'';
|
||||||
description = ''
|
description = "List of lua packages to install";
|
||||||
List of lua packages to install.
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
withPython3 = mkEnableOption ''
|
withPython3 = mkEnableOption ''
|
||||||
Python3 support in the Neovim wrapper.
|
Python3 support in the Neovim wrapper
|
||||||
'';
|
'';
|
||||||
|
|
||||||
python3Packages = mkOption {
|
python3Packages = mkOption {
|
||||||
type = listOf str;
|
type = listOf str;
|
||||||
default = [];
|
default = [];
|
||||||
example = literalExpression ''["pynvim"]'';
|
example = ''["pynvim"]'';
|
||||||
description = ''
|
description = "List of python packages to install";
|
||||||
List of python packages to install.
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue