diff --git a/pkgs/development/python-modules/aider-chat/default.nix b/pkgs/development/python-modules/aider-chat/default.nix index c320215ef204..4e7fcc9a01a9 100644 --- a/pkgs/development/python-modules/aider-chat/default.nix +++ b/pkgs/development/python-modules/aider-chat/default.nix @@ -3,6 +3,7 @@ stdenv, buildPythonPackage, fetchFromGitHub, + replaceVars, gitMinimal, portaudio, playwright-driver, @@ -254,9 +255,11 @@ let gitMinimal ]; - postPatch = '' - substituteInPlace aider/linter.py --replace-fail "\"flake8\"" "\"${flake8}\"" - ''; + patches = [ + (replaceVars ./fix-flake8-invoke.patch { + flake8 = lib.getExe flake8; + }) + ]; disabledTestPaths = [ # Tests require network access diff --git a/pkgs/development/python-modules/aider-chat/fix-flake8-invoke.patch b/pkgs/development/python-modules/aider-chat/fix-flake8-invoke.patch new file mode 100644 index 000000000000..80b3ba9f645c --- /dev/null +++ b/pkgs/development/python-modules/aider-chat/fix-flake8-invoke.patch @@ -0,0 +1,13 @@ +--- a/aider/linter.py 2025-05-28 17:12:07.177786621 +0000 ++++ b/aider/linter.py 2025-05-28 17:12:45.834897524 +0000 +@@ -136,9 +136,7 @@ + def flake8_lint(self, rel_fname): + fatal = "E9,F821,F823,F831,F406,F407,F701,F702,F704,F706" + flake8_cmd = [ +- sys.executable, +- "-m", +- "flake8", ++ "@flake8@", + f"--select={fatal}", + "--show-source", + "--isolated",