Set up nix-shell + fastapi base

This commit is contained in:
2026-04-12 21:55:13 +02:00
parent 12914f8169
commit 363f642bff
3 changed files with 25 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
__pycache__

7
main.py Normal file
View 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
View 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
];
}