~kaction/config

ref: 569cada1bc5709b76d4fd05eb2696044ad68c338 config/universe/mpop/default.nix -rw-r--r-- 908 bytes
569cada1 — Dmitry Bogatov Configure email fetching 8 months ago
                                                                                
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
{ mpop, execline, substituteAll, rewrite-paths }:
let
  config =
    # Mild obfuscation to make sure my email address is not greppable in
    # the source by something as primitive as \w+@\w+.\w+. I would be
    # shoked if spammer would actually build derivation to grep it for
    # email addresses.

    # For now I setup maildir instead of mh, since these days I do not
    # receive much mail, and configuring mmh is slightly more involved
    # than configuring mutt.
    let
      user = "demigod";
      domain = "kaction.cc";
    in substituteAll {
      src = ./mpop.conf;
      account = "user ${user}@${domain}";
    };
  stage1 = rewrite-paths {
    drv = mpop;
    postBuild = ''
      mv $out/bin/mpop $out/bin/.mpop
      cat << EOF > $out/bin/mpop
      #!${execline}/bin/execlineb -WS0
      $out/bin/.mpop --file=${config} \$@
      EOF
      chmod +x $out/bin/mpop
    '';
  };
in stage1