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

Improvements for Prosody #31006

Merged
merged 15 commits into from Dec 9, 2017
Merged

Improvements for Prosody #31006

merged 15 commits into from Dec 9, 2017

Conversation

florianjacob
Copy link
Contributor

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
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@florianjacob florianjacob mentioned this pull request Oct 30, 2017
8 tasks
, withZlib ? true, luazlib ? null
, withDBI ? true, luadbi ? null
, withExtraLibs ? [ ]
, withCommunityModules ? [ ] }:

assert withLibevent -> luaevent != null;
assert withZlib -> luazlib != null;
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@florianjacob
Copy link
Contributor Author

cc @flosse, didn't see the pkgs/server/xmpp/prosody part has a maintainer.

@flosse
Copy link
Contributor

flosse commented Nov 6, 2017

@florianjacob I'm sorry to discontinue as a maintainer.
I removed flosse from the lists: https://github.com/flosse/nixpkgs/tree/remove-flosse-as-maintainer

@florianjacob
Copy link
Contributor Author

@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?

@florianjacob
Copy link
Contributor Author

@flosse merged your commits into this branch now. Thanks!

@florianjacob
Copy link
Contributor Author

@fpletz now after @orivej has approved this, is there anything still missing from my side? 😃

@orivej orivej merged commit 40950f6 into NixOS:master Dec 9, 2017
@orivej
Copy link
Contributor

orivej commented Dec 9, 2017

Sorry for leaving this PR hanging, and thank you!

@florianjacob florianjacob deleted the prosody branch December 9, 2017 11:40
@florianjacob
Copy link
Contributor Author

@orivej no worries! 🍻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants