add immich to nfss
This commit is contained in:
parent
b9c7e96e1a
commit
545d7a0994
4 changed files with 301 additions and 1 deletions
|
|
@ -1,13 +1,87 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
immichConfig = import ../../../config/immich.nix;
|
||||
immichConfigJson = builtins.toJSON immichConfig;
|
||||
immichConfigFile = pkgs.writeText "immich.json" immichConfigJson;
|
||||
|
||||
commonUID = "1000";
|
||||
commonGID = "100";
|
||||
systemTZ = config.time.timeZone;
|
||||
in
|
||||
{
|
||||
# Container definitions for nfss host
|
||||
virtualisation.oci-containers.containers = {
|
||||
|
||||
immich = {
|
||||
image = "ghcr.io/imagegenius/immich:2.5.6";
|
||||
|
||||
volumes = [
|
||||
"/var/lib/immich/config:/config"
|
||||
"/var/lib/immich/photos:/photos"
|
||||
"/mnt/storage/DCIM:/library:ro"
|
||||
"${immichConfigFile}:/config/immich.json:ro"
|
||||
];
|
||||
|
||||
environment = {
|
||||
PUID = commonUID;
|
||||
PGID = commonGID;
|
||||
TZ = systemTZ;
|
||||
IMMICH_CONFIG_FILE = "/config/immich.json";
|
||||
DB_HOSTNAME = "immich-db";
|
||||
DB_USERNAME = "postgres";
|
||||
DB_PASSWORD = "postgres";
|
||||
DB_DATABASE_NAME = "postgres";
|
||||
DB_PORT = "5432";
|
||||
REDIS_HOSTNAME = "immich-redis";
|
||||
REDIS_PORT = "6379";
|
||||
MACHINE_LEARNING_HOST = "0.0.0.0";
|
||||
MACHINE_LEARNING_PORT = "3003";
|
||||
MACHINE_LEARNING_WORKERS = "1";
|
||||
MACHINE_LEARNING_WORKER_TIMEOUT = "120";
|
||||
};
|
||||
|
||||
ports = [
|
||||
"8080:8080"
|
||||
];
|
||||
|
||||
extraOptions = [
|
||||
"--network=podman"
|
||||
"--device=/dev/dri:/dev/dri"
|
||||
];
|
||||
|
||||
dependsOn = [ "immich-db" "immich-redis" ];
|
||||
autoStart = true;
|
||||
};
|
||||
|
||||
immich-db = {
|
||||
image = "docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0";
|
||||
|
||||
volumes = [
|
||||
"/var/lib/immich/db:/var/lib/postgresql/data"
|
||||
];
|
||||
|
||||
environment = {
|
||||
POSTGRES_PASSWORD = "postgres";
|
||||
POSTGRES_USER = "postgres";
|
||||
POSTGRES_DB = "postgres";
|
||||
};
|
||||
|
||||
extraOptions = [
|
||||
"--network=podman"
|
||||
];
|
||||
|
||||
autoStart = true;
|
||||
};
|
||||
|
||||
immich-redis = {
|
||||
image = "docker.io/redis:7.2-alpine";
|
||||
|
||||
extraOptions = [
|
||||
"--network=podman"
|
||||
];
|
||||
|
||||
autoStart = true;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,10 +16,30 @@
|
|||
|
||||
routers = {
|
||||
|
||||
photo = {
|
||||
rule = "Host(`photo.yanlincs.com`)";
|
||||
service = "photo";
|
||||
tls = {
|
||||
certResolver = "cloudflare";
|
||||
domains = [{
|
||||
main = "*.yanlincs.com";
|
||||
}];
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
services = {
|
||||
|
||||
photo = {
|
||||
loadBalancer = {
|
||||
serversTransport = "longTimeout";
|
||||
servers = [{
|
||||
url = "http://10.1.1.152:8080";
|
||||
}];
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue