7394d241c9
- Enhanced CompanyCreate with ticker format validation (1-10 uppercase letters) - Enhanced SourceCreate with pydantic validators for source_type, access_policy, config URLs - Added /health endpoint to symbol registry - Seed data: 10 companies (AAPL, MSFT, NVDA, AMZN, GOOGL, JPM, JNJ, XOM, TSLA, META) - Seed sources: Alpha Vantage (market), NewsAPI (news), SEC EDGAR (filings), Alpaca (paper trading) - Seed watchlist: 'Starter 10' with all companies and aliases - Added flake.nix dev shell (nixos-25.11) with Python 3.12, ruff, pytest, kubectl, helm - 30 passing tests, lint clean, Docker build verified
71 lines
2.0 KiB
Nix
71 lines
2.0 KiB
Nix
{
|
|
description = "Stonks Oracle dev environment";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, flake-utils }:
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
python = pkgs.python312;
|
|
pythonPkgs = python.pkgs;
|
|
in
|
|
{
|
|
devShells.default = pkgs.mkShell {
|
|
buildInputs = [
|
|
# Python + core deps
|
|
python
|
|
pythonPkgs.pip
|
|
pythonPkgs.virtualenv
|
|
|
|
# Native build deps for asyncpg, etc.
|
|
pkgs.postgresql_16.lib
|
|
pkgs.openssl
|
|
pkgs.pkg-config
|
|
pkgs.gcc
|
|
|
|
# Dev tools
|
|
pkgs.ruff
|
|
pkgs.kubectl
|
|
pkgs.kubernetes-helm
|
|
pkgs.docker-client
|
|
|
|
# Useful extras
|
|
pkgs.jq
|
|
pkgs.yq-go
|
|
pkgs.curl
|
|
pkgs.git
|
|
];
|
|
|
|
shellHook = ''
|
|
# Create venv if it doesn't exist
|
|
if [ ! -d .venv ]; then
|
|
echo "Creating Python venv..."
|
|
python -m venv .venv
|
|
fi
|
|
source .venv/bin/activate
|
|
|
|
# Ensure nix-provided tools take precedence over venv
|
|
export PATH="${builtins.concatStringsSep ":" [
|
|
"${pkgs.ruff}/bin"
|
|
"${pkgs.kubectl}/bin"
|
|
"${pkgs.kubernetes-helm}/bin"
|
|
]}:$PATH"
|
|
|
|
# Install deps if needed
|
|
if [ ! -f .venv/.installed ]; then
|
|
echo "Installing Python dependencies..."
|
|
pip install -q --exclude ruff -r requirements.txt 2>/dev/null || pip install -q -r requirements.txt
|
|
touch .venv/.installed
|
|
fi
|
|
|
|
export PYTHONPATH="$PWD:$PYTHONPATH"
|
|
echo "Stonks Oracle dev shell ready. Python $(python --version), ruff $(ruff --version)"
|
|
'';
|
|
};
|
|
});
|
|
}
|