-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
nixos/httpd: fix lua paths #108511
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
nixos/httpd: fix lua paths #108511
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
diff LGTM
f685e18
to
78abeb1
Compare
I have amended the commit with a fix that @aanderse wanted to have over at #107649 (comment) |
I wish I knew enough about |
I know a bit lua but no in nixpkgs so I am not. |
78abeb1
to
b146674
Compare
I have just added a commit which includes the line assert luaSupport -> lua5 != null; in the apache package. This just makes the error message clearer when somebody forgets to set the |
This is not required and breaks overriding in certain cases. lua5 should never be null and give you a some other warning that it is marked as broken, insecure or does not work on your platform. |
Account for the fact that, when creating a lua package without the "withPackages" helper, we dont get an extra "lua" attribute in the package. Therefore we need to distinguish between the "withPackages" case and the direct ( or "empty" ) lua package. For example with this nixos config: ```nix { services.httpd = { enable = true; package = pkgs.apacheHttpd.override { luaSupport = true; lua5 = pkgs.lua5_3.withPackages (ps: with ps; [ luafilesystem ] ); }; }; } ``` Here we say that we want to have apache to use a lua, packaged with the `luafilesystem` module so that we can `require` that in scripts to render http responses. There, the set that gets assigned to `lua5 ` does not have a `luaversion` attribute, rather it has a `lua` attribute wherein lies a `luaversion` attribute. If we dont package additional modules, then we dont have that `lua` attribute in between and rather directly have to use `luaversion` directly.
4a84feb
to
7c121e6
Compare
Oh, you are right. I've removed that. |
Motivation for this change
My recent pull request #107649 contained an error. You could not use a direct lua package (e.g. the
lua5_3
attribute) but had to use a derivation created with thewithPackages
helper that is in the lua attribute.This changes makes it so that you can now also use an empty lua interpreter. In other words, this:
gave an error, but with this change it works.
Notify Maintainers
@lovek323 @peti
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)