about summary refs log tree commit diff
path: root/pkgs/larbs-mail/default.nix
blob: aea9d4922e9380581bd586fcfe18eed1a9c4d624 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{ stdenv, callPackage, buildEnv, makeDesktopItem, isync, pass, msmtp, notmuch, libnotify }:
with stdenv.lib;

let
  pname = "larbs-mail";

  mutt-wizard = callPackage ./mutt-wizard.nix { };
  neomutt = callPackage ./neomutt_wrapped.nix { };
  mailbox = callPackage ./mailbox-script.nix { };
  icon = ./icon.png;

  desktopItem = makeDesktopItem {
    name = pname;
    genericName = "Mail Client";
    comment = "Neomutt configuration by Luke Smith";
    exec = "${neomutt}/bin/neomutt";
    icon = icon;
    desktopName = pname;
    mimeType = "x-scheme-handler/mailto;message/rfc822";
    categories = "Network;Email";
    terminal = "true";
  };
in
buildEnv {
  name = pname;

  paths = [
    neomutt
    isync
    pass
    msmtp
    notmuch
    libnotify
    mutt-wizard
    mailbox
  ];

  postBuild = ''
    mkdir -p $out/opt/larbs-mail
    mkdir -p $out/share/pixmaps
    mv * $out/opt/larbs-mail

    ln -s "${desktopItem}/share/applications" $out/share
  '';

  meta = {
    homepage = "https://github.com/LukeSmithXYZ/mutt-wizard";
    description = "Neomutt + Mutt-Wizard: A system for automatically configuring mutt and isync with a simple interface and safe passwords";
    license = licenses.gpl3;
    platforms = [ "x86_64-linux" "x86_64-darwin" ];
  };
}