Hey y’all, I’m having an error setting up Immich on both of my computers. I’m trying to import a (as of yet) very minimal file to set up Immich on a computer I’m converting to a server:
… but I get an error saying The option 'services.immich' does not exist. Likewise, my log returned an error after running this code on my main computer:
services.immich = {
enable = true;
};
Looking this up, I see long configs, and I’m assuming they either enable features I’m not looking for right now, or are from before Immich was merged into nixpkgs as a service.
The wiki has a minimal config for it (albeit with a line of code for machine learning that seems to be deprecated): https://wiki.nixos.org/wiki/Immich
TLDR; I just want to use Immich to let me and others view and upload images and videos on my home server. What do I do to get it running?
if it’s saying services.immich does not exist, you should make sure that your nixpkgs is on 24.11, as thar was the version where the service was introduced. if it’s running a version previous, then that won’t work(and is what I assume your issue is in this case)
This solved the error on my server, but now I’m getting the same error as on my main computer. The main thing I’m eyeballing in both cases is the following units failed bit. On both computers, postgresql.service failed. Here’s the bit in the log I posted:
× postgresql.service - PostgreSQL Server
Loaded: loaded (/etc/systemd/system/postgresql.service; enabled; preset: ignored)
Active: failed (Result: exit-code) since Sun 2024-12-08 00:13:18 CST; 1min 30s ago
Duration: 4d 10h 43min 42.672s
Invocation: 41c4c7636a584fa18199e21d3e33a560
Process: 661952 ExecStartPre=/nix/store/8i4ryvqpr4bpyhdz76w01689ilijcsg4-unit-script-postgresql-pre-start/bin/postgresql-pre-start (code=exited, status=0/SUCCESS)
Process: 661966 ExecStart=/nix/store/ryfs0dskyvj2lhfsl89c7iffykwv9y31-postgresql-and-plugins-15.9/bin/postgres (code=exited, status=0/SUCCESS)
Process: 662052 ExecStartPost=/nix/store/y7v3j7ipv8bz7ddgrgjj3fqxhwbrd838-unit-script-postgresql-post-start/bin/postgresql-post-start (code=exited, status=1/FAILURE)
Main PID: 661966 (code=exited, status=0/SUCCESS)
IP: 0B in, 0B out
IO: 3.8M read, 36K written
Mem peak: 28.1M
CPU: 171ms
If you upgraded NixOS 24.05 to 24.11 you also upgraded postgres 15 to 16, you have to manually upgrade your database, or your could stick to the postgresql_15 package.
You can look at the logs to verify this: journalctl -u postgresql.service
Before downgrading to 15, I also tried to upgrade my database using the Wiki page you linked me to. Following the instructions, I couldn’t get SQL running using sudo systemctl start postgresql.service, and I tried running the following command:
Namely, it’s listing Atuin, which I do use. I’m using Atuin for Bash history and I haven’t been using my other computer as much up until now, so it’s small but I’d still like to keep it. But I don’t know how to upgrade the databases.