Skip to content
This repository was archived by the owner on Mar 16, 2024. It is now read-only.

Add flake.nix so we can nixify the python setup #129

Merged
merged 3 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,4 @@ playground/*
*.sqlite3
local_tasks/
scripts/setup.sh
setup.sh
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 64 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
description = "Automata";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
python = pkgs.python310;
pythonPkgs = pkgs.python310Packages;
pythonEnv = python.withPackages (ps: with ps;
[
black
click
codecov
colorlog
isort
jinja2
jsonpickle
jsonschema
matplotlib
networkx
numpy
openai
pandas
plotly
protobuf
pydantic
pypandoc
pytest-mock
python-dotenv
redbaron
scikit-learn
scipy
termcolor
tiktoken
types-protobuf
gitpython
pygithub
pyyaml
jupyter
notebook
]);
in
{
# Create a devShell with the Python environment and some tools
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
pythonEnv
yapf
jupyter
];
shellHook = ''
export PYTHONPATH=${pythonEnv}/bin/python
'';
};
}
);
}