selfprivacy-rest-api/shell.nix

42 lines
840 B
Nix
Raw Normal View History

2023-05-09 11:54:47 +03:00
{ pkgs ? import <nixos-22.11> { } }:
2022-01-24 21:56:48 +02:00
let
2023-05-09 11:54:47 +03:00
sp-python = pkgs.python310.withPackages (p: with p; [
2022-06-24 20:25:49 +03:00
setuptools
portalocker
pytz
pytest
pytest-mock
pytest-datadir
huey
2022-01-24 21:56:48 +02:00
gevent
mnemonic
coverage
2022-01-27 14:13:00 +02:00
pylint
2022-06-24 15:26:51 +03:00
pydantic
typing-extensions
2022-07-25 17:08:31 +03:00
psutil
black
fastapi
uvicorn
2022-10-28 11:09:36 +03:00
redis
2023-05-09 11:54:47 +03:00
strawberry-graphql
2022-01-24 21:56:48 +02:00
]);
in
pkgs.mkShell {
buildInputs = [
sp-python
pkgs.black
pkgs.redis
2023-05-09 11:54:47 +03:00
pkgs.restic
2022-01-24 21:56:48 +02:00
];
shellHook = ''
PYTHONPATH=${sp-python}/${sp-python.sitePackages}
# envs set with export and as attributes are treated differently.
# for example. printenv <Name> will not fetch the value of an attribute.
export USE_REDIS_PORT=6379
pkill redis-server
2023-05-09 11:54:47 +03:00
redis-server --bind 127.0.0.1 --port $USE_REDIS_PORT >/dev/null &
2022-01-24 21:56:48 +02:00
# maybe set more env-vars
'';
2022-06-24 20:25:49 +03:00
}