From 84d482f423123e932d83276c4d1ed46fc8956d3c Mon Sep 17 00:00:00 2001 From: Elliot Cameron Date: Thu, 9 May 2024 17:50:20 -0400 Subject: [PATCH] terminator: don't bleed PATH into session via wrapper Fixes: #47290 --- .../terminal-emulators/terminator/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/terminal-emulators/terminator/default.nix b/pkgs/applications/terminal-emulators/terminator/default.nix index 3eb374af71ab..175d3766594b 100644 --- a/pkgs/applications/terminal-emulators/terminator/default.nix +++ b/pkgs/applications/terminal-emulators/terminator/default.nix @@ -7,6 +7,7 @@ , gtk3 , gobject-introspection , libnotify +, makeBinaryWrapper , wrapGAppsHook3 , vte , nixosTests @@ -27,6 +28,7 @@ python3.pkgs.buildPythonApplication rec { file intltool gobject-introspection + makeBinaryWrapper wrapGAppsHook3 python3.pkgs.pytest-runner ]; @@ -55,8 +57,15 @@ python3.pkgs.buildPythonApplication rec { dontWrapGApps = true; + # HACK: 'wrapPythonPrograms' will add things to the $PATH in the wrapper. This bleeds into the + # terminal session produced by terminator. To avoid this, we force wrapPythonPrograms to only + # use gappsWrapperArgs by redefining wrapProgram to ignore its arguments and only apply the + # wrapper arguments we want it to use. + # TODO: Adjust wrapPythonPrograms to respect an argument that tells it to leave $PATH alone. preFixup = '' - makeWrapperArgs+=("''${gappsWrapperArgs[@]}") + wrapProgram() { + wrapProgramBinary "$1" "''${gappsWrapperArgs[@]}" + } ''; passthru.tests.test = nixosTests.terminal-emulators.terminator;