nixos-configs/devices/nos/modules/arion/immich/compose.nix

90 lines
1.8 KiB
Nix
Raw Normal View History

2024-02-19 12:42:02 -05:00
{config, ...}: let
inherit (config.sops) secrets;
2024-02-19 12:42:02 -05:00
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 = [
2024-03-17 13:17:43 -04:00
"${./env}"
secrets.immich.path
];
2024-02-19 12:42:02 -05:00
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 = [
2024-03-17 13:17:43 -04:00
"${./env}"
secrets.immich.path
];
2024-02-19 12:42:02 -05:00
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 = [
2024-03-17 13:17:43 -04:00
"${./env}"
secrets.immich.path
];
2024-02-19 12:42:02 -05:00
volumes = [
"${rwPath}/cache:/cache"
];
};
"immich_redis" = {
image = ./images/redis.nix;
restart = "always";
tmpfs = ["/data"];
env_file = [
2024-03-17 13:17:43 -04:00
"${./env}"
secrets.immich.path
];
2024-02-19 12:42:02 -05:00
};
"immich_postgres" = {
image = ./images/postgres.nix;
restart = "always";
env_file = [
2024-03-17 13:17:43 -04:00
"${./env}"
secrets.immich.path
];
2024-02-19 12:42:02 -05:00
volumes = [
"${rwPath}/db:/var/lib/postgresql/data"
];
environment = {
POSTGRES_PASSWORD = "\${DB_PASSWORD}";
POSTGRES_USER = "\${DB_USERNAME}";
POSTGRES_DB = "\${DB_DATABASE_NAME}";
};
};
};
}