Skip to content

Commit

Permalink
add languages.python.manylinux.enable
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Aug 22, 2023
1 parent cac947a commit eb79fe1
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions src/modules/languages/python.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,26 @@

let
cfg = config.languages.python;
libraries = lib.concatStringsSep ":"
(
(lib.optional cfg.manylinux.enable pkgs.pythonManylinuxPackages.manylinux2014Package)
# Make sure the python interpreter can find the native libraries.
++ [ "${config.devenv.dotfile}/profile/lib" ]
);
package = cfg.package.override (old: {
self = pkgs.callPackage "${pkgs.path}/pkgs/development/interpreters/python/wrapper.nix" {
python = old.self;
requiredPythonModules = cfg.package.pkgs.requiredPythonModules;
makeWrapperArgs = [
"--prefix"
":"
"LIBRARY_PATH"
# Make sure the python interpreter can find the native libraries.
"${config.devenv.dotfile}/profile/lib"
libraries
] ++ lib.optionals pkgs.stdenv.isDarwin [
"--prefix"
":"
"DYLD_LIBRARY_PATH"
# Make sure the python interpreter can find the native libraries.
"${config.devenv.dotfile}/profile/lib"
libraries
];
};
});
Expand Down Expand Up @@ -121,6 +127,18 @@ in
description = "The Python package to use.";
};

manylinux.enable = lib.mkOption {
type = lib.types.bool;
default = pkgs.stdenv.isLinux;
description = ''
Whether to install manylinux2014 libraries.
Enabled by default on linux;
This is useful when you want to use Python wheels that depend on manylinux2014 libraries.
'';
};

version = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
Expand Down

0 comments on commit eb79fe1

Please sign in to comment.