From 592a9e90dae648ce67120a2aa403f76757b7901d Mon Sep 17 00:00:00 2001 From: dansbandit <4530687+dansbandit@users.noreply.github.com> Date: Mon, 12 May 2025 16:00:01 +0300 Subject: [PATCH] beetsPackages.filetote: init at 1.0.1 Co-Authored-By: Doron Behar --- pkgs/tools/audio/beets/default.nix | 1 + pkgs/tools/audio/beets/plugins/filetote.nix | 83 +++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 pkgs/tools/audio/beets/plugins/filetote.nix diff --git a/pkgs/tools/audio/beets/default.nix b/pkgs/tools/audio/beets/default.nix index 247c3a4a13eb..a0ff569b4179 100644 --- a/pkgs/tools/audio/beets/default.nix +++ b/pkgs/tools/audio/beets/default.nix @@ -56,6 +56,7 @@ lib.makeExtensible ( alternatives = callPackage ./plugins/alternatives.nix { beets = self.beets-minimal; }; audible = callPackage ./plugins/audible.nix { beets = self.beets-minimal; }; copyartifacts = callPackage ./plugins/copyartifacts.nix { beets = self.beets-minimal; }; + filetote = callPackage ./plugins/filetote.nix { beets = self.beets-minimal; }; } // lib.optionalAttrs config.allowAliases { extrafiles = throw "extrafiles is unmaintained since 2020 and broken since beets 2.0.0"; diff --git a/pkgs/tools/audio/beets/plugins/filetote.nix b/pkgs/tools/audio/beets/plugins/filetote.nix new file mode 100644 index 000000000000..34a6af769431 --- /dev/null +++ b/pkgs/tools/audio/beets/plugins/filetote.nix @@ -0,0 +1,83 @@ +{ + lib, + fetchFromGitHub, + python3Packages, + beets, + beetsPackages, + writableTmpDirAsHomeHook, +}: + +python3Packages.buildPythonApplication rec { + pname = "beets-filetote"; + version = "1.0.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "gtronset"; + repo = "beets-filetote"; + tag = "v${version}"; + hash = "sha256-LTJwZI/kQc+Iv0y8jAi5Xdh4wLEwbTA9hV76ndQsQzU="; + }; + + postPatch = '' + substituteInPlace pyproject.toml --replace-fail "poetry-core<2.0.0" "poetry-core" + ''; + + nativeBuildInputs = [ + beets + ]; + + build-system = [ python3Packages.poetry-core ]; + + dependencies = with python3Packages; [ + mediafile + reflink + toml + typeguard + ]; + + optional-dependencies = { + lint = with python3Packages; [ + black + check-manifest + flake8 + flake8-bugbear + flake8-bugbear-pyi + isort + mypy + pylint + typing_extensions + ]; + test = with python3Packages; [ + beetsPackages.audible + mediafile + pytest + reflink + toml + typeguard + ]; + dev = optional-dependencies.lint ++ optional-dependencies.test ++ [ python3Packages.tox ]; + }; + + pytestFlagsArray = [ "-r fEs" ]; + + disabledTestPaths = [ + "tests/test_cli_operation.py" + "tests/test_pruning.py" + "tests/test_version.py" + ]; + + nativeCheckInputs = [ + python3Packages.pytestCheckHook + writableTmpDirAsHomeHook + ] ++ optional-dependencies.test; + + meta = with lib; { + description = "Beets plugin to move non-music files during the import process"; + homepage = "https://github.com/gtronset/beets-filetote"; + changelog = "https://github.com/gtronset/beets-filetote/blob/${src.rev}/CHANGELOG.md"; + maintainers = with maintainers; [ dansbandit ]; + license = licenses.mit; + inherit (beets.meta) platforms; + }; +}