60 lines
1.5 KiB
Nix
60 lines
1.5 KiB
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-25.05";
|
|
};
|
|
|
|
outputs =
|
|
{ self, nixpkgs }:
|
|
let
|
|
supported-systems = [
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
];
|
|
forAllSystems =
|
|
f:
|
|
nixpkgs.lib.genAttrs supported-systems (
|
|
system:
|
|
f rec {
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
inherit system;
|
|
}
|
|
);
|
|
in
|
|
{
|
|
# https://yannipapandreou.github.io/posts/jupyter-kernels-nix/index.html
|
|
devShells = forAllSystems (
|
|
{ pkgs, ... }:
|
|
{
|
|
default = pkgs.mkShellNoCC {
|
|
packages =
|
|
let
|
|
pythonPackages =
|
|
ps: with ps; [
|
|
ipykernel
|
|
jupyterlab
|
|
matplotlib
|
|
numpy
|
|
pandas
|
|
pip
|
|
notebook
|
|
jupyterlab-lsp
|
|
jupyterlab-git
|
|
python-lsp-server
|
|
python-lsp-ruff
|
|
python-lsp-ruff
|
|
];
|
|
pythonEnv = pkgs.python3.withPackages pythonPackages;
|
|
in
|
|
[
|
|
pythonEnv
|
|
];
|
|
shellHook = ''
|
|
echo "Jupyter with Python kernel is ready. Run: 'jupyter lab' to launch."
|
|
'';
|
|
};
|
|
}
|
|
);
|
|
|
|
formatter = forAllSystems ({ pkgs, ... }: pkgs.nixfmt-rfc-style);
|
|
};
|
|
}
|