trying stuff
This commit is contained in:
parent
3911f3e0dc
commit
6103b46dda
21
flake.nix
21
flake.nix
@ -1,5 +1,5 @@
|
||||
{
|
||||
description = "Customizable Python development environment";
|
||||
description = "Customizable Python 3.11+ flake";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
@ -22,16 +22,6 @@
|
||||
python = pkgs.${pythonVersion};
|
||||
|
||||
# Determine if Python version is 3.11 or higher
|
||||
isPython311OrHigher =
|
||||
let
|
||||
versionStr = builtins.substring 6 10 pythonVersion;
|
||||
versionNum = builtins.fromJSON (builtins.substring 0 1 versionStr + "." + builtins.substring 1 2 versionStr);
|
||||
in
|
||||
versionNum >= 3.11;
|
||||
|
||||
# Custom function to filter out sphinx when Python version is < 3.11
|
||||
filterSphinxForOldPython = packages:
|
||||
builtins.filter (p: p.pname or "" != "sphinx") packages;
|
||||
|
||||
# Base Python packages that are always included
|
||||
basePackages = ps: with ps; [
|
||||
@ -45,18 +35,11 @@
|
||||
pytest
|
||||
ipython
|
||||
|
||||
# Include sphinx (will be filtered out later if needed)
|
||||
#sphinx
|
||||
|
||||
# Add more default packages as needed
|
||||
];
|
||||
|
||||
# Combine base packages with extra packages and filter if needed
|
||||
allPackages = ps:
|
||||
let
|
||||
combinedPackages = (basePackages ps) ++ (extraPackages ps);
|
||||
in
|
||||
filterSphinxForOldPython combinedPackages;
|
||||
allPackages = ps: (basePackages ps) ++ (extraPackages ps);
|
||||
|
||||
# Create the Python environment with filtered packages
|
||||
pythonEnv = python.withPackages allPackages;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user