Immich: Difference between revisions

From NixOS Wiki
Onny (talk | contribs)
Inital page
 
Ww4 (talk | contribs)
m Default port has changed as per this commit: https://github.com/NixOS/nixpkgs/commit/e3152f80bf675f9bad5f6d5d2a8b55b4ea5b85cc
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[https://immich.app Immich] is an open-source software, designed to provide a self-hosted alternative for managing and backing up photos and videos, with a focus on privacy and ease of use.
[https://immich.app Immich] is an open source photo and video management solution, designed to provide a self-hosted alternative for managing and backing up photos and videos, with a focus on privacy and ease of use.


== Setup ==
== Setup ==


{{Note|The module is not yet part of the latest NixOS stable release and will be available with version 24.11.}}
{{Note|The module is not yet part of the latest NixOS stable release (24.05)  and is only available in unstable.}}


The following example configuration will enable Immich locally
The following example configuration will enable Immich locally.


{{file|/etc/nixos/configuration.nix|nix|3=environment.etc."immich-typsense-api-key".text = "12318551487654187654";
{{file|/etc/nixos/configuration.nix|nix|3=services.immich = {
services.immich = {
   enable = true;
   enable = true;
   server.typesense.apiKeyFile = "/etc/immich-typsense-api-key";
   environment.IMMICH_MACHINE_LEARNING_URL = "http://localhost:3003";
};
};
}}To see more options, visit the [https://search.nixos.org/options?channel=unstable&query=services.immich Immich module's options page].


services.typesense = {
After applying the above configuration you will be able to access Immich at http://localhost:2283.
  enable = true;
 
  # In a real setup you should generate an api key for immich
=== Hardware Accelerated Transcoding using VA-API ===
  # and not use the admin key!
Before anything else, make sure you have configured hardware acceleration on your system as described in [[Accelerated Video Playback]].
  apiKeyFile = "/etc/immich-typsense-api-key";
  settings.server.api-address = "127.0.0.1";
};


services.postgresql = {
To make use of hardware accelerated video transcoding using VA-API, add your Immich user to the <code>render</code> and <code>video</code> groups.
  enable = true;
  identMap = ''
    # ArbitraryMapName systemUser DBUser
    superuser_map      root      postgres
    superuser_map      postgres postgres
    # Let other names login as themselves
    superuser_map      /^(.*)$  \1
  '';
  authentication = pkgs.lib.mkOverride 10 ''
    local sameuser all peer map=superuser_map
  '';
  ensureDatabases = [ "immich" ];
  ensureUsers = [
    {
      name = "immich";
      ensurePermissions = {
        "DATABASE immich" = "ALL PRIVILEGES";
      };
    }
  ];
};
}}After applying the configuration you can access the instance via http://localhost:28981 and login with username <code>admin</code> and password <code>admin</code>.


If you are using the default <code>immich</code> user, you can use the following snippet to enable VA-API support.{{file|/etc/nixos/configuration.nix|nix|3=users.users.immich.extraGroups = [ "video" "render" ];
}}
[[Category:Server]]
[[Category:Server]]
[[Category:Web Applications]]
[[Category:Web Applications]]

Latest revision as of 17:35, 15 November 2024

Immich is an open source photo and video management solution, designed to provide a self-hosted alternative for managing and backing up photos and videos, with a focus on privacy and ease of use.

Setup

Note: The module is not yet part of the latest NixOS stable release (24.05) and is only available in unstable.

The following example configuration will enable Immich locally.

/etc/nixos/configuration.nix
services.immich = {
  enable = true;
  environment.IMMICH_MACHINE_LEARNING_URL = "http://localhost:3003";
};

To see more options, visit the Immich module's options page.

After applying the above configuration you will be able to access Immich at http://localhost:2283.

Hardware Accelerated Transcoding using VA-API

Before anything else, make sure you have configured hardware acceleration on your system as described in Accelerated Video Playback.

To make use of hardware accelerated video transcoding using VA-API, add your Immich user to the render and video groups.

If you are using the default immich user, you can use the following snippet to enable VA-API support.

/etc/nixos/configuration.nix
users.users.immich.extraGroups = [ "video" "render" ];