Set up nix-shell + fastapi base
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
__pycache__
|
||||
7
main.py
Normal file
7
main.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from fastapi import FastAPI
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
@app.get("/")
|
||||
async def root():
|
||||
return {"message": "Hello World"}
|
||||
17
shell.nix
Normal file
17
shell.nix
Normal file
@@ -0,0 +1,17 @@
|
||||
# run with "nix develop -f shell.nix"
|
||||
let
|
||||
# We pin to a specific nixpkgs commit for reproducibility.
|
||||
# Last updated: 2026-04-12. Check for new commits at https://status.nixos.org.
|
||||
pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/54170c54449ea4d6725efd30d719c5e505f1c10e.tar.gz") {};
|
||||
in pkgs.mkShell {
|
||||
packages = [
|
||||
(pkgs.python3.withPackages (python-pkgs: with python-pkgs; [
|
||||
# select Python packages here
|
||||
fastapi
|
||||
pydantic
|
||||
sqlalchemy
|
||||
uvicorn
|
||||
]))
|
||||
pkgs.fastapi-cli
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user