diff options
author | sefidel <contact@sefidel.net> | 2022-02-14 23:59:40 +0900 |
---|---|---|
committer | sefidel <contact@sefidel.net> | 2022-02-14 23:59:40 +0900 |
commit | 945418bebffca98f658e726da3100a5b4a6bb51c (patch) | |
tree | fe53bb3b710cab199f116f017ac63edc1a3dfc3d /home | |
parent | 46715ed381535bdd38e516467e8af4ec74d977d9 (diff) | |
download | nixrc-945418bebffca98f658e726da3100a5b4a6bb51c.tar.gz nixrc-945418bebffca98f658e726da3100a5b4a6bb51c.zip |
chore: fix mail oneshot
Diffstat (limited to 'home')
-rw-r--r-- | home/profiles/messaging/default.nix | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/home/profiles/messaging/default.nix b/home/profiles/messaging/default.nix index 54d6870..946bcb8 100644 --- a/home/profiles/messaging/default.nix +++ b/home/profiles/messaging/default.nix @@ -41,8 +41,6 @@ in boxes = [ "Inbox" ]; onNotify = pkgs.writeShellScript "imap-on-notify" '' ${mbsyncCmd} zach - NOTMUCH_CONFIG=${lib.escapeShellArg config.home.sessionVariables.NOTMUCH_CONFIG} - NMBGIT=${lib.escapeShellArg config.home.sessionVariables.NMBGIT} ${pkgs.notmuch}/bin/notmuch new ''; }; @@ -183,21 +181,22 @@ in services.imapnotify.enable = true; # Sync emails on initial login - systemd.user.services.mbsync-initial = { + systemd.user.services.mbsync-oneshot = { Unit = { - Description = "mbsync initial synchronisation"; - After = "graphical-session.target"; + Description = "mbsync oneshot synchronisation"; }; Service = { + Type = "oneshot"; ExecStart = "${mbsyncCmd} --all"; - Restart = "on-failure"; + RemainAfterExit = true; }; Install.WantedBy = [ "default.target" ]; }; - home.file.".mailcap".text = let - setsid = "${pkgs.util-linux}/bin/setsid"; - openfile = "${pkgs.writeShellScript "openfile" '' + home.file.".mailcap".text = + let + setsid = "${pkgs.util-linux}/bin/setsid"; + openfile = "${pkgs.writeShellScript "openfile" '' # Helps open a file with xdg-open from mutt in a external program without weird side effects. tempdir="''${TMPDIR:-$(mktemp -d)}" file="$tempdir/$(basename "$1")" @@ -207,17 +206,16 @@ in $opener "$file" >/dev/null 2>&1 find "''${tempdir:?}" -mtime +1 -type f -delete ''}"; - in '' - ${lib.optionalString false "text/html; ${pkgs.w3m}/bin/w3m -dump -T text/html -I %{charset} -O utf-8 %s; copiousoutut; description=HTML Text; nametemplate=%s.html"} - - - text/plain; $EDITOR %s ; - ${lib.optionalString true "text/html; ${openfile} %s ; nametemplate=%s.html"} - text/html; ${pkgs.lynx}/bin/lynx -assume_charset=%{charset} -display_charset=utf-8 -dump %s; nametemplate=%s.html; copiousoutput; - image/*; ${openfile} %s ; - application/pdf; ${openfile} %s ; - # application/pgp-encrypted; gpg -d '%s'; copiousoutput; - ''; + in + '' + ${lib.optionalString false "text/html; ${pkgs.w3m}/bin/w3m -dump -T text/html -I %{charset} -O utf-8 %s; copiousoutut; description=HTML Text; nametemplate=%s.html"} + text/plain; $EDITOR %s ; + ${lib.optionalString true "text/html; ${openfile} %s ; nametemplate=%s.html"} + text/html; ${pkgs.lynx}/bin/lynx -assume_charset=%{charset} -display_charset=utf-8 -dump %s; nametemplate=%s.html; copiousoutput; + image/*; ${openfile} %s ; + application/pdf; ${openfile} %s ; + # application/pgp-encrypted; gpg -d '%s'; copiousoutput; + ''; home.packages = with pkgs; [ element-desktop |