feat: initial project setup with implementation plan
- Add PLAN.md with 40-step checklist across 10 phases - Add CLAUDE.md with project-specific instructions - Set up nix flake with FastHTML/MonsterUI dependencies - Create Python package skeleton (src/animaltrack) - Vendor FastHTML and MonsterUI documentation - Add Docker build configuration 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
88
flake.nix
Normal file
88
flake.nix
Normal file
@@ -0,0 +1,88 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
|
||||
# Python with custom packages
|
||||
python = pkgs.python313.override {
|
||||
self = python;
|
||||
packageOverrides = pyfinal: pyprev: {
|
||||
# Leaf packages (no custom dependencies)
|
||||
mistletoe = pyfinal.callPackage ./packages/mistletoe.nix { };
|
||||
sse-starlette = pyfinal.callPackage ./packages/sse-starlette.nix { };
|
||||
fastcore = pyfinal.callPackage ./packages/fastcore.nix { };
|
||||
|
||||
# Second level (depend on leaf packages)
|
||||
apswutils = pyfinal.callPackage ./packages/apswutils.nix { };
|
||||
fastlite = pyfinal.callPackage ./packages/fastlite.nix { };
|
||||
fastmigrate = pyfinal.callPackage ./packages/fastmigrate.nix { };
|
||||
|
||||
# Top level (depend on second level)
|
||||
python-fasthtml = pyfinal.callPackage ./packages/python-fasthtml.nix { };
|
||||
monsterui = pyfinal.callPackage ./packages/monsterui.nix { };
|
||||
};
|
||||
};
|
||||
|
||||
# Shared Python environment for both dev and Docker
|
||||
pythonEnv = python.withPackages (ps: with ps; [
|
||||
# From nixpkgs
|
||||
uvicorn
|
||||
starlette
|
||||
httpx
|
||||
pydantic
|
||||
pydantic-settings
|
||||
anyio
|
||||
beautifulsoup4
|
||||
python-dateutil
|
||||
oauthlib
|
||||
itsdangerous
|
||||
python-multipart
|
||||
lxml
|
||||
apsw
|
||||
packaging
|
||||
python-ulid
|
||||
xxhash
|
||||
|
||||
# Custom packages
|
||||
fastcore
|
||||
apswutils
|
||||
fastlite
|
||||
fastmigrate
|
||||
sse-starlette
|
||||
python-fasthtml
|
||||
monsterui
|
||||
mistletoe
|
||||
|
||||
# Dev-only (not needed in Docker, but fine to include)
|
||||
pytest
|
||||
pytest-xdist
|
||||
ruff
|
||||
]);
|
||||
in
|
||||
{
|
||||
packages.${system} = {
|
||||
dockerImage = import ./docker.nix { inherit pkgs pythonEnv python; };
|
||||
};
|
||||
|
||||
devShells.${system}.default = pkgs.mkShell {
|
||||
buildInputs = [
|
||||
pythonEnv
|
||||
|
||||
# Tools
|
||||
pkgs.jq
|
||||
pkgs.sqlite
|
||||
pkgs.skopeo # For pushing Docker images
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
echo "AnimalTrack development environment ready!"
|
||||
echo "Run 'animaltrack serve' to start the app"
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user