1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-16 16:19:44 +01:00

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:
Matthieu Coudron 2017-11-03 02:34:42 +09:00 committed by Robert Helgesson
parent c718951e97
commit 61a869a1f5
No known key found for this signature in database
GPG key ID: C3DB11069E65DC86
3 changed files with 81 additions and 0 deletions

View file

@ -35,6 +35,7 @@ let
./programs/info.nix ./programs/info.nix
./programs/lesspipe.nix ./programs/lesspipe.nix
./programs/man.nix ./programs/man.nix
./programs/neovim.nix
./programs/rofi.nix ./programs/rofi.nix
./programs/ssh.nix ./programs/ssh.nix
./programs/termite.nix ./programs/termite.nix

View file

@ -442,6 +442,12 @@ in
December 6, 2017. December 6, 2017.
''; '';
} }
{
time = "2017-11-12T00:18:59+00:00";
message = ''
A new program module is available: 'programs.neovim'.
'';
}
]; ];
}; };
} }

View 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;
})
];
};
}