[Nix-dev] [PATCH 2/2] Only set font in wrapper if we have X.

David Brown nix at davidb.org
Mon May 17 17:48:45 CEST 2010


Unison's wrapper was generating errors by calling xset even if DISPLAY
was not set.  This was especially noticeable when connecting to a
remote server to sync with.

Fix this by only setting the font path if DISPLAY is set to something.
---
 .../networking/sync/unison/default.nix             |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pkgs/applications/networking/sync/unison/default.nix b/pkgs/applications/networking/sync/unison/default.nix
index ff4ab60..7738ce4 100644
--- a/pkgs/applications/networking/sync/unison/default.nix
+++ b/pkgs/applications/networking/sync/unison/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation (rec {
   postInstall = ''
     for i in $(cd $out/bin && ls); do
       wrapProgram $out/bin/$i \
-        --run "${xset}/bin/xset q | grep -q \"${fontschumachermisc}\" || ${xset}/bin/xset +fp \"${fontschumachermisc}/lib/X11/fonts/misc\""
+        --run "[ -n \"\$DISPLAY\" ] && (${xset}/bin/xset q | grep -q \"${fontschumachermisc}\" || ${xset}/bin/xset +fp \"${fontschumachermisc}/lib/X11/fonts/misc\")"
     done
   '';
 
-- 
1.7.1




More information about the nix-dev mailing list