Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

awesome: fix luaModules using pkgs.lua instead of awesome.lua #3258

Merged
merged 1 commit into from
Nov 1, 2022
Merged

awesome: fix luaModules using pkgs.lua instead of awesome.lua #3258

merged 1 commit into from
Nov 1, 2022

Conversation

necauqua
Copy link
Contributor

Mirroring my change to awesome module in nixos:
NixOS/nixpkgs@b79f9e9

Description

Checklist

  • Change is backwards compatible.

  • Code formatted with ./format.

  • Code tested through nix-shell --pure tests -A run.all.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module

    • Added myself as module maintainer. See example.

    • Added myself and the module files to .github/CODEOWNERS.

@rycee
Copy link
Member

rycee commented Sep 25, 2022

I don't use Awesome so I can't judge this very well but I assume it is appropriate.

So I'd be happy to merge, just please shorten the commit message summary to max 50 chars or so. No need to put the entire description in the summary, you can write a more expansive description inside the commit message body. See seven rules.

@necauqua
Copy link
Contributor Author

If you use awesome with a non-system lua (system lua is lua5_2 and you set awesome lua to be lua5_3 for a concrete example) then getLuaPath is completely broken - in short the lua version is mentioned twice, once as part of the lib var and equal to awesomes lua version and second time as pkgs.luaPackages.lua.luaversion (which is "5.2" in current nixpkgs) - so you get a module path which looks like ../5.3/../5.2 and never ever resolves to anything actulally existing, so luaModules never get loaded.

Didn't notice going over 50 chars, will amend

Mirroring my change to awesome module in nixos:
NixOS/nixpkgs@b79f9e9
@@ -6,7 +6,7 @@ let

cfg = config.xsession.windowManager.awesome;
awesome = cfg.package;
getLuaPath = lib: dir: "${lib}/${dir}/lua/${pkgs.luaPackages.lua.luaversion}";
getLuaPath = lib: dir: "${lib}/${dir}/lua/${awesome.lua.luaversion}";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to avoid out-of-tree reimplementation of lua utilities such as getLuaPath here. I would like to use lua flat installs in the future but that requires packages not to replicate their own lua wrapping code NixOS/nixpkgs#56398 (comment) .

I have some ongoing work to improve the lua ecosystem https://github.com/NixOS/nixpkgs/pull/177556/files#diff-558d30a16316ebf76080fb16d8b82a341313e48617e224e2acf30b5f64952990 but until then could you use https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/lua-modules/lib.nix#L39 instead ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can merge this as-is for now and do the improvement in a future PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, while I appreciate the effort of reducing duplicate code/boilerplate when dealing with Lua that you seem to be working on, this PR is a oneline fix and just mirrors the same fix I made in nixpkgs a little while ago.

I am totally out of context for the Lua ecosystem improvements you're making and a jump from 'oneline fix' to 'use the entirely new better lua system' was a bit too much for me so I forgot about this PR 😅

@teto teto merged commit 8957d53 into nix-community:master Nov 1, 2022
@necauqua necauqua deleted the patch-1 branch November 1, 2022 18:44
austinharris pushed a commit to austinharris/home-manager that referenced this pull request Dec 23, 2022
spacekookie pushed a commit to spacekookie/home-manager that referenced this pull request Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants