neovim: add module
This is a basic module that allows to configure different Neovim providers than the system ones. Note, it does not generate any `init.vim`.
This commit is contained in:
parent
c718951e97
commit
61a869a1f5
|
@ -35,6 +35,7 @@ let
|
|||
./programs/info.nix
|
||||
./programs/lesspipe.nix
|
||||
./programs/man.nix
|
||||
./programs/neovim.nix
|
||||
./programs/rofi.nix
|
||||
./programs/ssh.nix
|
||||
./programs/termite.nix
|
||||
|
|
|
@ -442,6 +442,12 @@ in
|
|||
December 6, 2017.
|
||||
'';
|
||||
}
|
||||
{
|
||||
time = "2017-11-12T00:18:59+00:00";
|
||||
message = ''
|
||||
A new program module is available: 'programs.neovim'.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
74
modules/programs/neovim.nix
Normal file
74
modules/programs/neovim.nix
Normal file
|
@ -0,0 +1,74 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.programs.neovim;
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
options = {
|
||||
programs.neovim = {
|
||||
enable = mkEnableOption "Neovim";
|
||||
|
||||
withPython = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Enable Python 2 provider. Set to <literal>true</literal> to
|
||||
use Python 2 plugins.
|
||||
'';
|
||||
};
|
||||
|
||||
extraPythonPackages = mkOption {
|
||||
type = types.listOf types.package;
|
||||
default = [ ];
|
||||
example = literalExample "with pkgs.python2Packages; [ pandas jedi ]";
|
||||
description = ''
|
||||
List here Python 2 packages required for your plugins to
|
||||
work.
|
||||
'';
|
||||
};
|
||||
|
||||
withRuby = mkOption {
|
||||
type = types.nullOr types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Enable ruby provider.
|
||||
'';
|
||||
};
|
||||
|
||||
withPython3 = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Enable Python 3 provider. Set to <literal>true</literal> to
|
||||
use Python 3 plugins.
|
||||
'';
|
||||
};
|
||||
|
||||
extraPython3Packages = mkOption {
|
||||
type = types.listOf types.package;
|
||||
default = [ ];
|
||||
example = literalExample
|
||||
"with pkgs.python3Packages; [ python-language-server ]";
|
||||
description = ''
|
||||
List here Python 3 packages required for your plugins to work.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [
|
||||
(pkgs.neovim.override {
|
||||
inherit (cfg)
|
||||
extraPython3Packages withPython3
|
||||
extraPythonPackages withPython
|
||||
withRuby;
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue