misc: fix python environment options

This commit is contained in:
Gaetan Lepage 2024-01-06 19:17:32 +01:00 committed by Gaétan Lepage
parent a1f8b437b3
commit d52f656a8b
3 changed files with 18 additions and 31 deletions

View file

@ -39,13 +39,6 @@ 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 { extraPythonPackages = mkOption {
type = with types; functionTo (listOf package); type = with types; functionTo (listOf package);
default = p: []; default = p: [];
@ -55,7 +48,6 @@ in {
p: [ p.numpy ] p: [ p.numpy ]
''; '';
}; };
};
extraConfigLua = mkOption { extraConfigLua = mkOption {
type = types.lines; type = types.lines;

View file

@ -2,14 +2,11 @@
plain = {}; plain = {};
python-packages = { python-packages = {
python = {
package = pkgs.python3;
extraPythonPackages = p: extraPythonPackages = p:
with p; [ with p; [
numpy numpy
]; ];
}; };
};
simple-plugin = { simple-plugin = {
extraPlugins = [pkgs.vimPlugins.vim-surround]; extraPlugins = [pkgs.vimPlugins.vim-surround];

View file

@ -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: