mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-06 07:28:12 +09:00
jupyter
This commit is contained in:
@@ -79,6 +79,7 @@
|
|||||||
pkgs = import nixpkgs { system = "x86_64-linux"; };
|
pkgs = import nixpkgs { system = "x86_64-linux"; };
|
||||||
in {
|
in {
|
||||||
next-web = import ./shells/next-web.nix { inherit pkgs; };
|
next-web = import ./shells/next-web.nix { inherit pkgs; };
|
||||||
|
jupyter = import ./shells/jupyter.nix { inherit pkgs; };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
let
|
||||||
|
py = pkgs.python312;
|
||||||
|
pyEnv = py.withPackages (ps: with ps; [
|
||||||
|
ipykernel
|
||||||
|
notebook
|
||||||
|
jupyterlab
|
||||||
|
numpy
|
||||||
|
pandas
|
||||||
|
matplotlib
|
||||||
|
scipy
|
||||||
|
scikit-learn
|
||||||
|
]);
|
||||||
|
in
|
||||||
|
pkgs.mkShell {
|
||||||
|
name = "jupyter-notebook";
|
||||||
|
|
||||||
|
packages = with pkgs; [
|
||||||
|
pyEnv
|
||||||
|
zsh
|
||||||
|
];
|
||||||
|
|
||||||
|
PYTHONNOUSERSITE = "1";
|
||||||
|
JUPYTER_CONFIG_DIR = "$PWD/.jupyter";
|
||||||
|
IPYTHONDIR = "$PWD/.ipython";
|
||||||
|
|
||||||
|
shellHook = ''
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# ---- show tool versions
|
||||||
|
if command -v python >/dev/null; then
|
||||||
|
echo "📓 jupyter shell → python $(python -V | awk '{print $2}')"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "''${ZSH_VERSION:-}" ] && [[ $- == *i* ]] && [ -t 1 ] && [ -z "''${NIX_SHELL_ZSH_ACTIVATED:-}" ]; then
|
||||||
|
export NIX_SHELL_ZSH_ACTIVATED=1
|
||||||
|
exec ${pkgs.zsh}/bin/zsh -i
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user