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
Improvements for Prosody #31006
Improvements for Prosody #31006
Conversation
, withZlib ? true, luazlib ? null | ||
, withDBI ? true, luadbi ? null | ||
, withExtraLibs ? [ ] | ||
, withCommunityModules ? [ ] }: | ||
|
||
assert withLibevent -> luaevent != null; | ||
assert withZlib -> luazlib != null; |
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.
You should add assertions for the new optional features. withExtraLibs
should probably be removed.
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.
Good catch, thank you. I added an assert for withDBI
now, which is the only new feature which needs one, I think.
Regarding withExtraLibs
, I now reconstructed its intention: Some community modules have additional dependencies not stated in the package, like luapam or lualdap, which can be injected via withExtraLibs = [ luapam ]
when withCommunityModules = [ auth_pam ]
was added. I added a comment to withExtraLibs now.
@orivej Or is there another way to add those extra dependencies when configuring the package, can you do the same with overrideAttrs or something? (I don't know, never needed that so far.) Then I'm quite sure it can be removed.
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.
Tried to do some research on the topic. With withExtraLibs
, you only need this to add community modules:
nixpkgs.config.packageOverrides = pkgs: {
prosody = pkgs.prosody.override {
withCommunityModules = [ "auth_pam" ];
withExtraLibs = [ lua51Packages.luaposix ];
};
};
Without it, you need to use overrideAttrs
to create a custom package to add the new libs on top of the default ones,
as libs
is no package option (if I understood it right). And then assign that custom package to the prosody service.
environment.systemPackages = [
(pkgs.emacs.overrideAttrs (oldAttrs: {
name = "prosody-with-mods";
withCommunityModules = [ "auth_pam" ];
libs = oldAttrs.libs ++ lua51Packages.luapam;
}))
];
# hypothetical module option which does not exist yet
services.prosody.pkg = pkgs.prosody-with-mods;
So it could be made to work without that extra option, I guess.
But from a user's perspective, the first one looks much easier to me. But again, I have no experience with customizing packages.
This flag seems to be useless.
cc @flosse, didn't see the |
@florianjacob I'm sorry to discontinue as a maintainer. |
@flosse thank you for your time as maintainer, still. 👍 Should I pull your commits here in this branch, or will you pose a separate PR? |
@flosse merged your commits into this branch now. Thanks! |
Sorry for leaving this PR hanging, and thank you! |
@orivej no worries! 🍻 |
Motivation for this change
Rebased and conflict-resolved version of #27716 by @sshisk.
Could remove some commits due to package updates that already landed in master.
Additionally updated prosody community modules to current HEAD.
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)