-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
nylas-mail: 2.0.32 #25600
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
nylas-mail: 2.0.32 #25600
Conversation
Added new email client Nylas-Mail.
Onboard was left in accidentally.
(Thank you very much for making this PR!!!! In the past, I had been trying to |
meta = { | ||
description = "Nylas Mail is an open-source mail client built on the modern web with Electron, React, and Flux. It is designed to be extensible, so it's easy to create new experiences and workflows around email."; | ||
license = stdenv.lib.licenses.gpl3; | ||
homepage = https://nylas.com; |
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.
do you want to maintain this package?
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.
Sure. I don't have any experience maintaining a package so i'm not sure what it entails, but I'll give it a shot.
I keep getting this error message:
|
@rht Yes, it was challenging to get working, it had quite a few requirements. Regarding your error message, It requires gnome keyring to be running. I had to set |
Verified: I have reproduced the build and tested linking an account successfully. |
meta = with stdenv.lib; { | ||
description = "pen-source mail client built on the modern web with Electron, React, and Flux"; | ||
longDescription = '' | ||
Nylas Mail is an open-source mail client built on the modern web with Electron, React, and Flux. It is designed to be extensible, so it's easy to create new experiences and workflows around email. Nylas-Mail requires gnome3 keyring. It can be enabled with "services.gnome3.gnome-keyring.enable = true;". |
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.
The last two sents should be put in a new line. As it is currently (buried down), it is easy for people to miss.
I think the statement should be more imperative, as it is required to have the daemon running after all.
"To run nylas-mail, an additional manual step is required. Make sure to have services.gnome3.gnome-keyring.enable = true;
in your configuration.nix before running nylas-mail. If you happen to miss this step, you should remove ~/.nylas-mail and ~/.config/Nylas\ Mail for a blank setup".
''; | ||
|
||
meta = with stdenv.lib; { | ||
description = "pen-source mail client built on the modern web with Electron, React, and Flux"; |
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.
(truncated description)
Hello, thx for your pr. I propose : @@ -38,10 +38,14 @@ stdenv.mkDerivation rec {
version = "2.0.31";
subVersion = "e675deb";
- src = fetchurl {
- url = "https://edgehill.s3-us-west-2.amazonaws.com/${version}-${subVersion}/linux-deb/x64/NylasMail.deb";
- sha256 = "b036956174f998bd4a2662a1f59cb4a302465b3ed06c487de88ff2721e372f6e";
- };
+ src =
+ if stdenv.system == "x86_64-linux" then
+ fetchurl {
+ url = "https://edgehill.s3-us-west-2.amazonaws.com/${version}-${subVersion}/linux-deb/x64/NylasMail.deb";
+ sha256 = "b036956174f998bd4a2662a1f59cb4a302465b3ed06c487de88ff2721e372f6e";
+ }
+ else
+ throw "NylasMail is not supported on ${stdenv.system}"; @@ -134,5 +138,6 @@ stdenv.mkDerivation rec {
license = licenses.gpl3;
maintainers = with maintainers; [ johnramsden ];
homepage = https://nylas.com;
+ platforms = [ "x86_64-linux" ];
};
} and today version is 2.0.32-fec7941. regards |
Check indentation and sort name diff --git a/pkgs/applications/networking/mailreaders/nylas-mail/default.nix b/pkgs/applications/networking/mailreaders/nylas-mail/default.nix
index 6816c49033c..7c3ee456f25 100644
--- a/pkgs/applications/networking/mailreaders/nylas-mail/default.nix
+++ b/pkgs/applications/networking/mailreaders/nylas-mail/default.nix
@@ -1,30 +1,35 @@
-{ dpkg, fetchurl, lib, pkgs, stdenv, config
+{ config
+, stdenv
+, pkgs
+, fetchurl
+, dpkg
+, lib
+, gnome2
+, libgnome_keyring
+, desktop_file_utils
+, python2
+, nodejs
+, libnotify
, alsaLib
, atk
+, glib
+, pango
+, gdk_pixbuf
, cairo
-, coreutils
-, cups
-, dbus
-, desktop_file_utils
-, expat
-, fontconfig
, freetype
-, gcc-unwrapped
-, gdk_pixbuf
-, glib
-, gnome2
-, libgcrypt
-, libgnome_keyring
-, libnotify
-, makeWrapper
-, nodejs
-, nspr
+, fontconfig
+, dbus
, nss
-, pango
-, python2
-, udev
+, nspr
+, cups
+, expat
, wget
+, udev
, xorg
+, libgcrypt
+, makeWrapper
+, gcc-unwrapped
+, coreutils
}:
stdenv.mkDerivation rec {
@@ -33,52 +38,48 @@ stdenv.mkDerivation rec {
version = "2.0.31";
subVersion = "e675deb";
- src =
- if stdenv.system == "x86_64-linux" then
- fetchurl {
- url = "https://edgehill.s3-us-west-2.amazonaws.com/${version}-${subVersion}/linux-deb/x64/NylasMail.deb";
- sha256 = "b036956174f998bd4a2662a1f59cb4a302465b3ed06c487de88ff2721e372f6e";
- }
- else
- throw "NylasMail is not supported on ${stdenv.system}";
+ src = fetchurl {
+ url = "https://edgehill.s3-us-west-2.amazonaws.com/${version}-${subVersion}/linux-deb/x64/NylasMail.deb";
+ sha256 = "b036956174f998bd4a2662a1f59cb4a302465b3ed06c487de88ff2721e372f6e";
+ };
# Build dependencies
propagatedBuildInputs = [
+ gnome2.gtk
+ gnome2.GConf
+ libgnome_keyring
+ desktop_file_utils
+ python2
+ nodejs
+ libnotify
alsaLib
atk
+ glib
+ pango
+ gdk_pixbuf
cairo
- coreutils
- cups
- dbus
- desktop_file_utils
- expat
- fontconfig
freetype
- gcc-unwrapped
- gdk_pixbuf
- glib
- gnome2.GConf
- gnome2.gtk
- libgnome_keyring
- libnotify
- nodejs
- nspr
+ fontconfig
+ dbus
nss
- pango
- python2
- udev
+ nspr
+ cups
+ expat
wget
- xorg.libX11
+ udev
+ gcc-unwrapped
+ coreutils
xorg.libXScrnSaver
- xorg.libXcomposite
+ xorg.libXi
+ xorg.libXtst
xorg.libXcursor
xorg.libXdamage
+ xorg.libXrandr
+ xorg.libXcomposite
xorg.libXext
xorg.libXfixes
- xorg.libXi
- xorg.libXrandr
xorg.libXrender
- xorg.libXtst
+ xorg.libX11
xorg.libxkbfile
];
@@ -88,59 +89,50 @@ stdenv.mkDerivation rec {
phases = [ "unpackPhase" ];
unpackPhase = ''
- mkdir -p $out
+ mkdir -p $out
- ${dpkg}/bin/dpkg-deb -x $src unpacked
- mv unpacked/usr/* $out/
+ ${dpkg}/bin/dpkg-deb -x $src unpacked
+ mv unpacked/usr/* $out/
- # Fix path in desktop file
- substituteInPlace $out/share/applications/nylas-mail.desktop \
- --replace /usr/bin/nylas-mail $out/bin/nylas-mail
+ # Fix path in desktop file
+ substituteInPlace $out/share/applications/nylas-mail.desktop \
+ --replace /usr/bin/nylas-mail $out/bin/nylas-mail
# Patch librariess
noderp=$(patchelf --print-rpath $out/share/nylas-mail/libnode.so)
patchelf --set-rpath $noderp:$out/lib:${stdenv.cc.cc.lib}/lib:${xorg.libxkbfile.out}/lib:${lib.makeLibraryPath propagatedBuildInputs } \
- $out/share/nylas-mail/libnode.so
+ $out/share/nylas-mail/libnode.so
ffrp=$(patchelf --print-rpath $out/share/nylas-mail/libffmpeg.so)
patchelf --set-rpath $ffrp:$out/lib:${stdenv.cc.cc.lib}/lib:${lib.makeLibraryPath propagatedBuildInputs } \
- $out/share/nylas-mail/libffmpeg.so
+ $out/share/nylas-mail/libffmpeg.so
# Patch binaries
binrp=$(patchelf --print-rpath $out/share/nylas-mail/nylas)
patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
- --set-rpath $binrp:$out/lib:${stdenv.cc.cc.lib}/lib:${lib.makeLibraryPath propagatedBuildInputs } \
- $out/share/nylas-mail/nylas
+ --set-rpath $binrp:$out/lib:${stdenv.cc.cc.lib}/lib:${lib.makeLibraryPath propagatedBuildInputs } \
+ $out/share/nylas-mail/nylas
- wrapProgram $out/share/nylas-mail/nylas \
- --set LD_LIBRARY_PATH "${xorg.libxkbfile}/lib:${pkgs.gnome3.libgnome_keyring}/lib";
+ wrapProgram $out/share/nylas-mail/nylas --set LD_LIBRARY_PATH "${xorg.libxkbfile}/lib:${pkgs.gnome3.libgnome_keyring}/lib";
- # Fix path to bash so apm can install plugins.
- substituteInPlace $out/share/nylas-mail/resources/apm/bin/apm \
- --replace /bin/bash ${stdenv.shell}
+ # Fix path to bash so apm can install plugins.
+ substituteInPlace $out/share/nylas-mail/resources/apm/bin/apm \
+ --replace /bin/bash ${stdenv.shell}
- wrapProgram $out/share/nylas-mail/resources/apm/bin/apm \
- --set PATH "${coreutils}/bin"
- patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
- --set-rpath ${gcc-unwrapped.lib}/lib \
- $out/share/nylas-mail/resources/apm/bin/node
+ wrapProgram $out/share/nylas-mail/resources/apm/bin/apm \
+ --set PATH "${coreutils}/bin"
+ patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+ --set-rpath ${gcc-unwrapped.lib}/lib \
+ $out/share/nylas-mail/resources/apm/bin/node
'';
meta = with stdenv.lib; {
description = "Open-source mail client built on the modern web with Electron, React, and Flux";
longDescription = ''
- Nylas Mail is an open-source mail client built on the modern web with Electron, React, and Flux.
- It is designed to be extensible, so it's easy to create new experiences and workflows around email.
-
- To run nylas-mail, an additional manual step is required. Make sure to have
- services.gnome3.gnome-keyring.enable = true;
- in your configuration.nix before running nylas-mail.
-
- If you happen to miss this step, you should remove ~/.nylas-mail and "~/.config/Nylas Mail" for a blank setup".
+ Nylas Mail is an open-source mail client built on the modern web with Electron, React, and Flux. It is designed to be extensible, so it's easy to create new experiences and workflows around email. To run nylas-mail, an additional manual step is required. Make sure to have services.gnome3.gnome-keyring.enable = true; in your configuration.nix before running nylas-mail. If you happen to miss this step, you should remove ~/.nylas-mail and "~/.config/Nylas Mail" for a blank setup".
'';
license = licenses.gpl3;
maintainers = with maintainers; [ johnramsden ];
homepage = https://nylas.com;
- platforms = [ "x86_64-linux" ];
};
} |
Thanks @apeyroux I added the changes and bumped the version. |
# Runtime dependencies | ||
buildInputs = [ makeWrapper gnome2.gnome_keyring ]; | ||
|
||
phases = [ "unpackPhase" ]; |
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.
Please consider using buildCommand
instead of phases
& unpackPhase
.
python2 | ||
udev | ||
wget | ||
xorg.libX11 |
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.
Consider passing the xorg packages explicitly, callPackage
has them in scope and will be able to fill them in.
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.
@joachifm What do you mean by passing them in explicitly? Are you talking about where I list them as library paths in ${lib.makeLibraryPath propagatedBuildInputs }
?
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.
Passing them as parameters to the expression
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.
Sorry, could you elaborate? Isn't that what i'm currently doing?
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.
No. You're passing the entire xorg
package set to the expression. What I'm saying is instead of accessing xorg.libX11
, pass libX11
to the expression directly. Putting things in propagatedBuildInputs
has nothing to do with it (nor is it really appropriate).
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.
As in?:
propagatedBuildInputs = with xorg; [
alsaLib
atk
cairo
coreutils
cups
dbus
desktop_file_utils
expat
fontconfig
freetype
gcc-unwrapped
gdk_pixbuf
glib
gnome2.GConf
gnome2.gtk
libgnome_keyring
libnotify
nodejs
nspr
nss
pango
python2
udev
wget
libX11
libXScrnSaver
libXcomposite
libXcursor
libXdamage
libXext
libXfixes
libXi
libXrandr
libXrender
libXtst
libxkbfile
];
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.
No. Nevermind.
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.
else | ||
throw "NylasMail is not supported on ${stdenv.system}"; | ||
|
||
# Build dependencies |
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.
Input propagation refers to build environments not runtime.
xorg.libxkbfile | ||
]; | ||
|
||
# Runtime dependencies |
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.
makeWrapper
could in fact be nativeBuildInputs
…BuildInputs as reccomended.
|
||
# Patch binaries | ||
binrp=$(patchelf --print-rpath $out/share/nylas-mail/nylas) | ||
patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ |
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.
NIX_CC needs quotes.
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.
Unless I'm mistaken, I don't believe it does. Right now the entire cat
command gets quoted and that's how it appears to be done everywhere I looked. Is there a problem with how it is currently?
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.
@johnramsden You are mistaken. Experiment in your terminal if you want or just add the quotes.
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.
@0xABAB It works both ways for me in my terminal.
If you search for NIX_CC there seems to be hundreds of packages that are doing it the same way I am.
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.
@johnramsden Compare
sometestcommand "$(NIX_CC='look here are spaces' cat $NIX_CC/nix-support/dynamic-linker)"
vs
sometestcommand "$(NIX_CC='look here are spaces' cat "$NIX_CC"/nix-support/dynamic-linker)"
Regarding your last comment; correctness is not a democracy.
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.
Yes, I am aware, I was just wondering if all the other packages were doing it wrong as well.
It seems to work fine for me, maybe I'm misinterpreting what you're saying but this is what I get:
$ NIX_CC=/nix/store/b43ww9wkpwjxha7ql7mizxpa2vb6yk5r-gcc-wrapper-5.4.0
$ echo "$(cat $NIX_CC/nix-support/dynamic-linker)"
/nix/store/7crrmih8c52r8fbnqb933dxrsp44md93-glibc-2.25/lib/ld-linux-x86-64.so.2
$ echo $(cat "$NIX_CC"/nix-support/dynamic-linker)
/nix/store/7crrmih8c52r8fbnqb933dxrsp44md93-glibc-2.25/lib/ld-linux-x86-64.so.2
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.
NIX_CC does not need quotes (though it doesn't hurt). No sane person would set the store prefix to something containing whitespace.
meta = with stdenv.lib; { | ||
description = "Open-source mail client built on the modern web with Electron, React, and Flux"; | ||
longDescription = '' | ||
Nylas Mail is an open-source mail client built on the modern web with Electron, React, and Flux. It is designed to be extensible, so it's easy to create new experiences and workflows around email. To run nylas-mail, an additional manual step is required. Make sure to have services.gnome3.gnome-keyring.enable = true; in your configuration.nix before running nylas-mail. If you happen to miss this step, you should remove ~/.nylas-mail and "~/.config/Nylas Mail" for a blank setup". |
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.
Please also add a module for NixOS, such that people don't need to care about knowing about implementation details like enabling a key ring.
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 idea, I added a module. I'm still working on the configuration, let me know if you have any recommendations.
src = | ||
if stdenv.system == "x86_64-linux" then | ||
fetchurl { | ||
url = "https://edgehill.s3-us-west-2.amazonaws.com/${version}-${subVersion}/linux-deb/x64/NylasMail.deb"; |
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.
More users would be interested in packages built by Nix infrastructure, not some binary package created by some random person.
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.
This is coming straight from them, not some random person. I tried to build it from source but there is a lot involved. You're welcome to create a package that builds it.
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.
In risk management terms, it means that we are broadening the number of people who we need to trust and that's a bad thing in most environments. If I say "random person", that's what I meant. Having said that, I am of course happy that you made the effort to provided more than there was before, so it's an improvement. Your effort has probably made it easier to package it from source now, so thanks for your efforts again.
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.
Of course. I too would prefer to have it built by Nixpkgs. If I get the chance to look at it again, maybe I'll see if I can get it to build.
I am happy with how this is progressing. |
pkgs/top-level/all-packages.nix
Outdated
@@ -15910,6 +15910,8 @@ with pkgs; | |||
|
|||
thinkingRock = callPackage ../applications/misc/thinking-rock { }; | |||
|
|||
nylas-mail = callPackage ../applications/networking/mailreaders/nylas-mail { }; |
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.
Maybe call it nylas-mail-bin
?
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.
@7c6f434c Even though there's no other version? Wont that be confusing for users?
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.
Not sure: it could remind that it is a binary patching and maybe incentivise someone to do a source build (and adding a source build would not be confusing in this case)
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.
OK, i'll change it.
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.
Please ping me when you do — GitHub PR update notifications are either buggy or non-existent, not sure which
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.
@7c6f434c Done.
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.
I think you have missed the attribute name in all-packages.nix
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.
Whoops. Thanks.
One other thing, this is my first time creating a module for a package - someone might want to look it over to make sure everything looks alright.
Change pkg in module, and name in pkg.
nylas-mail has since been sunsetted and discontinued, there is a fork called mailspring that is a rewrite in C++, and a fork called nylas-mail-lives. As a result, I was wondering if this package should be removed from nixpkgs. |
Nylas-Mail
Packaged up the email client Nylas-Mail.
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
./result/bin/
)