about summary refs log tree commit diff
path: root/pkgs/applications/misc
diff options
context:
space:
mode:
authorEmery Hemingway <ehmry@posteo.net>2022-07-11 18:23:52 -0500
committerehmry <ehmry@posteo.net>2022-08-19 13:11:27 -0500
commitb5526585c2de2e66c9111a5484dee65806acbcf5 (patch)
tree72625ad307637114914f9266658d7ad78e52c785 /pkgs/applications/misc
parent1a9c66f883bd8ccd71279a7faabe1a5556b9ccb2 (diff)
treewide: inject xdg-open into wrappers as $PATH suffix
The xdg-open utility is only ever a runtime dependency and its
dependents only expect that it accept a URI as a command line
argument and do something with it that the user would expect.
For such as a trivial relationship it should be possible for
users to override xdg-open with something else in their PATH.
Diffstat (limited to 'pkgs/applications/misc')
-rw-r--r--pkgs/applications/misc/1password-gui/beta.nix3
-rw-r--r--pkgs/applications/misc/1password-gui/default.nix3
-rw-r--r--pkgs/applications/misc/avrdudess/default.nix2
-rw-r--r--pkgs/applications/misc/far2l/default.nix5
-rw-r--r--pkgs/applications/misc/nwg-drawer/default.nix3
5 files changed, 10 insertions, 6 deletions
diff --git a/pkgs/applications/misc/1password-gui/beta.nix b/pkgs/applications/misc/1password-gui/beta.nix
index 310df03b766cf..bd1b0b6e0e63f 100644
--- a/pkgs/applications/misc/1password-gui/beta.nix
+++ b/pkgs/applications/misc/1password-gui/beta.nix
@@ -126,8 +126,9 @@ in stdenv.mkDerivation rec {
       # Electron is trying to open udev via dlopen()
       # and for some reason that doesn't seem to be impacted from the rpath.
       # Adding udev to LD_LIBRARY_PATH fixes that.
+      # Make xdg-open overrideable at runtime.
       makeWrapper $out/share/1password/1password $out/bin/1password \
-        --prefix PATH : ${lib.makeBinPath [ xdg-utils ]} \
+        --suffix PATH : ${lib.makeBinPath [ xdg-utils ]} \
         --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ udev ]}
 
       runHook postInstall
diff --git a/pkgs/applications/misc/1password-gui/default.nix b/pkgs/applications/misc/1password-gui/default.nix
index 9a09cb10f62c2..ead45054cc286 100644
--- a/pkgs/applications/misc/1password-gui/default.nix
+++ b/pkgs/applications/misc/1password-gui/default.nix
@@ -126,8 +126,9 @@ in stdenv.mkDerivation rec {
       # Electron is trying to open udev via dlopen()
       # and for some reason that doesn't seem to be impacted from the rpath.
       # Adding udev to LD_LIBRARY_PATH fixes that.
+      # Make xdg-open overrideable at runtime.
       makeWrapper $out/share/1password/1password $out/bin/1password \
-        --prefix PATH : ${lib.makeBinPath [ xdg-utils ]} \
+        --suffix PATH : ${lib.makeBinPath [ xdg-utils ]} \
         --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ udev ]}
 
       runHook postInstall
diff --git a/pkgs/applications/misc/avrdudess/default.nix b/pkgs/applications/misc/avrdudess/default.nix
index 20c36b745893c..e4047e26b8469 100644
--- a/pkgs/applications/misc/avrdudess/default.nix
+++ b/pkgs/applications/misc/avrdudess/default.nix
@@ -25,7 +25,7 @@ stdenv.mkDerivation {
     export LD_LIBRARY_PATH="${lib.makeLibraryPath [gtk2 mono]}"
     # We need PATH from user env for xdg-open to find its tools, which
     # typically depend on the currently running desktop environment.
-    export PATH="${lib.makeBinPath [ avrdude xdg-utils ]}:\$PATH"
+    export PATH="\$PATH:${lib.makeBinPath [ avrdude xdg-utils ]}"
 
     # avrdudess must have its resource files in its current working directory
     cd $out/avrdudess && exec ${mono}/bin/mono "$out/avrdudess/avrdudess.exe" "\$@"
diff --git a/pkgs/applications/misc/far2l/default.nix b/pkgs/applications/misc/far2l/default.nix
index f7637534de048..aafc332f6b9cb 100644
--- a/pkgs/applications/misc/far2l/default.nix
+++ b/pkgs/applications/misc/far2l/default.nix
@@ -61,12 +61,13 @@ stdenv.mkDerivation rec {
     PYTHON = withPython;
   };
 
-  runtimeDeps = [ unzip zip p7zip xz gzip bzip2 gnutar xdg-utils ];
+  runtimeDeps = [ unzip zip p7zip xz gzip bzip2 gnutar ];
 
   postInstall = ''
     wrapProgram $out/bin/far2l \
       --argv0 $out/bin/far2l \
-      --prefix PATH : ${lib.makeBinPath runtimeDeps}
+      --prefix PATH : ${lib.makeBinPath runtimeDeps} \
+      --suffix PATH : ${lib.makeBinPath [ xdg-utils ]}
   '';
 
   meta = with lib; {
diff --git a/pkgs/applications/misc/nwg-drawer/default.nix b/pkgs/applications/misc/nwg-drawer/default.nix
index 1aa4a3660c2eb..f15279ff43932 100644
--- a/pkgs/applications/misc/nwg-drawer/default.nix
+++ b/pkgs/applications/misc/nwg-drawer/default.nix
@@ -33,8 +33,9 @@ buildGoModule rec {
   '';
 
   preFixup = ''
+    # make xdg-open overrideable at runtime
     gappsWrapperArgs+=(
-      --prefix PATH : ${xdg-utils}/bin
+      --suffix PATH : ${xdg-utils}/bin
       --prefix XDG_DATA_DIRS : $out/share
     )
   '';