30 lines
769 B
Nix
30 lines
769 B
Nix
|
{ config, lib, pkgs, ... }:
|
||
|
|
||
|
{
|
||
|
config = {
|
||
|
virtualisation.arion.projects.immich-ml.settings = let
|
||
|
image = { ... }: {
|
||
|
project.name = "immich-ml";
|
||
|
services = {
|
||
|
immich-ml = {
|
||
|
service = {
|
||
|
image =
|
||
|
"ghcr.io/immich-app/immich-machine-learning:${immichVersion}-cuda";
|
||
|
restart = "always";
|
||
|
ports = [ "${toString cfg.port}:3003" ];
|
||
|
volumes = [ "${cfg.state-directory}:/cache" ];
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
rawConfig = {
|
||
|
deploy.resources.reservations.devices = [{
|
||
|
driver = "nvidia";
|
||
|
count = 1;
|
||
|
capabilities = [ "gpu" ];
|
||
|
}];
|
||
|
};
|
||
|
};
|
||
|
in { imports = [ image ]; };
|
||
|
};
|
||
|
}
|