{ lib, python3Packages, makeWrapper, ffmpeg, }: python3Packages.buildPythonApplication { pname = "music-mirror"; inherit ((lib.importTOML ./pyproject.toml).project) version; pyproject = true; src = lib.fileset.toSource { root = ./.; fileset = lib.fileset.unions [ ./music_mirror.py ./pyproject.toml ./pytest.ini ./tests ]; }; build-system = [ python3Packages.setuptools ]; nativeBuildInputs = [ makeWrapper ]; # ffmpeg and ffprobe are called as subprocesses, so they belong on the # wrapper's PATH rather than in the Python environment. makeWrapperArgs = [ "--prefix" "PATH" ":" (lib.makeBinPath [ ffmpeg ]) ]; nativeCheckInputs = [ python3Packages.pytestCheckHook ffmpeg ]; meta = { description = "Maintain a lossy MP3 mirror of a lossless music library"; longDescription = '' Reproduces a lossless library, path for path, as MP3 in a separate tree: tags and cover art carried across, sources that are already MP3 copied rather than re-encoded, and mirror files whose source has gone deleted. The source library is never written to. ''; homepage = "https://code.emmathe.dev/lyrathorpe/music-mirror"; mainProgram = "music-mirror"; platforms = lib.platforms.unix; }; }