nixos-configs/devices/nas/modules/arion/immich/compose.nix
matt1432 b0313ac3d2
All checks were successful
Discord / discord commits (push) Has been skipped
feat(arion): add immich compose file
2024-02-19 12:42:02 -05:00

73 lines
1.6 KiB
Nix

{config, ...}: let
inherit (config.arion) rwDataDir;
rwPath = rwDataDir + "/immich";
UPLOAD_LOCATION = "${rwPath}/data";
in {
arion.projects."immich" = {
"immich_server" = {
image = ./images/server.nix;
command = ["start.sh" "immich"];
env_file = ["${./.env}"];
volumes = [
"${UPLOAD_LOCATION}:/usr/src/app/upload:rw"
];
ports = [
"2283:3001"
];
depends_on = ["immich_redis" "immich_postgres"];
restart = "always";
environment.NODE_ENV = "production";
};
"immich_microservices" = {
image = ./images/server.nix;
command = ["start.sh" "microservices"];
env_file = ["${./.env}"];
volumes = [
"${UPLOAD_LOCATION}:/usr/src/app/upload:rw"
];
depends_on = ["immich_redis" "immich_postgres"];
restart = "always";
};
"immich_machine_learning" = {
image = ./images/machine-learning.nix;
restart = "always";
env_file = ["${./.env}"];
volumes = [
"${rwPath}/cache:/cache"
];
};
"immich_redis" = {
image = ./images/redis.nix;
restart = "always";
tmpfs = ["/data"];
env_file = ["${./.env}"];
};
"immich_postgres" = {
image = ./images/postgres.nix;
restart = "always";
env_file = ["${./.env}"];
volumes = [
"${rwPath}/db:/var/lib/postgresql/data"
];
environment = {
POSTGRES_PASSWORD = "\${DB_PASSWORD}";
POSTGRES_USER = "\${DB_USERNAME}";
POSTGRES_DB = "\${DB_DATABASE_NAME}";
};
};
};
}