{ config, pkgs, modulesPath, lib, system, ... }: { config = { sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; sops.defaultSopsFile = ../../secrets/photos.yaml; networking.hostName = "photos"; hardware.graphics.enable = true; hardware.nvidia = { modesetting.enable = true; nvidiaPersistenced = true; powerManagement.enable = false; powerManagement.finegrained = false; open = false; nvidiaSettings = true; package = config.boot.kernelPackages.nvidiaPackages.legacy_580; }; services.xserver.videoDrivers = [ "nvidia" ]; nixpkgs.config.allowUnfree = true; # 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/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"; }; "/mnt/data/stephanie/legacy-media" = { device = "nas.bacala:/mnt/tank/customers/stephanie/legacy-media"; fsType = "nfs"; }; "/mnt/data/stephanie/phone/camera" = { device = "nas.bacala:/mnt/tank/customers/stephanie/phone/camera"; fsType = "nfs"; }; "/mnt/data/stephanie/phone/pics" = { device = "nas.bacala:/mnt/tank/customers/stephanie/phone/pics"; fsType = "nfs"; }; }; }; }