Unable to use Paperless module

Every time I add paperless to my nixos config the deploy stalls out while activating units. I’m on nixos-unstable.

  services.paperless = {
    enable = true;
    dataDir = "/mnt/paperless-ngx";
    port = 9000;
  };

If I check journalctl -xe then I see a problem with the paperless-celary service:

Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]: Traceback (most recent call last):
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/nn90qnjfwbqbnp7m7h64mlq1g3ds7chk-python3.12-django-4.2.14/lib/python3.12/site-packages/django/db/backends/base/ba>
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     self.connect()
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/nn90qnjfwbqbnp7m7h64mlq1g3ds7chk-python3.12-django-4.2.14/lib/python3.12/site-packages/django/utils/asyncio.py", >
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     return func(*args, **kwargs)
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:            ^^^^^^^^^^^^^^^^^^^^^
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/nn90qnjfwbqbnp7m7h64mlq1g3ds7chk-python3.12-django-4.2.14/lib/python3.12/site-packages/django/db/backends/base/ba>
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     self.connection = self.get_new_connection(conn_params)
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/nn90qnjfwbqbnp7m7h64mlq1g3ds7chk-python3.12-django-4.2.14/lib/python3.12/site-packages/django/utils/asyncio.py", >
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     return func(*args, **kwargs)
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:            ^^^^^^^^^^^^^^^^^^^^^
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/nn90qnjfwbqbnp7m7h64mlq1g3ds7chk-python3.12-django-4.2.14/lib/python3.12/site-packages/django/db/backends/postgre>
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     connection = self.Database.connect(**conn_params)
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/mlnwms006mzmlnychkcxjraf0rh6a12j-python3.12-psycopg-3.1.19/lib/python3.12/site-packages/psycopg/connection.py", l>
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     attempts = conninfo_attempts(params)
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:                ^^^^^^^^^^^^^^^^^^^^^^^^^
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/mlnwms006mzmlnychkcxjraf0rh6a12j-python3.12-psycopg-3.1.19/lib/python3.12/site-packages/psycopg/_conninfo_attempt>
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     raise e.OperationalError(str(last_exc))
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]: psycopg.OperationalError: [Errno -2] Name or service not known
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]: The above exception was the direct cause of the following exception:
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]: Traceback (most recent call last):
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/s04zac7ixfzjbbvdr2sjh49cvyq56h0h-paperless-ngx-2.11.0/lib/paperless-ngx/src/manage.py", line 10, in <module>
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     execute_from_command_line(sys.argv)
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/nn90qnjfwbqbnp7m7h64mlq1g3ds7chk-python3.12-django-4.2.14/lib/python3.12/site-packages/django/core/management/__i>
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     utility.execute()
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/nn90qnjfwbqbnp7m7h64mlq1g3ds7chk-python3.12-django-4.2.14/lib/python3.12/site-packages/django/core/management/__i>
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     self.fetch_command(subcommand).run_from_argv(self.argv)
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/nn90qnjfwbqbnp7m7h64mlq1g3ds7chk-python3.12-django-4.2.14/lib/python3.12/site-packages/django/core/management/bas>
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     self.execute(*args, **cmd_options)
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/nn90qnjfwbqbnp7m7h64mlq1g3ds7chk-python3.12-django-4.2.14/lib/python3.12/site-packages/django/core/management/bas>
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     output = self.handle(*args, **options)
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/nn90qnjfwbqbnp7m7h64mlq1g3ds7chk-python3.12-django-4.2.14/lib/python3.12/site-packages/django/core/management/bas>
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     res = handle_func(*args, **kwargs)
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/nn90qnjfwbqbnp7m7h64mlq1g3ds7chk-python3.12-django-4.2.14/lib/python3.12/site-packages/django/core/management/com>
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     self.check(databases=[database])
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/nn90qnjfwbqbnp7m7h64mlq1g3ds7chk-python3.12-django-4.2.14/lib/python3.12/site-packages/django/core/management/bas>
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     all_issues = checks.run_checks(
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:                  ^^^^^^^^^^^^^^^^^^
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/nn90qnjfwbqbnp7m7h64mlq1g3ds7chk-python3.12-django-4.2.14/lib/python3.12/site-packages/django/core/checks/registr>
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     new_errors = check(app_configs=app_configs, databases=databases)
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/s04zac7ixfzjbbvdr2sjh49cvyq56h0h-paperless-ngx-2.11.0/lib/paperless-ngx/src/paperless/checks.py", line 204, in au>
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     all_tables = db_conn.introspection.table_names()
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/nn90qnjfwbqbnp7m7h64mlq1g3ds7chk-python3.12-django-4.2.14/lib/python3.12/site-packages/django/db/backends/base/in>
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     with self.connection.cursor() as cursor:
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:          ^^^^^^^^^^^^^^^^^^^^^^^^
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/nn90qnjfwbqbnp7m7h64mlq1g3ds7chk-python3.12-django-4.2.14/lib/python3.12/site-packages/django/utils/asyncio.py", >
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     return func(*args, **kwargs)
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:            ^^^^^^^^^^^^^^^^^^^^^
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/nn90qnjfwbqbnp7m7h64mlq1g3ds7chk-python3.12-django-4.2.14/lib/python3.12/site-packages/django/db/backends/base/ba>
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     return self._cursor()
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:            ^^^^^^^^^^^^^^
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/nn90qnjfwbqbnp7m7h64mlq1g3ds7chk-python3.12-django-4.2.14/lib/python3.12/site-packages/django/db/backends/base/ba>
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     self.ensure_connection()
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/nn90qnjfwbqbnp7m7h64mlq1g3ds7chk-python3.12-django-4.2.14/lib/python3.12/site-packages/django/utils/asyncio.py", >
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     return func(*args, **kwargs)
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:            ^^^^^^^^^^^^^^^^^^^^^
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/nn90qnjfwbqbnp7m7h64mlq1g3ds7chk-python3.12-django-4.2.14/lib/python3.12/site-packages/django/db/backends/base/ba>
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     with self.wrap_database_errors:
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/nn90qnjfwbqbnp7m7h64mlq1g3ds7chk-python3.12-django-4.2.14/lib/python3.12/site-packages/django/db/utils.py", line >
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     raise dj_exc_value.with_traceback(traceback) from exc_value
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/nn90qnjfwbqbnp7m7h64mlq1g3ds7chk-python3.12-django-4.2.14/lib/python3.12/site-packages/django/db/backends/base/ba>
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     self.connect()
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/nn90qnjfwbqbnp7m7h64mlq1g3ds7chk-python3.12-django-4.2.14/lib/python3.12/site-packages/django/utils/asyncio.py", >
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     return func(*args, **kwargs)
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:            ^^^^^^^^^^^^^^^^^^^^^
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/nn90qnjfwbqbnp7m7h64mlq1g3ds7chk-python3.12-django-4.2.14/lib/python3.12/site-packages/django/db/backends/base/ba>
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     self.connection = self.get_new_connection(conn_params)
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/nn90qnjfwbqbnp7m7h64mlq1g3ds7chk-python3.12-django-4.2.14/lib/python3.12/site-packages/django/utils/asyncio.py", >
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     return func(*args, **kwargs)
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:            ^^^^^^^^^^^^^^^^^^^^^
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/nn90qnjfwbqbnp7m7h64mlq1g3ds7chk-python3.12-django-4.2.14/lib/python3.12/site-packages/django/db/backends/postgre>
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     connection = self.Database.connect(**conn_params)
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/mlnwms006mzmlnychkcxjraf0rh6a12j-python3.12-psycopg-3.1.19/lib/python3.12/site-packages/psycopg/connection.py", l>
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     attempts = conninfo_attempts(params)
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:                ^^^^^^^^^^^^^^^^^^^^^^^^^
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:   File "/nix/store/mlnwms006mzmlnychkcxjraf0rh6a12j-python3.12-psycopg-3.1.19/lib/python3.12/site-packages/psycopg/_conninfo_attempt>
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]:     raise e.OperationalError(str(last_exc))
Sep 01 22:32:26 accompaniment-of-shadows paperless-scheduler-pre-start[65803]: django.db.utils.OperationalError: [Errno -2] Name or service not known
Sep 01 22:32:27 accompaniment-of-shadows systemd[1]: paperless-scheduler.service: Control process exited, code=exited, status=1/FAILURE

Have you researched what that error message means?