From 4c8511e9b44fa01cb33e5e1fd363e6fc9076da4e Mon Sep 17 00:00:00 2001 From: Quinn Unger Date: Fri, 7 Aug 2026 16:29:48 +0100 Subject: [PATCH] bandcampsync: patch in ignores file template source --- pkgs/bandcampsync.nix | 68 +++++++++++++++++++++++++++++-------------- 1 file changed, 46 insertions(+), 22 deletions(-) diff --git a/pkgs/bandcampsync.nix b/pkgs/bandcampsync.nix index d8b5a75..97f4d45 100644 --- a/pkgs/bandcampsync.nix +++ b/pkgs/bandcampsync.nix @@ -1,27 +1,51 @@ { lib, + writeText, fetchFromGitHub, python3Packages, }: -python3Packages.buildPythonPackage (finalAttrs: { - pname = "bandcampsync"; - version = "0.8.0"; - src = fetchFromGitHub { - owner = "meeb"; - repo = finalAttrs.pname; - tag = "v${finalAttrs.version}"; - hash = "sha256-j370Kn95CQuGjwOoFMXNNQZ5odlR/0uiw02hN/UVAb8="; - }; - dependencies = with python3Packages; [ - beautifulsoup4 - curl-cffi - ]; - pyproject = true; - build-system = [ python3Packages.setuptools ]; - meta = { - description = "Downloads your Bandcamp purchases automatically"; - mainProgram = finalAttrs.pname; - homepage = "https://github.com/meeb/bandcampsync"; - license = lib.licenses.bsd3; - }; -}) +python3Packages.buildPythonPackage ( + finalAttrs: + let + src = fetchFromGitHub { + owner = "meeb"; + repo = finalAttrs.pname; + tag = "v${finalAttrs.version}"; + hash = "sha256-j370Kn95CQuGjwOoFMXNNQZ5odlR/0uiw02hN/UVAb8="; + }; + in + { + inherit src; + pname = "bandcampsync"; + version = "0.8.0"; + dependencies = with python3Packages; [ + beautifulsoup4 + curl-cffi + ]; + patches = [ + (writeText "patch-ignore-tempalate.patch" '' + diff --git a/bandcampsync/ignores.py b/bandcampsync/ignores.py + index 4247c7d..d2dea23 100644 + --- a/bandcampsync/ignores.py + +++ b/bandcampsync/ignores.py + @@ -4,7 +4,7 @@ import shutil + from .logger import get_logger + + + -TEMPLATE_IGNORES_FILE = "/ignores.template.txt" + +TEMPLATE_IGNORES_FILE = "${src}/ignores.template.txt" + # A comment containing 10 or more equals signs, + # used to delimit user-entered data with ids from the last run + DELIMITER_REGEX = re.compile(r"^#\s*={10,}\s*$") + '') + ]; + pyproject = true; + build-system = [ python3Packages.setuptools ]; + meta = { + description = "Downloads your Bandcamp purchases automatically"; + mainProgram = finalAttrs.pname; + homepage = "https://github.com/meeb/bandcampsync"; + license = lib.licenses.bsd3; + }; + } +) -- 2.54.0