awesome: use makeWrapper rather than wrapProgram

Using wrapProgram makes so that the generated "awesome" wrapper duplicates its
command line options at every restart.

As @psychon puts it:

> AwesomeWM restarts via execvp(argv[0], argv). In NixOS, wrapProgram is used
> to generate a wrapper around the real binary. wrapProgram calls makeWrapper
> with --argv0 '$0'. I guess this is what makes awesomeWM run the wrapper again
> on restart. Without this --argv0 awesomeWM would directly restart itself
> instead of the wrapper, I think.
This commit is contained in:
Stefano Mazzucco 2019-05-02 22:27:52 +01:00
parent 69cf07ec0f
commit 88f84c08d7

View File

@ -48,7 +48,10 @@ with luaPackages; stdenv.mkDerivation rec {
LUA_PATH = "${lgi}/share/lua/${lua.luaversion}/?.lua;;";
postInstall = ''
wrapProgram $out/bin/awesome \
# Don't use wrapProgram or or the wrapper will duplicate the --search
# arguments every restart
mv "$out/bin/awesome" "$out/bin/.awesome-wrapped"
makeWrapper "$out/bin/.awesome-wrapped" "$out/bin/awesome" \
--set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" \
--add-flags '--search ${lgi}/lib/lua/${lua.luaversion}' \
--add-flags '--search ${lgi}/share/lua/${lua.luaversion}' \