From 6103b46ddadf10535a94e3f7df39e7c45d56276b Mon Sep 17 00:00:00 2001 From: Arthur Wambst Date: Tue, 6 May 2025 17:46:04 +0200 Subject: [PATCH] trying stuff --- flake.nix | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/flake.nix b/flake.nix index 4ebac24..fb7ab93 100644 --- a/flake.nix +++ b/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,17 +22,7 @@ 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; [ # Data science @@ -45,19 +35,12 @@ 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; in