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 = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
@ -22,16 +22,6 @@
|
|||||||
python = pkgs.${pythonVersion};
|
python = pkgs.${pythonVersion};
|
||||||
|
|
||||||
# Determine if Python version is 3.11 or higher
|
# 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
|
# Base Python packages that are always included
|
||||||
basePackages = ps: with ps; [
|
basePackages = ps: with ps; [
|
||||||
@ -45,18 +35,11 @@
|
|||||||
pytest
|
pytest
|
||||||
ipython
|
ipython
|
||||||
|
|
||||||
# Include sphinx (will be filtered out later if needed)
|
|
||||||
#sphinx
|
|
||||||
|
|
||||||
# Add more default packages as needed
|
# Add more default packages as needed
|
||||||
];
|
];
|
||||||
|
|
||||||
# Combine base packages with extra packages and filter if needed
|
# Combine base packages with extra packages and filter if needed
|
||||||
allPackages = ps:
|
allPackages = ps: (basePackages ps) ++ (extraPackages ps);
|
||||||
let
|
|
||||||
combinedPackages = (basePackages ps) ++ (extraPackages ps);
|
|
||||||
in
|
|
||||||
filterSphinxForOldPython combinedPackages;
|
|
||||||
|
|
||||||
# Create the Python environment with filtered packages
|
# Create the Python environment with filtered packages
|
||||||
pythonEnv = python.withPackages allPackages;
|
pythonEnv = python.withPackages allPackages;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user