diff --git a/nixos/modules/services/x11/window-managers/awesome.nix b/nixos/modules/services/x11/window-managers/awesome.nix index eb97449c6bd9..71eb02ec5954 100644 --- a/nixos/modules/services/x11/window-managers/awesome.nix +++ b/nixos/modules/services/x11/window-managers/awesome.nix @@ -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 { @@ -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=$! ''; }; diff --git a/pkgs/applications/window-managers/awesome/default.nix b/pkgs/applications/window-managers/awesome/default.nix index 4043c05e3d6d..ca596cdfddc1 100644 --- a/pkgs/applications/window-managers/awesome/default.nix +++ b/pkgs/applications/window-managers/awesome/default.nix @@ -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 ]}"