The Immich module is unconditionally creating the postgresql-setup unit,
even if it never runs. This commit adds a guard that prevents the unit
from being created if the module is not managing a local db.
- adds a hint to the description of `services.immich.host`
explaining how to enable listening to all interfaces
- in code, add hint that setting IMMICH_HOST="" does trigger Immich to
listen on both IPv4 & IPv6 is an undocumented feature
(at least no documentation of that parameter could be found)
- extend NixOS test to check for the undocumented env var to work
machine-learning[1920443]: mkdir -p failed for path /var/empty/.config/matplotlib: [Errno 1] Operation not permitted: '/var/empty/.config'
machine-learning[1920443]: Matplotlib created a temporary cache directory at /tmp/matplotlib-uo52wf71 because there was an issue with the default path (/var/empty/.config/matplotlib); it is highly recommended to set the MPLCONFIGDIR environment variable to a writable directory, in particular to speed up the import of Matplotlib and to better support multiprocessing.
Using finalAttrs.src for all derivations makes it
possible to override the source using overrideAttrs
without having to reimplement part of the logic
within the immich package.
Using finalAttrs.passthru.web in the installPhase additionally
makes it possible to override only the web derivation.
Overriding immich in passthru.machine-learning makes
sure that the exposed immich-machine-learning also
uses the updated src.
VectorChord requires its indexes to be reindexed when the extension is
updated. [1]
This commit adds functionality to save the current version of the
extension before performing an update, and then compare it with the
updated version to decide whether it should reindex Immich's indexes.
This complexity is needed to avoid reindexing every time PostgreSQL is
started, as it is an expensive operation that would slow down startup.
[1]: https://docs.immich.app/administration/postgres-standalone/#updating-vectorchord
The immich-machine-learning service can fail with
RuntimeError: Data processing error: I/O error: Operation not permitted (os error 1)
because huggingface attempts to download files to $HOME/.cache (which
doesn't exist in this case) unless $XDG_CACHE_HOME or $HF_HOME is set.
This enables VectorChord in the database (currently) alongside
pgvecto.rs. Note that VectorChord requires pgvector, which is enabled as
well by this option.
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This avoids restarting the postgresql server, when only ensureDatabases
or ensureUsers have been changed. It will also allow to properly wait
for recovery to finish later.
To wait for "postgresql is ready" in other services, we now provide a
postgresql.target.
Resolves#400018
Co-authored-by: Marcel <me@m4rc3l.de>
`config.services.postgresql.package` is now only available when the
PostgreSQL module is actually enabled. If we're not using the local
database, we'll need to fallback to the latest postgresql version, since
we don't know about the remote version.
the redis module expects a user and group to exist with this name.
previously if there was no group with the same name as
`services.immich.user` the immich redis server would fail to start.
instead we can use the redis module's default behaviour: it will
create a user & group named "redis-immich".