diff --git a/setup.cfg b/setup.cfg
index 6d39a54cf210521314307ad39114e59389be8e12..65fd066ca911486200be2dbf792e0d06cea458b6 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -63,3 +63,10 @@ versionfile_source = src/_zkapauthorizer/_version.py
 versionfile_build = _zkapauthorizer/_version.py
 tag_prefix = release-
 parentdir_prefix = ZKAPAuthorizer
+
+[flake8]
+# Enforce all pyflakes constraints, and also prohibit tabs for indentation.
+# Reference:
+#   https://flake8.pycqa.org/en/latest/user/error-codes.html
+#   https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes
+select = F, W191
diff --git a/tests.nix b/tests.nix
index 40412a752ecaacd918e0aad6bfab37def5f24383..f51d5727f55ec963d344390f54f874b12e98a7f5 100644
--- a/tests.nix
+++ b/tests.nix
@@ -51,9 +51,9 @@ let
       mkdir -p $out
 
       pushd ${zkapauthorizer.src}
-      ${python}/bin/pyflakes src
       ${lint-python}/bin/black --check src
       ${lint-python}/bin/isort --check src
+      ${lint-python}/bin/flake8 src
       popd
 
       ZKAPAUTHORIZER_HYPOTHESIS_PROFILE=${hypothesisProfile'} ${python}/bin/python -m ${if collectCoverage