{ lib, pkg-config, libjpeg_turbo, libheif, lapack, dlib, blas, ffmpeg, exiftool, darktable, fetchFromGitHub, buildGoModule, buildNpmPackage, runCommandLocal, makeWrapper, }: buildGoModule rec { pname = "photoview"; version = "2.4.0"; source = fetchFromGitHub { name = "${pname}-src"; owner = pname; repo = pname; rev = "refs/tags/v${version}"; hash = "sha256-ZfvBdQlyqONsrviZGL22Kt+AiPaVWwdoREDUrHDYyIs="; }; src = source + "/api"; vendorHash = "sha256-Tn4OxSV41s/4n2Q3teJRJNc39s6eKW4xE9wW/CIR5Fg="; nativeBuildInputs = [ pkg-config makeWrapper ]; buildInputs = [ libjpeg_turbo libheif lapack dlib blas ]; ui = buildNpmPackage { pname = "${pname}-ui"; inherit version; src = source + "/ui"; #REACT_APP_API_ENDPOINT = ""; REACT_APP_BUILD_VERSION = version; REACT_APP_BUILD_DATE = builtins.readFile (runCommandLocal "date" { } "date -uI > $out"); REACT_APP_BUILD_COMMIT_SHA = "nix"; npmDepsHash = "sha256-wUbfq+7SuJUBxfy9TxHVda8A0g4mmYCbzJT64XBN2mI="; }; postInstall = '' mkdir -p "$out/lib/${pname}" mv "$out/bin/api" "$out/bin/${pname}" wrapProgram $out/bin/${pname} \ --prefix PATH ":" "${ lib.makeBinPath [ ffmpeg exiftool darktable ] }" \ --set PHOTOVIEW_SERVE_UI 1 \ --set PHOTOVIEW_UI_PATH "$out/lib/${pname}/ui" cp -r \ "${src}/data/" \ "$out/lib/${pname}/data/" cp -r \ "${ui}/lib/node_modules/photoview-ui/dist" \ "$out/lib/${pname}/ui" ''; }