aboutsummaryrefslogtreecommitdiff
path: root/nix/per-host
diff options
context:
space:
mode:
Diffstat (limited to 'nix/per-host')
-rw-r--r--nix/per-host/photos/configuration.nix49
1 files changed, 42 insertions, 7 deletions
diff --git a/nix/per-host/photos/configuration.nix b/nix/per-host/photos/configuration.nix
index 15f1953..ca9d736 100644
--- a/nix/per-host/photos/configuration.nix
+++ b/nix/per-host/photos/configuration.nix
@@ -6,12 +6,8 @@
sops.defaultSopsFile = ../../secrets/photos.yaml;
networking.hostName = "photos";
- networking.firewall.allowedTCPPorts = [ 80 443 ];
-
- hardware.graphics = {
- enable = true;
- };
+ hardware.graphics.enable = true;
hardware.nvidia = {
modesetting.enable = true;
nvidiaPersistenced = true;
@@ -21,20 +17,59 @@
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.legacy_580;
};
+ services.xserver.videoDrivers = [ "nvidia" ];
nixpkgs.config.allowUnfree = true;
- services.xserver.videoDrivers = [ "nvidia" ];
+ # Immich 3.1.x ML is broken, we a patch to remove OpenVINO
+ # See: https://github.com/immich-app/immich/issues/25830
+ services.immich.package = pkgs.immich.overrideAttrs (old: {
+ passthru = (old.passthru or { }) // {
+ machine-learning = pkgs.immich.machine-learning.overrideAttrs (old: {
+ postPatch = (old.postPatch or "") + ''
+ substituteInPlace immich_ml/models/constants.py \
+ --replace-fail '"OpenVINOExecutionProvider",' ""
+ substituteInPlace test_main.py \
+ --replace-fail "def test_sets_openvino_provider_if_available" "def skipped_sets_openvino_provider_if_available"
+ '';
+ });
+ };
+ });
+
+ services.immich = {
+ enable = true;
+ host = "0.0.0.0";
+ openFirewall = true;
+ environment.LD_LIBRARY_PATH = "/run/opengl-driver/lib";
+ accelerationDevices = null;
+ settings = {
+ server.externalDomain = "https://photos.kumardamani.net";
+ ffmpeg.accel = "nvenc";
+ ffmpeg.accelDecode = true;
+ machineLearning.ocr.enabled = false;
+ library.scan = {
+ enabled = true;
+ cronExpression = "0 * * * *";
+ };
+ image.previewSize = 1080;
+ };
+ };
+
+ services.immich.environment.IMMICH_LOG_LEVEL = "warn";
fileSystems = {
"/mnt/data/kumar/legacy-media" = {
device = "nas.bacala:/mnt/tank/customers/kumar/legacy-media";
fsType = "nfs";
};
- "/mnt/data/kumar/camera" = {
+ "/mnt/data/kumar/phone/camera" = {
device = "nas.bacala:/mnt/tank/customers/kumar/phone/camera";
fsType = "nfs";
};
+ "/mnt/data/kumar/phone/pics" = {
+ device = "nas.bacala:/mnt/tank/customers/kumar/phone/pics";
+ fsType = "nfs";
+ };
};
};
}