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

mailnag: enable to configure plugins #94202

Merged
merged 3 commits into from Aug 15, 2020

Conversation

doronbehar
Copy link
Contributor

Motivation for this change

Make mailnag more usable for Gnome users - make the gnome online accounts mailnag extension usable via Nix arguments to the derivation. Mailnag's Goa plugin is https://github.com/pulb/mailnag-goa-plugin . This PR also makes it easy enough for future us add other plugins that will be added to the derivation.

Things done

See commit message. I'm currently using it and it works great for me + plus the gnome shell extension: https://extensions.gnome.org/extension/886/mailnag/

Screenshot from 2020-07-30 03-00-04

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Add an availablePlugins attrset with all plugins available.
Make mailnag's expression accept a "plugins" argument specifying plugins
to install, from `availablePlugins`.
Prevent double wrapping (nor related to plugins).
Install plugins using xorg.lndir.
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/issues-with-gnome-keyring-and-libsecret/8370/2

@barryfm
Copy link
Contributor

barryfm commented Jul 30, 2020

Since changing from the 1.3.0 to the 2.0.0 mailnag release, I have been unable save my mail passwords between log ins.
Each time i run mailnag-config the passwords fields show up as empty. Before they were filled with the starred echoed strings representing the current password. Seahorse (which is also linked with libsecret) shows the contents of my key ring with entries for mailnag (Which I assume were placed there by the previous version). Once I enter the passwords mailnag runs correctly until I log out. When I log in again and mailnag starts up it shows password errors. I can reenter them with mailnag-config but ... [goto line 2]

@doronbehar
Copy link
Contributor Author

doronbehar commented Jul 30, 2020

Each time i run mailnag-config the passwords fields show up as empty.

I don't experience this and this is unrelated. Let's discuss this at https://discourse.nixos.org/t/issues-with-gnome-keyring-and-libsecret/8370/ :).

@barryfm
Copy link
Contributor

barryfm commented Jul 30, 2020

Sorry for my previous entry. I should not have posted here. Things were resolved on the discourse link given above.

@doronbehar
Copy link
Contributor Author

@jonringer I hope it'd be OK to ask you for a review directly, considering you are busy with the release. This one has a large diff due to some refactoring, and I think that's why reviewers haven't gave it a look. Additionally, it's a Python package I edited and added, so it should be also your area of expertise.

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

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

since it's just one plugin, i think this is fine.
If more are added, it might be worthwhile to refactor it so that it's a little easier to bring in plugins (e.g. plugins = callPackage ./plugins.nix )

https://github.com/NixOS/nixpkgs/pull/94202
1 package built:
mailnag

@doronbehar
Copy link
Contributor Author

since it's just one plugin, i think this is fine.
If more are added, it might be worthwhile to refactor it so that it's a little easier to bring in plugins (e.g. plugins = callPackage ./plugins.nix )

Maybe it'll be best to do take care of this now - The last push makes it possible to override the set of available plugins.

@jonringer
Copy link
Contributor

Maybe it'll be best to do take care of this now - The last push makes it possible to override the set of available plugins.

or maybe do something like: mailnag.withPlugins(ps: with ps; [ goa ] ) similar to python.withPackages

@doronbehar
Copy link
Contributor Author

@jonringer I haven't to implement exactly the mailnag.withPlugins(ps: with ps; [ goa ] ), but now it's closer, and there's even an example in all-packages.nix.

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

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

I think this is good.
It would be preferable to have it do something like a symlinkJoin all the packages into a new derivation, so you don't have to rebuild mailnag. But that's way more involved, and since it will use the same mailnag.withPackages convention, that can be done at a later time.

https://github.com/NixOS/nixpkgs/pull/94202
2 packages built:
mailnag mailnagWithPlugins

@jonringer jonringer merged commit 6c3d919 into NixOS:master Aug 15, 2020
@doronbehar
Copy link
Contributor Author

Thanks 🎸.

@doronbehar doronbehar deleted the pkg/mailnag-goa-plugin branch March 2, 2023 10:43
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

4 participants