mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
modules: add python options to specify the python environment
This commit is contained in:
parent
96cdbc8177
commit
1ab5159acf
3 changed files with 36 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
config,
|
config,
|
||||||
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
|
@ -38,6 +39,24 @@ in {
|
||||||
description = "Extra packages to be made available to neovim";
|
description = "Extra packages to be made available to neovim";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
python = {
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.python3;
|
||||||
|
description = "";
|
||||||
|
};
|
||||||
|
|
||||||
|
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 {
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
default = "";
|
default = "";
|
||||||
|
|
|
@ -1,6 +1,16 @@
|
||||||
{pkgs, ...}: {
|
{pkgs, ...}: {
|
||||||
plain = {};
|
plain = {};
|
||||||
|
|
||||||
|
python-packages = {
|
||||||
|
python = {
|
||||||
|
package = pkgs.python3;
|
||||||
|
extraPythonPackages = p:
|
||||||
|
with p; [
|
||||||
|
numpy
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
simple-plugin = {
|
simple-plugin = {
|
||||||
extraPlugins = [pkgs.vimPlugins.vim-surround];
|
extraPlugins = [pkgs.vimPlugins.vim-surround];
|
||||||
};
|
};
|
||||||
|
|
|
@ -103,6 +103,13 @@ in {
|
||||||
inherit (config) viAlias vimAlias;
|
inherit (config) 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