diff --git a/package/photoview/default.nix b/package/photoview/default.nix index d4d8e4a4..40194a29 100644 --- a/package/photoview/default.nix +++ b/package/photoview/default.nix @@ -11,6 +11,7 @@ , fetchFromGitHub , buildGoModule , buildNpmPackage +, runCommandLocal , makeWrapper }: buildGoModule rec { pname = "photoview"; version = "2.3.13"; @@ -41,12 +42,19 @@ 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-31CyjyNd85hNg4MXIWctoQ3YgorGqCMz+wDAu/K1lWo="; }; postInstall = '' - mv "$out/bin/api" "$out/bin/${pname}" mkdir -p "$out/lib/${pname}" + + mv "$out/bin/api" "$out/bin/${pname}" wrapProgram $out/bin/${pname} \ --prefix PATH ":" "${lib.makeBinPath [ ffmpeg @@ -55,6 +63,9 @@ ]}" \ --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" \