- Add flake.nix defining the reproducible development shell. - Add .envrc-example for automatic `direnv`/Nix flake integration - Add development dependencies: Python 3.12, uv, Buf, Make, Transmission, SQLite and Docker Compose - Include a shellHook to report tool versions and sync uv when .venv doesn't exist. - Fix .gitignore so generated worker protobuf files are also ignored.
61 lines
1.5 KiB
Nix
61 lines
1.5 KiB
Nix
{
|
|
description = "MagNetFlix — Movie acquisition pipeline development environment";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, flake-utils }:
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
config = {
|
|
allowUnfree = true;
|
|
};
|
|
};
|
|
in
|
|
{
|
|
devShells.default = pkgs.mkShell {
|
|
name = "magnetflix-dev-shell";
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
buf
|
|
gnumake
|
|
pkg-config
|
|
];
|
|
|
|
buildInputs = with pkgs; [
|
|
# Python & package management
|
|
python312
|
|
uv
|
|
|
|
# Local torrent daemon for dev/testing
|
|
transmission_4
|
|
|
|
# Database tooling
|
|
sqlite
|
|
|
|
# Container tooling
|
|
docker-compose
|
|
];
|
|
|
|
shellHook = ''
|
|
echo "🎬 Entering MagNetFlix DevShell"
|
|
echo " • Python: $(python3 --version)"
|
|
echo " • UV: $(uv --version)"
|
|
echo " • Buf: $(buf --version)"
|
|
echo " • Transmission: $(transmission-daemon --version 2>&1 | head -n 1)"
|
|
|
|
# Automatically sync uv workspace if .venv is missing
|
|
if [ ! -d ".venv" ]; then
|
|
echo "Creating virtual environment and syncing workspace..."
|
|
uv sync
|
|
fi
|
|
'';
|
|
};
|
|
}
|
|
);
|
|
}
|