mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
misc: fix python environment options
This commit is contained in:
parent
a1f8b437b3
commit
d52f656a8b
3 changed files with 18 additions and 31 deletions
|
@ -39,22 +39,14 @@ in {
|
||||||
description = "Extra packages to be made available to neovim";
|
description = "Extra packages to be made available to neovim";
|
||||||
};
|
};
|
||||||
|
|
||||||
python = {
|
extraPythonPackages = mkOption {
|
||||||
package = mkOption {
|
type = with types; functionTo (listOf package);
|
||||||
type = types.package;
|
default = p: [];
|
||||||
default = pkgs.python3;
|
defaultText = literalExpression "p: with p; [ ]";
|
||||||
description = "";
|
description = "Python packages to add to the `PYTHONPATH` of neovim.";
|
||||||
};
|
example = lib.literalExpression ''
|
||||||
|
p: [ p.numpy ]
|
||||||
extraPythonPackages = mkOption {
|
'';
|
||||||
type = with types; functionTo (listOf package);
|
|
||||||
default = p: [];
|
|
||||||
defaultText = literalExpression "p: with p; [ ]";
|
|
||||||
description = "Python packages to add to the `PYTHONPATH` of neovim.";
|
|
||||||
example = lib.literalExpression ''
|
|
||||||
p: [ p.numpy ]
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extraConfigLua = mkOption {
|
extraConfigLua = mkOption {
|
||||||
|
|
|
@ -2,13 +2,10 @@
|
||||||
plain = {};
|
plain = {};
|
||||||
|
|
||||||
python-packages = {
|
python-packages = {
|
||||||
python = {
|
extraPythonPackages = p:
|
||||||
package = pkgs.python3;
|
with p; [
|
||||||
extraPythonPackages = p:
|
numpy
|
||||||
with p; [
|
];
|
||||||
numpy
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
simple-plugin = {
|
simple-plugin = {
|
||||||
|
|
|
@ -100,16 +100,14 @@ in {
|
||||||
config.extraPlugins;
|
config.extraPlugins;
|
||||||
|
|
||||||
neovimConfig = pkgs.neovimUtils.makeNeovimConfig ({
|
neovimConfig = pkgs.neovimUtils.makeNeovimConfig ({
|
||||||
inherit (config) viAlias vimAlias;
|
inherit
|
||||||
|
(config)
|
||||||
|
extraPythonPackages
|
||||||
|
viAlias
|
||||||
|
vimAlias
|
||||||
|
;
|
||||||
# inherit customRC;
|
# inherit customRC;
|
||||||
plugins = normalizedPlugins;
|
plugins = normalizedPlugins;
|
||||||
|
|
||||||
# Python 3 environment
|
|
||||||
python3Env = let
|
|
||||||
python = config.python.package;
|
|
||||||
inherit (config.python) extraPythonPackages;
|
|
||||||
in
|
|
||||||
python.withPackages extraPythonPackages;
|
|
||||||
}
|
}
|
||||||
# Necessary to make sure the runtime path is set properly in NixOS 22.05,
|
# Necessary to make sure the runtime path is set properly in NixOS 22.05,
|
||||||
# or more generally before the commit:
|
# or more generally before the commit:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue