Add initial project files for Jellyfin-Plex Library Checker
- Create .editorconfig for consistent coding styles. - Add .envrc for direnv integration. - Include .gitignore to exclude environment and build files. - Implement compare_movies.py and analyze_movies.py for movie library comparison and analysis. - Implement compare_series.py and analyze_series.py for TV series library comparison and analysis. - Add configuration example in config.example.txt. - Create README.md with project overview, setup instructions, and usage examples. - Add LICENSE file for MIT License. - Include flake.nix and flake.lock for Nix-based development environment. - Add USAGE.md for quick start guide and common commands.
This commit is contained in:
97
flake.nix
Normal file
97
flake.nix
Normal file
@@ -0,0 +1,97 @@
|
||||
{
|
||||
description = "Jellyfin-Plex Library Comparator";
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
# Python environment with pip and build tools
|
||||
pythonEnv = pkgs.python3.withPackages (ps: with ps; [
|
||||
pip
|
||||
setuptools
|
||||
wheel
|
||||
virtualenv
|
||||
]);
|
||||
|
||||
in
|
||||
{
|
||||
apps = {
|
||||
compare-movies = {
|
||||
type = "app";
|
||||
program = "${pkgs.writeShellScript "compare-movies" ''
|
||||
cd ${./.}
|
||||
${pythonEnv}/bin/python compare_movies.py
|
||||
''}";
|
||||
};
|
||||
|
||||
analyze-movies = {
|
||||
type = "app";
|
||||
program = "${pkgs.writeShellScript "analyze-movies" ''
|
||||
cd ${./.}
|
||||
${pythonEnv}/bin/python analyze_movies.py
|
||||
''}";
|
||||
};
|
||||
|
||||
compare-series = {
|
||||
type = "app";
|
||||
program = "${pkgs.writeShellScript "compare-series" ''
|
||||
cd ${./.}
|
||||
${pythonEnv}/bin/python compare_series.py
|
||||
''}";
|
||||
};
|
||||
|
||||
analyze-series = {
|
||||
type = "app";
|
||||
program = "${pkgs.writeShellScript "analyze-series" ''
|
||||
cd ${./.}
|
||||
${pythonEnv}/bin/python analyze_series.py
|
||||
''}";
|
||||
};
|
||||
};
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = [
|
||||
pythonEnv
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
echo "🐍 Setting up Python environment..."
|
||||
|
||||
# Create virtual environment if it doesn't exist
|
||||
if [ ! -d "venv" ]; then
|
||||
echo "Creating virtual environment..."
|
||||
${pythonEnv}/bin/python -m venv venv
|
||||
fi
|
||||
|
||||
# Activate virtual environment
|
||||
source venv/bin/activate
|
||||
|
||||
# Install/upgrade dependencies
|
||||
echo "Installing Python dependencies from requirements.txt..."
|
||||
pip install --upgrade pip setuptools wheel --quiet
|
||||
pip install -r requirements.txt
|
||||
|
||||
echo ""
|
||||
echo "✅ Python environment ready!"
|
||||
echo ""
|
||||
echo "📋 Available commands:"
|
||||
echo " Movies: python compare_movies.py | nix run .#compare-movies"
|
||||
echo " python analyze_movies.py | nix run .#analyze-movies"
|
||||
echo ""
|
||||
echo " Series: python compare_series.py | nix run .#compare-series"
|
||||
echo " python analyze_series.py | nix run .#analyze-series"
|
||||
echo ""
|
||||
'';
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user