unison: fix unison-fsmonitor wrapper in an empty PATH

Fixes:
/nix/store/hyk3aky49zm2chq5cwclrsm56iqwfzwj-unison-2.51.2/bin/unison-fsmonitor: line 2: grep: command not found

Happens when running unison in a systemd service.
This commit is contained in:
Symphorien Gibol 2020-04-22 12:00:00 +00:00 committed by Bjørn Forsman
parent c351f2877c
commit e726e341c6

View file

@ -1,4 +1,4 @@
{stdenv, fetchFromGitHub, ocamlPackages, fontschumachermisc, xset, makeWrapper, ncurses
{stdenv, fetchFromGitHub, ocamlPackages, fontschumachermisc, xset, makeWrapper, ncurses, gnugrep
, enableX11 ? true}:
let inherit (ocamlPackages) ocaml lablgtk; in
@ -38,7 +38,7 @@ stdenv.mkDerivation (rec {
postInstall = if enableX11 then ''
for i in $(cd $out/bin && ls); do
wrapProgram $out/bin/$i \
--run "[ -n \"\$DISPLAY\" ] && (${xset}/bin/xset q | grep -q \"${fontschumachermisc}\" || ${xset}/bin/xset +fp \"${fontschumachermisc}/lib/X11/fonts/misc\")"
--run "[ -n \"\$DISPLAY\" ] && (${xset}/bin/xset q | ${gnugrep}/bin/grep -q \"${fontschumachermisc}\" || ${xset}/bin/xset +fp \"${fontschumachermisc}/lib/X11/fonts/misc\")"
done
'' else "";