mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-04-15 02:47:53 +00:00
syncthingtray: Fix Nix wrapped path in autostart desktop generation
Fixes #199596.
This commit is contained in:
parent
78bc5aad0b
commit
24afcac703
@ -1,6 +1,7 @@
|
||||
{ mkDerivation
|
||||
, lib
|
||||
, fetchFromGitHub
|
||||
, substituteAll
|
||||
, qtbase
|
||||
, qtwebengine
|
||||
, qtdeclarative
|
||||
@ -31,6 +32,17 @@ mkDerivation rec {
|
||||
sha256 = "sha256-uhVRO9aiYJbUmwDp1+LIYF3wNBbVduVpTtVzaS0oUMU=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Fix Exec= path in runtime-generated
|
||||
# ~/.config/autostart/syncthingtray.desktop file - this is required because
|
||||
# we are wrapping the executable. We can't use `substituteAll` because we
|
||||
# can't use `${placeholder "out"}` because that will produce the $out of
|
||||
# the patch derivation itself, and not of syncthing's "out" placeholder.
|
||||
# Hence we use a C definition with NIX_CFLAGS_COMPILE
|
||||
./use-nix-path-in-autostart.patch
|
||||
];
|
||||
NIX_CFLAGS_COMPILE = "-DEXEC_NIX_PATH=\"${placeholder "out"}/bin/syncthingtray\"";
|
||||
|
||||
buildInputs = [
|
||||
qtbase
|
||||
cpp-utilities
|
||||
|
@ -0,0 +1,13 @@
|
||||
diff --git i/widgets/settings/settingsdialog.cpp w/widgets/settings/settingsdialog.cpp
|
||||
index 4deff1f..16845b5 100644
|
||||
--- i/widgets/settings/settingsdialog.cpp
|
||||
+++ w/widgets/settings/settingsdialog.cpp
|
||||
@@ -802,7 +802,7 @@ bool setAutostartEnabled(bool enabled)
|
||||
desktopFile.write("[Desktop Entry]\n"
|
||||
"Name=" APP_NAME "\n"
|
||||
"Exec=\"");
|
||||
- desktopFile.write(qEnvironmentVariable("APPIMAGE", QCoreApplication::applicationFilePath()).toUtf8().data());
|
||||
+ desktopFile.write(qEnvironmentVariable("APPIMAGE", EXEC_NIX_PATH).toUtf8().data());
|
||||
desktopFile.write("\" qt-widgets-gui --single-instance\nComment=" APP_DESCRIPTION "\n"
|
||||
"Icon=" PROJECT_NAME "\n"
|
||||
"Type=Application\n"
|
Loading…
Reference in New Issue
Block a user