From 705ba38d2e527dacf9ea1a8e969359513e0019ff Mon Sep 17 00:00:00 2001 From: Michael-J-Ward Date: Wed, 12 Jun 2024 15:42:38 -0500 Subject: [PATCH] update flake with other python versions --- flake.nix | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 53 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index fe7b499b..69208ff8 100644 --- a/flake.nix +++ b/flake.nix @@ -24,7 +24,7 @@ pkgs.openssl pkgs.protobuf ]; - rust-toolchain = pkgs.symlinkJoin { + rust-toolchain = python: pkgs.symlinkJoin { name = "rust-toolchain"; paths = [ pkgs.rustc @@ -33,7 +33,7 @@ pkgs.cargo-watch pkgs.rust-analyzer pkgs.rustPlatform.rustcSrc - (pkgs.python3.withPackages (python-pkgs: [ + (python.withPackages (python-pkgs: [ python-pkgs.numpy python-pkgs.pyarrow ])) @@ -118,7 +118,7 @@ buildInputs = nonRustDeps; nativeBuildInputs = with pkgs; [ just - rust-toolchain + (rust-toolchain python311) (pkgs.hiPrio pkgs.bashInteractive) # needed so it doesn't mangle terminal in vscode python311 pre-commit @@ -126,6 +126,56 @@ # RUST_BACKTRACE = 1; }; + # Rust dev environment - python310 + devShells.py310 = pkgs.mkShell { + inherit NIX_LD_LIBRARY_PATH; + inputsFrom = [ + config.treefmt.build.devShell + ]; + shellHook = '' + # For rust-analyzer 'hover' tooltips to work. + export RUST_SRC_PATH=${pkgs.rustPlatform.rustLibSrc} + + echo + echo "🍎🍎 Run 'just ' to get started" + just + ''; + buildInputs = nonRustDeps; + nativeBuildInputs = with pkgs; [ + just + (rust-toolchain python310) + (pkgs.hiPrio pkgs.bashInteractive) # needed so it doesn't mangle terminal in vscode + python310 + pre-commit + ]; + # RUST_BACKTRACE = 1; + }; + + # Rust dev environment - python37 + devShells.py37 = pkgs.mkShell { + inherit NIX_LD_LIBRARY_PATH; + inputsFrom = [ + config.treefmt.build.devShell + ]; + shellHook = '' + # For rust-analyzer 'hover' tooltips to work. + export RUST_SRC_PATH=${pkgs.rustPlatform.rustLibSrc} + + echo + echo "🍎🍎 Run 'just ' to get started" + just + ''; + buildInputs = nonRustDeps; + nativeBuildInputs = with pkgs; [ + just + (rust-toolchain python37) + (pkgs.hiPrio pkgs.bashInteractive) # needed so it doesn't mangle terminal in vscode + python37 + pre-commit + ]; + # RUST_BACKTRACE = 1; + }; + # NIXPKGS_ALLOW_UNFREE=1 nix develop '.#conda' --impure # conda install -c conda-forge boa conda-verify # NOTE: conda env create fails probably because I am not on nvidia