-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
49 lines (44 loc) · 932 Bytes
/
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
48
49
{
description = "Booking website";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixpkgs-unstable";
};
outputs = { self, nixpkgs }: let
system = "x86_64-linux";
in
with nixpkgs.legacyPackages.${system};
let
pythonEnv = python38.withPackages(ps: with ps; [
# sqlalchemy
# alembic
fastapi
uvicorn
]);
in
{
devShell.${system} = mkShell {
buildInputs = [
nodejs
nodePackages.npm
pythonEnv
];
# PYTHONPATH = "backend";
PORT = "8400";
shellHook = ''
echo
echo "You can setup the server for developpement by running:"
echo
echo -e " \033[35mstart dev&\033[m"
echo
function start() {
if [ "$1" != "dev" ]
then
uvicorn app:app --port $PORT
else
DEV=true uvicorn app:app --port $PORT --reload
fi
}
'';
};
};
}