odapi/shell.nix

39 lines
1002 B
Nix

{ pkgs ? import <nixpkgs> { } }:
with pkgs;
mkShell {
buildInputs = [
# Dependencies
python38Packages.fastapi
python38Packages.uvicorn
python38Packages.pydantic
python38Packages.email_validator
python38Packages.sqlalchemy
python38Packages.pymysql
python38Packages.databases
python38Packages.aiomysql
python38Packages.alembic
python38Packages.pytest
python38Packages.twilio
mysql57
# Development tools
python38Packages.black
python38Packages.isort
python38Packages.pyflakes
python-language-server
];
shellHook = ''
pkill mysql
rm -rf .mysql && mkdir .mysql
mysqld --datadir="$(pwd)/.mysql" --socket="$(pwd)/.mysql/mysql.sock" --initialize-insecure
mysqld --datadir="$(pwd)/.mysql" --socket="$(pwd)/.mysql/mysql.sock" --skip-networking & sleep 1
mysql --socket="$(pwd)/.mysql/mysql.sock" -u root < $(pwd)/assets/test_db.sql
alias mysql='mysql --socket="$(pwd)/.mysql/mysql.sock" -u root'
'';
}