From 3fddb48020aab9934752b1f19e5c35d7d3881a05 Mon Sep 17 00:00:00 2001 From: John Ramsden Date: Wed, 28 Jun 2017 15:56:41 -0700 Subject: Add Nylas mail module. Still needs keyring configuration --- nixos/modules/programs/nylas-mail.nix | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 nixos/modules/programs/nylas-mail.nix (limited to 'nixos') diff --git a/nixos/modules/programs/nylas-mail.nix b/nixos/modules/programs/nylas-mail.nix new file mode 100644 index 000000000000..d1427d890245 --- /dev/null +++ b/nixos/modules/programs/nylas-mail.nix @@ -0,0 +1,43 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.services.nylas-mail; + defaultUser = "nylas-mail"; +in { + ###### interface + options = { + services.nylas-mail = { + + enable = mkEnableOption '' + nylas-mail - Open-source mail client built on the modern web with Electron, React, and Flux + ''; + + gnome3-keyring = mkOption { + type = types.bool; + default = true; + description = "Enable gnome3 keyring for nylas-mail."; + }; + + package = mkOption { + type = types.package; + default = pkgs.nylas-mail; + defaultText = "pkgs.nylas-mail"; + example = literalExample "pkgs.nylas-mail"; + description = '' + nylas-mail package to use. + ''; + }; + }; + }; + + + ###### implementation + + config = mkIf cfg.enable { + + + + }; +} -- cgit 1.4.1 From 9f4c3b2efd02447ffb403678e880cd3340aaaa48 Mon Sep 17 00:00:00 2001 From: John Ramsden Date: Wed, 28 Jun 2017 16:13:10 -0700 Subject: Add keyring enable option and add Nylas to systemPackages --- nixos/modules/programs/nylas-mail.nix | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'nixos') diff --git a/nixos/modules/programs/nylas-mail.nix b/nixos/modules/programs/nylas-mail.nix index d1427d890245..fc18a9a4760b 100644 --- a/nixos/modules/programs/nylas-mail.nix +++ b/nixos/modules/programs/nylas-mail.nix @@ -19,16 +19,6 @@ in { default = true; description = "Enable gnome3 keyring for nylas-mail."; }; - - package = mkOption { - type = types.package; - default = pkgs.nylas-mail; - defaultText = "pkgs.nylas-mail"; - example = literalExample "pkgs.nylas-mail"; - description = '' - nylas-mail package to use. - ''; - }; }; }; @@ -37,7 +27,11 @@ in { config = mkIf cfg.enable { + environment.systemPackages = [pkgs.nylas-mail]; + services.gnome3.gnome-keyring = mkIf cfg.gnome3-keyring { + enable = true; + }; }; } -- cgit 1.4.1 From 407324faa9b1a4a0641cb1146cc910328210ab6e Mon Sep 17 00:00:00 2001 From: John Ramsden Date: Wed, 5 Jul 2017 16:28:01 -0700 Subject: Rename nylas-mail to nylas-mail-bin. Change pkg in module, and name in pkg. --- nixos/modules/programs/nylas-mail.nix | 2 +- .../mailreaders/nylas-mail-bin/default.nix | 136 +++++++++++++++++++++ .../networking/mailreaders/nylas-mail/default.nix | 136 --------------------- 3 files changed, 137 insertions(+), 137 deletions(-) create mode 100644 pkgs/applications/networking/mailreaders/nylas-mail-bin/default.nix delete mode 100644 pkgs/applications/networking/mailreaders/nylas-mail/default.nix (limited to 'nixos') diff --git a/nixos/modules/programs/nylas-mail.nix b/nixos/modules/programs/nylas-mail.nix index fc18a9a4760b..9a6cf755f2a2 100644 --- a/nixos/modules/programs/nylas-mail.nix +++ b/nixos/modules/programs/nylas-mail.nix @@ -27,7 +27,7 @@ in { config = mkIf cfg.enable { - environment.systemPackages = [pkgs.nylas-mail]; + environment.systemPackages = [ pkgs.nylas-mail-bin ]; services.gnome3.gnome-keyring = mkIf cfg.gnome3-keyring { enable = true; diff --git a/pkgs/applications/networking/mailreaders/nylas-mail-bin/default.nix b/pkgs/applications/networking/mailreaders/nylas-mail-bin/default.nix new file mode 100644 index 000000000000..4c768325fee9 --- /dev/null +++ b/pkgs/applications/networking/mailreaders/nylas-mail-bin/default.nix @@ -0,0 +1,136 @@ +{ dpkg, fetchurl, lib, pkgs, stdenv, config +, alsaLib +, atk +, cairo +, coreutils +, cups +, dbus +, desktop_file_utils +, expat +, fontconfig +, freetype +, gcc-unwrapped +, gdk_pixbuf +, glib +, gnome2 +, libgcrypt +, libgnome_keyring +, libnotify +, makeWrapper +, nodejs +, nspr +, nss +, pango +, python2 +, udev +, wget +, xorg +}: + +stdenv.mkDerivation rec { + name = "${pkgname}-${version}"; + pkgname = "nylas-mail-bin"; + version = "2.0.32"; + subVersion = "fec7941"; + + 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 = "40060aa1dc3b5187b8ed4a07b9de3427e3c5a291df98c2c82395647fa2aa4ada"; + } + else + throw "NylasMail is not supported on ${stdenv.system}"; + + propagatedBuildInputs = [ + 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 + xorg.libX11 + xorg.libXScrnSaver + xorg.libXcomposite + xorg.libXcursor + xorg.libXdamage + xorg.libXext + xorg.libXfixes + xorg.libXi + xorg.libXrandr + xorg.libXrender + xorg.libXtst + xorg.libxkbfile + ]; + + + buildInputs = [ gnome2.gnome_keyring ]; + + nativeBuildInputs = [ makeWrapper ]; + + buildCommand = '' + mkdir -p $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 + + # 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 + + 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 + + # 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 + + 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} + + 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. Nylas Mail can be enabled with it's requirements by enabling 'services.nylas-mail.enable=true'. Alternatively, 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" ]; + }; +} diff --git a/pkgs/applications/networking/mailreaders/nylas-mail/default.nix b/pkgs/applications/networking/mailreaders/nylas-mail/default.nix deleted file mode 100644 index b9d4be3e3801..000000000000 --- a/pkgs/applications/networking/mailreaders/nylas-mail/default.nix +++ /dev/null @@ -1,136 +0,0 @@ -{ dpkg, fetchurl, lib, pkgs, stdenv, config -, alsaLib -, atk -, cairo -, coreutils -, cups -, dbus -, desktop_file_utils -, expat -, fontconfig -, freetype -, gcc-unwrapped -, gdk_pixbuf -, glib -, gnome2 -, libgcrypt -, libgnome_keyring -, libnotify -, makeWrapper -, nodejs -, nspr -, nss -, pango -, python2 -, udev -, wget -, xorg -}: - -stdenv.mkDerivation rec { - name = "${pkgname}-${version}"; - pkgname = "nylas-mail"; - version = "2.0.32"; - subVersion = "fec7941"; - - 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 = "40060aa1dc3b5187b8ed4a07b9de3427e3c5a291df98c2c82395647fa2aa4ada"; - } - else - throw "NylasMail is not supported on ${stdenv.system}"; - - propagatedBuildInputs = [ - 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 - xorg.libX11 - xorg.libXScrnSaver - xorg.libXcomposite - xorg.libXcursor - xorg.libXdamage - xorg.libXext - xorg.libXfixes - xorg.libXi - xorg.libXrandr - xorg.libXrender - xorg.libXtst - xorg.libxkbfile - ]; - - - buildInputs = [ gnome2.gnome_keyring ]; - - nativeBuildInputs = [ makeWrapper ]; - - buildCommand = '' - mkdir -p $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 - - # 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 - - 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 - - # 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 - - 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} - - 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". - ''; - license = licenses.gpl3; - maintainers = with maintainers; [ johnramsden ]; - homepage = https://nylas.com; - platforms = [ "x86_64-linux" ]; - }; -} -- cgit 1.4.1