notmuch and alot

feat/kile-v2
Ricard Illa 2022-04-24 17:28:46 +02:00
parent 2827d2f025
commit 0c3cd27f4d
No known key found for this signature in database
GPG Key ID: F69A672B72E54902
3 changed files with 121 additions and 125 deletions

View File

@ -85,6 +85,7 @@ let
tls.enable = true;
port = 993;
};
notmuch.enable = true;
};
switchAccountMacro = i: x: {
@ -523,12 +524,10 @@ in {
];
};
#programs.notmuch = {
# enable = true;
# new = {
# tags = ["unread" "inbox"];
# };
#};
programs.notmuch = {
enable = true;
new = { tags = [ "unread" "inbox" ]; };
};
programs.mbsync.enable = true;
programs.msmtp.enable = true;

View File

@ -20,11 +20,10 @@ let
maildir = "${config.home.homeDirectory}/Maildir";
passwordStoreDir = "${config.home.homeDirectory}/.password-store";
notmuchConfig = "${config.home.homeDirectory}/.notmuch-config";
notmuchConfig = "${config.home.homeDirectory}/.config/notmuch/default/config";
gnupghome = "${config.home.homeDirectory}/.gnupg";
lastrun = "${config.home.homeDirectory}/.mailsynclastrun";
in
pkgs.writeScriptBin "mailsync" ''
in pkgs.writeScriptBin "mailsync" ''
#!${shell}
# Run only if not already running in other instance
@ -92,13 +91,13 @@ in
${awk} '/^From: / && ++n ==1,/^\<.*\>:/' "$file" | \
${perl} -CS -MEncode -ne 'print decode("MIME-Header", $_)' | \
${awk} '{ $1=""; if (NF>=3)$NF=""; print $0 }' | \
${sed} 's/^[[:blank:]]*[\"'\''\'''\'\<]*//;s/[\"'\''\'''\'\>]*[[:blank:]]*$//'
${sed} 's/^[[:blank:]]*[\"'\'''\<]*//;s/[\"'\'''\>]*[[:blank:]]*$//'
)
subject=$(
${awk} '/^Subject: / && ++n == 1,/^\<.*\>: / && ++i == 2' "$file" | \
${head} -n 1 | ${perl} -CS -MEncode -ne 'print decode("MIME-Header", $_)' | \
${sed} 's/^Subject: //' | \
${sed} 's/^{[[:blank:]]*[\"'\''\'''\'\<]*//;s/[\"'\''\'''\'\>]*[[:blank:]]*$//' | \
${sed} 's/^{[[:blank:]]*[\"'\'''\<]*//;s/[\"'\'''\>]*[[:blank:]]*$//' | \
${tr} -d '\n'
)
messageinfo "$from" "$subject" &

View File

@ -9,8 +9,6 @@
home.username = "rilla";
home.homeDirectory = "/home/rilla";
nixpkgs.overlays = [ (self: super: { alot = stablePkgs.alot; }) ];
imports = [
./arduino
./barrier