migrating immich

This commit is contained in:
ari committed 2026-10-13 19:52:27 -04:00
1 parent 41968e63d2
commit cd48b65656
16 files changed
+147 -31

No files matched your search

+1 -1
View File
@@ -55,7 +55,7 @@
]
},
"position": "top",
"transparent": true
"transparent": false
},
"idle": {
"lock": 300,
+1
View File
@@ -172,6 +172,7 @@
buildbot-gitea-token = ./secrets/buildbot-gitea-token.age;
buildbot-gitea-webhook-secret = ./secrets/buildbot-gitea-webhook-secret.age;
buildbot-gitea-oauth-secret = ./secrets/buildbot-gitea-oauth-secret.age;
immich-shared = ./secrets/immich-shared.age;
};
inherit
hyprlauncher
+1 -1
View File
@@ -34,7 +34,7 @@ hosts/
| `hl-fwdesk/` | hl-fwdesk | Framework Desktop AI Max 300 — AI workstation; buildbot-nix CI worker (4 cores) |
| `hl-fws1/` | hl-fws1 | Framework 11th Intel — K3s server node |
| `hl-bigbox1/` | hl-bigbox1 | AI/compute server (NVIDIA + AMD) |
| `hl-bigbox2/` | hl-bigbox2 | NFS storage server |
| `hl-bigbox2/` | hl-bigbox2 | NFS storage server; Immich (docker, `immich.home.sosnovsky.ca`) |
| `hl-minipc1/` | hl-minipc1 | Core infra: Gitea (native or containerized), nix-serve, registry, Buzz (docker, `buzz-manage` CLI) |
| `hl-minipc2/` | hl-minipc2 | Container/media server |
| `hl-minipc3/` | hl-minipc3 | K3s worker node; central Caddy reverse-proxy (`*.home.sosnovsky.ca`, plus `gitea.skyg.ca` HTTP/SSH); buildbot-nix CI master + worker (2 cores) |
+7 -13
View File
@@ -1,16 +1,7 @@
{ config, lib, pkgs, ... }:
let
ports = {
nixServe = 5000;
lockdPort = 4001;
mountdPort = 4002;
statdPort = 4000;
};
openPorts = builtins.attrValues ports;
in
{ lib, ... }:
{
imports = [
./services.nix
./services
./hardware-configuration
./hardware.nix
];
@@ -23,6 +14,11 @@ in
nixos.common = {
ssh-server.enable = true;
containers.openMetricsPort = true;
containers.networks.ipvlanLab = {
enable = true;
parent = "enp3s0";
};
cachePush.enable = false;
};
server.exporters.enable = true;
networkDrives = {
@@ -30,6 +26,4 @@ in
bigBox2.enable = false;
};
};
skyg.nixos.common.cachePush.enable = false;
}
+8
View File
@@ -0,0 +1,8 @@
{ ... }:
{
imports = [
./nix-serve.nix
./nfs-server.nix
./immich.nix
];
}
+86
View File
@@ -0,0 +1,86 @@
{ config, skygUtils, skyg-secrets, ... }:
let
version = "v3";
app = config.skyg.internalNetworkingMap.apps.immich;
envVars = {
REDIS_PORT = "6379";
REDIS_HOSTNAME = "redis";
DB_HOSTNAME = "database";
DB_USERNAME = "immich";
POSTGRES_USER = "immich";
POSTGRES_DB = "immich";
DB_DATABASE_NAME = "immich";
};
nfsVolume = skygUtils.container-services.nfs.tnas1;
in
{
age.secrets.immich-shared.file = skyg-secrets.immich-shared;
skyg.nixos.common.container-services.immich = {
enable = true;
autoUpdate.enable = true;
networks = {
main = { driver = "bridge"; };
lan = config.skyg.nixos.common.containers.networks.ipvlanLab.compose;
};
volumes = {
family-storage = nfsVolume "/mnt/EightTerra/FamilyStorage";
model-cache = { };
};
services.immich-server = {
image = "ghcr.io/immich-app/immich-server:${version}";
environmentFiles = [ config.age.secrets.immich-shared.path ];
environment = envVars;
networks = {
lan.ipv4_address = app.ip;
main = { };
};
volumes = [
"/data/fourTerra/immich-upload:/usr/src/app/upload"
"family-storage:/family-storage"
];
extraConfig.depends_on = {
database.condition = "service_healthy";
redis.condition = "service_healthy";
};
restart = "always";
};
services.immich-machine-learning = {
image = "ghcr.io/immich-app/immich-machine-learning:${version}";
environmentFiles = [ config.age.secrets.immich-shared.path ];
environment = envVars;
networks.main = { };
volumes = [ "model-cache:/cache" ];
restart = "always";
};
services.redis = {
image = "docker.io/valkey/valkey:9@sha256:c123e3715db63d06d4ad6964884037aa0d5d4d703939b9929954112889708e1d";
networks.main = { };
healthcheck = {
test = [ "CMD-SHELL" "redis-cli ping || exit 1" ];
interval = "30s";
timeout = "5s";
retries = 5;
start_period = "10s";
};
restart = "always";
};
services.database = {
image = "ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:bcf63357191b76a916ae5eb93464d65c07511da41e3bf7a8416db519b40b1c23";
environmentFiles = [ config.age.secrets.immich-shared.path ];
environment.POSTGRES_INITDB_ARGS = "--data-checksums";
networks.main = { };
volumes = [ "/data/fourTerra/immich-db:/var/lib/postgresql/data" ];
healthcheck = {
test = [ "CMD-SHELL" ''pg_isready --dbname="$$POSTGRES_DB" --username="$$POSTGRES_USER" || exit 1'' ];
interval = "5m";
timeout = "10s";
retries = 5;
start_period = "5m";
start_interval = "30s";
};
restart = "always";
};
};
}
@@ -1,7 +1,6 @@
{ ... }:
let
ports = {
nixServe = 5000;
lockdPort = 4001;
mountdPort = 4002;
statdPort = 4000;
@@ -9,12 +8,6 @@ let
openPorts = builtins.attrValues ports;
in
{
services.nix-serve = {
enable = true;
secretKeyFile = "/home/ari/cache-keys/cache-priv-key.pem";
port = ports.nixServe;
};
skyg.nixos.common.networking.nfsServer.enable = true;
services.nfs.server = {
lockdPort = ports.lockdPort;
+16
View File
@@ -0,0 +1,16 @@
{ ... }:
let
ports = {
nixServe = 5000;
};
openPorts = builtins.attrValues ports;
in
{
services.nix-serve = {
enable = true;
secretKeyFile = "/home/ari/cache-keys/cache-priv-key.pem";
port = ports.nixServe;
};
networking.firewall.allowedUDPPorts = openPorts;
networking.firewall.allowedTCPPorts = openPorts;
}
+2 -8
View File
@@ -1,12 +1,6 @@
{ config, ... }:
{ config, skygUtils, ... }:
let
nfsVolume = exportPath: {
driver_opts = {
type = "nfs";
o = "addr=tnas1.lab.internal,rw,nfsvers=4.0,nolock,hard,noatime";
device = ":${exportPath}";
};
};
nfsVolume = skygUtils.container-services.nfs.tnas1;
app = config.skyg.internalNetworkingMap.apps.buzz;
buzz = {
domain = app.effectiveDns;
+5
View File
@@ -3,6 +3,7 @@ let
app = config.skyg.internalNetworkingMap.apps.caddy;
nvr = config.skyg.internalNetworkingMap.apps.nvr;
jellyfin = config.skyg.internalNetworkingMap.apps.jellyfin;
immich = config.skyg.internalNetworkingMap.apps.immich;
portainer = config.skyg.internalNetworkingMap.apps.portainer;
publicGitea = config.skyg.internalNetworkingMap.apps.public-gitea;
certDomain = "home.sosnovsky.ca";
@@ -36,6 +37,10 @@ in
tls /etc/caddy/tls/fullchain.pem /etc/caddy/tls/key.pem
reverse_proxy bigbox1.lab.internal:8096
}
immich.home.sosnovsky.ca {
tls /etc/caddy/tls/fullchain.pem /etc/caddy/tls/key.pem
reverse_proxy ${immich.ip}:2283
}
portainer.home.sosnovsky.ca {
tls /etc/caddy/tls/fullchain.pem /etc/caddy/tls/key.pem
reverse_proxy ${portainer.ip}:9000
+2
View File
@@ -109,6 +109,7 @@ in
audiobooks = { ip = "10.0.101.4"; };
gitea = { ip = "10.0.101.8"; };
public-gitea = { ip = "10.0.101.9"; };
immich = { ip = "10.0.101.10"; };
jellyfin = { ip = "10.0.101.5"; };
nvr = { ip = "10.0.101.6"; };
portainer = { ip = "10.0.101.241"; };
@@ -118,6 +119,7 @@ in
"nvr.home.sosnovsky.ca"
"jellyfin.home.sosnovsky.ca"
"portainer.home.sosnovsky.ca"
"immich.home.sosnovsky.ca"
"gitea.skyg.ca"
];
};
-1
View File
@@ -2,7 +2,6 @@
, lib
, pkgs
, skygUtils
, unstablePkgs
, ...
}:
let
+14
View File
@@ -67,4 +67,18 @@
'';
};
};
container-services = rec {
makeNfsVolumeFactory = host: exportPath: {
driver_opts = {
type = "nfs";
o = "addr=${host},rw,nfsvers=4.0,nolock,hard,noatime";
device = ":${exportPath}";
};
};
nfsVols = {
terra1 = makeNfsVolumeFactory "terra1.lab.internal";
tnas1 = makeNfsVolumeFactory "tnas1.lab.internal";
bigbox2 = makeNfsVolumeFactory "bigbox2.lab.internal";
};
};
}
+4
View File
@@ -6,6 +6,7 @@ let
terra1 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHBKI8gqd7DDubShle4D3JGq61BP1NBKCZ81V3C9uyym root@nixos";
fwdesk = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHbBcdMpNPaELUzHRIoRkTUQde+mBQ87Ra2R+974FuUy root@hl-fwdesk";
bigbox1 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFl5xiH4aFlmDWdoU+KmERLYOeOQK2aKP7jenY2G3rFb root@nixos";
bigbox2 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL6l6VqQ23PkGkWVABBoLp1KA6PzkX5oKTy5RBHbQXet root@hl-bigbox2";
in
{
"secrets/dns-addresses.conf.age".publicKeys = [
@@ -49,4 +50,7 @@ in
"secrets/buildbot-gitea-token.age".publicKeys = [ ari minipc3 ];
"secrets/buildbot-gitea-webhook-secret.age".publicKeys = [ ari minipc3 ];
"secrets/buildbot-gitea-oauth-secret.age".publicKeys = [ ari minipc3 ];
# immich
"secrets/immich-shared.age".publicKeys = [ ari bigbox2 ];
}
Binary file not shown.
Binary file not shown.