nixos-config/config/host-config/toothless/immich-ml.nix
2024-05-21 23:16:02 -07:00

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 ]; };
};
}