Skip to content
This repository has been archived by the owner on Apr 12, 2021. It is now read-only.

Commit

Permalink
awesome: Use --search instead of $LUA_PATH/$LUA_CPATH
Browse files Browse the repository at this point in the history
Instead of polluting the environment with environment variables which
are inherited by processes spawned from awesome, use the command line
argument "--search" to add things to the search path.

cc #33169
  • Loading branch information
psychon authored and fpletz committed Jan 2, 2018
1 parent c98eb9e commit 5465d6f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions nixos/modules/services/x11/window-managers/awesome.nix
Expand Up @@ -6,7 +6,11 @@ let

cfg = config.services.xserver.windowManager.awesome;
awesome = cfg.package;
inherit (pkgs.luaPackages) getLuaPath getLuaCPath;
getLuaPath = lib : dir : "${lib}/${dir}/lua/${pkgs.luaPackages.lua.luaversion}";
makeSearchPath = lib.concatMapStrings (path:
" --search " + (getLuaPath path "share") +
" --search " + (getLuaPath path "lib")
);
in

{
Expand Down Expand Up @@ -46,10 +50,7 @@ in
{ name = "awesome";
start =
''
export LUA_CPATH="${lib.concatStringsSep ";" (map getLuaCPath cfg.luaModules)}"
export LUA_PATH="${lib.concatStringsSep ";" (map getLuaPath cfg.luaModules)}"
${awesome}/bin/awesome &
${awesome}/bin/awesome ${makeSearchPath cfg.luaModules} &
waitPID=$!
'';
};
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/window-managers/awesome/default.nix
Expand Up @@ -49,8 +49,8 @@ with luaPackages; stdenv.mkDerivation rec {
postInstall = ''
wrapProgram $out/bin/awesome \
--set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" \
--prefix LUA_CPATH ";" '${lgi}/lib/lua/${lua.luaversion}/?.so' \
--prefix LUA_PATH ";" '${lgi}/share/lua/${lua.luaversion}/?.lua' \
--add-flags '--search ${lgi}/lib/lua/${lua.luaversion}' \
--add-flags '--search ${lgi}/share/lua/${lua.luaversion}' \
--prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH" \
--prefix LD_LIBRARY_PATH : "$LD_LIBRARY_PATH" \
--prefix PATH : "${stdenv.lib.makeBinPath [ compton unclutter procps iproute coreutils curl alsaUtils findutils xterm ]}"
Expand Down

0 comments on commit 5465d6f

Please sign in to comment.