~kaction/config

c10cf3188ec0105d4a436574abbb8f1b5dec8ea9 — Dmitry Bogatov 11 months ago ad0d0a5
Add mutt into the universe

I do not send email much these days, so mutt(1) is good enough.
4 files changed, 43 insertions(+), 0 deletions(-)

M flake.nix
M universe/default.nix
A universe/mutt/default.nix
A universe/mutt/muttrc
M flake.nix => flake.nix +1 -0
@@ 68,6 68,7 @@
            ./universe/tig
            ./universe/w3m
            ./universe/doas
            ./universe/mutt
          ]);

          rebuildedStatic = builtins.listToAttrs (map rebuildStatic [

M universe/default.nix => universe/default.nix +1 -0
@@ 55,6 55,7 @@ let
      man-pages # syscall and libc library reference.
      msmtp
      mpop
      mutt
      newsboat
      nix # unstable Nix with flakes support
      nixfmt

A universe/mutt/default.nix => universe/mutt/default.nix +37 -0
@@ 0,0 1,37 @@
{ mutt, perl, execline, rewrite-paths }:
let
  stage1 = mutt.override {
    gdbm = null;
    openssl = null;
    cyrus_sasl = null;
    gnupg = null;
    gpgme = null;
    kerberos = null;
    headerCache = false;
    sslSupport = false;
    saslSupport = false;
    gpgmeSupport = false;
    imapSupport = false;
    gssSupport = false;

    inherit perl;
  };
  stage2 = stage1.overrideAttrs (old: {
    configureFlags = old.configureFlags
      ++ [ "--disable-smtp" "--disable-pop" "--disable-nls" ];
    nativeBuildInputs = [ perl ];
  });
  stage3 = rewrite-paths {
    drv = stage2;
    postBuild = ''
      rm -f $out/bin/smime_keys

      mv $out/bin/mutt $out/bin/.mutt
      cat << EOF > $out/bin/mutt
      #!${execline}/bin/execlineb -WS0
      $out/bin/.mutt -F ${./muttrc} \$@
      EOF
      chmod +x $out/bin/mutt
    '';
  };
in stage3

A universe/mutt/muttrc => universe/mutt/muttrc +4 -0
@@ 0,0 1,4 @@
set sendmail = "/usr/bin/env msmtp"
set use_from = no
set edit_headers = yes
set pipe_decode = yes