timeshift: timeshift-launcher: hard-code the timeshift-gtk path

+7 -2
+2 -2
pkgs/applications/backup/timeshift/unwrapped.nix
··· 35 35 substituteInPlace ./src/Utility/IconManager.vala \ 36 36 --replace-fail "/usr/share" "$out/share" 37 37 38 - # Substitute app_command to look for the `timeshift-gtk` in the same directory as the executed `timeshift-launcher`. 38 + # Substitute app_command to look for the `timeshift-gtk` in $out. 39 39 # Substitute the `pkexec ...` as a hack to run a GUI application like Timeshift as root without setting up the corresponding pkexec policy. 40 40 substituteInPlace ./src/timeshift-launcher \ 41 - --replace-fail "app_command='timeshift-gtk'" ${lib.escapeShellArg ''app_command="$(realpath "$(dirname "$0")")/timeshift-gtk"''} \ 41 + --replace-fail "app_command='timeshift-gtk'" "app_command=$out/bin/timeshift-gtk" \ 42 42 --replace-fail ${lib.escapeShellArg ''pkexec ''${app_command}''} ${lib.escapeShellArg ''pkexec env DISPLAY="$DISPLAY" XAUTHORITY="$XAUTHORITY" "''${app_command}"''} 43 43 ''; 44 44
+5
pkgs/applications/backup/timeshift/wrapper.nix
··· 39 39 ) 40 40 wrapProgram "$out/bin/timeshift" "''${makeWrapperArgs[@]}" 41 41 wrapProgram "$out/bin/timeshift-gtk" "''${gappsWrapperArgs[@]}" 42 + # Substitute app_command to look for the `timeshift-gtk` in $out. 43 + unlink "$out/bin/timeshift-launcher" 44 + substitute ${lib.getExe' timeshift-unwrapped "timeshift-launcher"} "$out/bin/timeshift-launcher" \ 45 + --replace-fail "app_command=${lib.getExe' timeshift-unwrapped "timeshift-gtk"}" "app_command=$out/bin/timeshift-gtk" 46 + chmod +x "$out/bin/timeshift-launcher" 42 47 ''; 43 48 44 49 inherit (timeshift-unwrapped) meta;