trying stuff
This commit is contained in:
parent
e25cde7310
commit
22f2be0e87
23
flake.nix
23
flake.nix
@ -20,7 +20,7 @@
|
||||
|
||||
# Select Python version based on the parameter
|
||||
python = pkgs.${pythonVersion};
|
||||
|
||||
|
||||
# Determine if Python version is 3.11 or higher
|
||||
isPython311OrHigher =
|
||||
let
|
||||
@ -29,8 +29,18 @@
|
||||
in
|
||||
versionNum >= 3.11;
|
||||
|
||||
# Define package overrides for specific Python versions
|
||||
packageOverrides = self: super: {
|
||||
# Remove sphinx for Python versions under 3.11
|
||||
sphinx = if !isPython311OrHigher then null else super.sphinx;
|
||||
|
||||
# Add more package overrides as needed
|
||||
};
|
||||
|
||||
# Create Python with package overrides
|
||||
pythonWithOverrides = python;
|
||||
pythonWithOverrides = python.override {
|
||||
packageOverrides = packageOverrides;
|
||||
};
|
||||
|
||||
# Base Python packages that are always included
|
||||
basePackages = ps: with ps; [
|
||||
@ -44,14 +54,11 @@
|
||||
pytest
|
||||
ipython
|
||||
|
||||
# Conditionally include sphinx for Python 3.11+
|
||||
(if isPython311OrHigher then sphinx else null)
|
||||
|
||||
# Add more default packages as needed
|
||||
];
|
||||
|
||||
# Combine base packages with extra packages and filter out nulls
|
||||
allPackages = ps: builtins.filter (pkg: pkg != null) ((basePackages ps) ++ (extraPackages ps));
|
||||
# Combine base packages with extra packages
|
||||
allPackages = ps: (basePackages ps) ++ (extraPackages ps);
|
||||
|
||||
# Create the Python environment using the Python with overrides
|
||||
pythonEnv = pythonWithOverrides.withPackages allPackages;
|
||||
@ -105,7 +112,7 @@
|
||||
|
||||
pythonVersion = mkOption {
|
||||
type = types.str;
|
||||
default = "python313";
|
||||
default = "python311";
|
||||
description = "Python version to use (e.g., python39, python310, python311)";
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user