-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
94 lines (80 loc) · 2.53 KB
/
Copy pathflake.nix
File metadata and controls
94 lines (80 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
{
description = "Synology Photos to Immich migration tool";
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 = nixpkgs.legacyPackages.${system};
# Python with required packages
pythonEnv = pkgs.python312.withPackages (ps: with ps; [
# HTTP client for Immich API
httpx
# SMB client for NAS access
smbprotocol
# PostgreSQL client for Synology Photos DB
psycopg2
# Image metadata (EXIF)
pillow
exifread
# CLI framework
click
rich # Pretty console output
# Configuration
tomli # TOML parser (Python 3.11+ has tomllib built-in, but we use this for compatibility)
# Testing
pytest
pytest-cov
pytest-asyncio
# Development
black
ruff
mypy
# Type stubs
types-pillow
]);
in
{
devShells.default = pkgs.mkShell {
buildInputs = [
pythonEnv
pkgs.postgresql # psql client for debugging
pkgs.uv # Python package manager
];
shellHook = ''
echo "🚀 Synology to Immich migration tool - dev environment"
echo ""
echo "Python: $(python --version)"
echo "uv: $(uv --version)"
echo ""
echo "Available commands:"
echo " uv run pytest -v # Run tests"
echo " uv run black . # Format code"
echo " uv run ruff check . # Lint code"
echo " uv run mypy src/ # Type check"
echo " uv sync # Sync dependencies"
echo " psql # PostgreSQL client"
echo ""
'';
};
# Package definition (for future use)
packages.default = pkgs.python312Packages.buildPythonApplication {
pname = "synology-to-immich";
version = "0.1.0";
src = ./.;
propagatedBuildInputs = with pkgs.python312Packages; [
httpx
smbprotocol
psycopg2
pillow
exifread
click
rich
tomli
];
};
}
);
}