feat(immich): add synology external library
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
6adb3eca18
commit
a7d1d64472
2 changed files with 49 additions and 6 deletions
2
configurations/nos/modules/docker/immich/.gitignore
vendored
Normal file
2
configurations/nos/modules/docker/immich/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# upload script with secrets
|
||||
upload.sh
|
|
@ -1,28 +1,64 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) attrValues;
|
||||
|
||||
inherit (config.sops) secrets;
|
||||
inherit (config.khepri) rwDataDir;
|
||||
|
||||
rwPath = rwDataDir + "/immich";
|
||||
|
||||
UPLOAD_LOCATION = "${rwPath}/data";
|
||||
synologyPath = "/var/lib/synology-immich";
|
||||
in {
|
||||
# NFS client setup
|
||||
services.rpcbind.enable = true;
|
||||
boot.supportedFilesystems = ["nfs"];
|
||||
|
||||
environment.systemPackages = attrValues {
|
||||
inherit
|
||||
(pkgs)
|
||||
nfs-utils
|
||||
immich-go # for uploading google photos
|
||||
;
|
||||
};
|
||||
|
||||
systemd.mounts = let
|
||||
host = "10.0.0.117";
|
||||
in [
|
||||
{
|
||||
type = "nfs";
|
||||
mountConfig = {
|
||||
Options = "noatime";
|
||||
};
|
||||
what = "${host}:/volume1/Photo-Immich";
|
||||
where = synologyPath;
|
||||
requiredBy = ["docker-immich_immich_server.service"];
|
||||
}
|
||||
];
|
||||
|
||||
# Docker compose
|
||||
khepri.compositions."immich" = {
|
||||
networks.proxy_net = {external = true;};
|
||||
|
||||
services = {
|
||||
"immich_server" = {
|
||||
image = import ./images/server.nix pkgs;
|
||||
|
||||
restart = "always";
|
||||
|
||||
environmentFiles = [
|
||||
"${./env}"
|
||||
./env
|
||||
secrets.immich.path
|
||||
];
|
||||
|
||||
volumes = [
|
||||
# "${synologyPath}:/usr/src/app/upload:rw"
|
||||
"${UPLOAD_LOCATION}:/usr/src/app/upload:rw"
|
||||
"${synologyPath}:${synologyPath}:rw"
|
||||
];
|
||||
ports = [
|
||||
"2283:2283"
|
||||
|
@ -30,16 +66,17 @@ in {
|
|||
networks = ["proxy_net"];
|
||||
|
||||
dependsOn = ["immich_redis" "immich_postgres"];
|
||||
restart = "always";
|
||||
|
||||
environment.NODE_ENV = "production";
|
||||
};
|
||||
|
||||
"immich_machine_learning" = {
|
||||
image = import ./images/machine-learning.nix pkgs;
|
||||
|
||||
restart = "always";
|
||||
|
||||
environmentFiles = [
|
||||
"${./env}"
|
||||
./env
|
||||
secrets.immich.path
|
||||
];
|
||||
networks = ["proxy_net"];
|
||||
|
@ -51,20 +88,24 @@ in {
|
|||
|
||||
"immich_redis" = {
|
||||
image = import ./images/redis.nix pkgs;
|
||||
|
||||
restart = "always";
|
||||
tmpfs = ["/data"];
|
||||
|
||||
environmentFiles = [
|
||||
"${./env}"
|
||||
./env
|
||||
secrets.immich.path
|
||||
];
|
||||
networks = ["proxy_net"];
|
||||
tmpfs = ["/data"];
|
||||
};
|
||||
|
||||
"immich_postgres" = {
|
||||
image = import ./images/postgres.nix pkgs;
|
||||
|
||||
restart = "always";
|
||||
|
||||
environmentFiles = [
|
||||
"${./env}"
|
||||
./env
|
||||
secrets.immich.path
|
||||
];
|
||||
networks = ["proxy_net"];
|
||||
|
|
Loading…
Reference in a new issue