Skip to content

Commit

Permalink
neovim: drop python2 support (#1978)
Browse files Browse the repository at this point in the history
Nixpkgs did the same in NixOS/nixpkgs#121339.
  • Loading branch information
dotlambda authored May 4, 2021
1 parent 225bf27 commit e0ee506
Showing 1 changed file with 8 additions and 30 deletions.
38 changes: 8 additions & 30 deletions modules/programs/neovim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@ let

cfg = config.programs.neovim;

extraPythonPackageType = mkOptionType {
name = "extra-python-packages";
description = "python packages in python.withPackages format";
check = with types;
(x: if isFunction x then isList (x pkgs.pythonPackages) else false);
merge = mergeOneOption;
};

extraPython3PackageType = mkOptionType {
name = "extra-python3-packages";
description = "python3 packages in python.withPackages format";
Expand Down Expand Up @@ -67,6 +59,13 @@ let
''--suffix PATH : "${lib.makeBinPath cfg.extraPackages}"'';

in {
imports = [
(mkRemovedOptionModule [ "programs" "neovim" "withPython" ]
"Python2 support has been removed from neovim.")
(mkRemovedOptionModule [ "programs" "neovim" "extraPythonPackages" ]
"Python2 support has been removed from neovim.")
];

options = {
programs.neovim = {
enable = mkEnableOption "Neovim";
Expand Down Expand Up @@ -104,26 +103,6 @@ in {
'';
};

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 = with types; either extraPythonPackageType (listOf package);
default = (_: [ ]);
defaultText = "ps: []";
example = literalExample "(ps: with ps; [ pandas jedi ])";
description = ''
A function in python.withPackages format, which returns a
list of Python 2 packages required for your plugins to work.
'';
};

withRuby = mkOption {
type = types.nullOr types.bool;
default = true;
Expand Down Expand Up @@ -245,8 +224,7 @@ in {
config = let
neovimConfig = pkgs.neovimUtils.makeNeovimConfig {
inherit (cfg)
extraPython3Packages withPython3 extraPythonPackages withPython
withNodeJs withRuby viAlias vimAlias;
extraPython3Packages withPython3 withNodeJs withRuby viAlias vimAlias;
configure = cfg.configure // moduleConfigure;
plugins = cfg.plugins;
};
Expand Down

0 comments on commit e0ee506

Please sign in to comment.