Overriding python package build inputs via overlay

I’m attempting to enable paperless via services.paperless.enable on a raspberry pi and having trouble with some of the paperless-ngx build input dependencies failing their tests at build time, specifically django-q and autobahn. I suspect that some of this is due to the raspberry pi’s slowness as the failing tests seem to be related to timeouts and IO. Regardless I’d like to at least get paperless built.

So far I’ve tried adding the following (with some slight variations) to nixpkgs.overlays:

(final: prev: {
  python3 = prev.python3.override {
    packageOverrides = final: prev: rec {
      django-q = prev.django-q.overridePythonAttrs(attrs: {
        doCheck = false;
      autobahn = prev.autobahn.overridePythonAttrs(attrs: {
        doCheck = false;

This doesn’t seem to have any effect as the build process is still failing on tests for those two dependencies. For what its worth I’m attempting to transition this machine to managing configuration with flakes. Flake is below:

  inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
  outputs = {self, nixpkgs}: {
    nixosConfigurations.overlord = nixpkgs.lib.nixosSystem {
      system = "aarch64-linux";
      modules = [ ./configuration.nix ];

I know that overlaying/overriding python packages is a bit of a mess but I’m having trouble reconciling all of the slight variations of how its supposed to be done on top of not being sure that the methods I’m seeing are appropriate for my situation.

1 Like

Unfortunately I have zero experience with overlays, but I just spent several days learning enough nix to package a python module and its dependencies (using flakes).

Breaking up the problem might help you spot whatever subtlety is tripping your build.

Have you tried building the problem packages on their own on the Pi? With and without their tests?

  1. I think the way you override those two python packages with overlay is correct. I am not 100% sure, but when I check the implementation of services.paperless here, it seems to me that it uses pkgs.python (which is in fact python 2 IIRC) instead of pkgs.python3 (which is what you have overridden). You probably need to do this for python 2.
  2. If possible, you can try to solve this issue by using another machine to build the package instead of let the Pi do the heavy lifting. Related information can be found here.

I have found I need to disable the install checks with

doInstallCheck = false;

Have you tried that?