-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
47 lines (44 loc) · 1.21 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{
description = "CS229 solutions";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
jupyterWith.url = "github:tweag/jupyenv";
flake-utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
mach-nix.url = "github:davhau/mach-nix";
};
outputs = { self, nixpkgs, mach-nix, jupyterWith, flake-utils, ... }:
let
pythonVersion = "python39";
in
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
system = system;
};
my-python-packages = ps: with ps; [
pandas
requests
numpy
matplotlib
jupyter
ipykernel
];
my-python = pkgs.python311.withPackages my-python-packages;
in
{
devShells.default = pkgs.mkShellNoCC {
packages = [ pkgs.yapf pkgs.quarto my-python ];
shellHook = ''
export PYTHONPATH="${my-python}/bin/python"
export QUARTO_PYTHON="${my-python}/bin/python"
export PATH="${my-python}/bin:$PATH"
export YAPF_PATH="${pkgs.yapf}/bin/yapf"
'';
};
}
);
}