This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

tools.notmuch,mutt,muchsync: adapt to neoprism mailserver

- notmuch: remove hardcoded mailboxes, use folder: queries instead of tags
- mutt: auto-discover sieve folders from Maildir at startup
- muchsync: connect to neoprism.lassul.us:45621 instead of green

+23 -109
+3 -35
tools/muchsync/flake-module.nix
··· 21 21 # Create Maildir structure if it doesn't exist 22 22 mkdir -p "$HOME/Maildir"/{cur,new,tmp} 23 23 24 - # Check if a host is reachable 25 - check_host() { 26 - local host=$1 27 - ping -W2 -c3 "$host" >/dev/null 2>&1 28 - } 29 - 30 - # Smart host selection - try spora, nether, retiolum, then tor 31 - find_green_host() { 32 - if check_host green.s; then 33 - echo "green.s" 34 - elif check_host green.n; then 35 - echo "green.n" 36 - elif check_host green.r; then 37 - echo "green.r" 38 - else 39 - echo "tor" 40 - fi 41 - } 24 + MUCHSYNC_HOST="neoprism.lassul.us" 25 + MUCHSYNC_SSH="ssh -p 45621" 42 26 43 27 # Check if we should do auto-sync 44 28 # Auto-sync if no args or only verbose/config flags ··· 64 48 fi 65 49 66 50 if [ "$auto_sync" = true ]; then 67 - host=$(find_green_host) 68 - echo "Syncing with $host..." >&2 69 - 70 - if [ "$host" = "tor" ]; then 71 - # Build dependencies lazily 72 - echo "Building tornade..." >&2 73 - tornade_path=$(nix build --no-link --print-out-paths "${self}#tornade") 74 - clan_path=$(nix build --no-link --print-out-paths "${self}#clan-cli") 75 - 76 - # Get tor hostname using clan CLI 77 - tor_hostname=$(CLAN_DIR="${self}" "$clan_path/bin/clan" vars get green tor-ssh/hostname) 78 - 79 - # Use muchsync with custom ssh command via tornade 80 - exec ${exePath} -s "$tornade_path/bin/tornade ssh" "$@" lass@"$tor_hostname" 81 - else 82 - exec ${exePath} "$@" lass@"$host" 83 - fi 51 + exec ${exePath} -s "$MUCHSYNC_SSH" "$@" lass@"$MUCHSYNC_HOST" 84 52 else 85 53 # Pass through arguments to muchsync 86 54 exec ${exePath} "$@"
+13 -5
tools/mutt/flake-module.nix
··· 10 10 { 11 11 packages.mutt = 12 12 let 13 - # Mailboxes configuration from mail.nix 14 - mailboxes = self.packages.${system}.notmuch.passthru.mailboxes; 15 13 notmuchConfig = self.packages.${system}.notmuch.passthru.configuration.configFile.path; 14 + 15 + # Generate virtual-mailboxes from Maildir folder structure at build time 16 + # This discovers sieve folders dynamically — no hardcoded list needed 17 + genVirtualMailboxes = pkgs.writeShellScript "gen-virtual-mailboxes" '' 18 + maildir="$HOME/Maildir" 19 + [ -d "$maildir" ] || exit 0 20 + for dir in "$maildir"/.*; do 21 + [ -d "$dir/cur" ] || continue 22 + name=$(basename "$dir" | sed 's/^\.//') 23 + echo "virtual-mailboxes \"$name\" \"notmuch://?query=folder:$name\"" 24 + done | sort 25 + ''; 16 26 17 27 mailcap = pkgs.writeText "mailcap" '' 18 28 text/html; ${pkgs.elinks}/bin/elinks -dump ; copiousoutput; ··· 178 188 179 189 virtual-mailboxes "Unread" "notmuch://?query=tag:unread" 180 190 virtual-mailboxes "INBOX" "notmuch://?query=tag:inbox" 181 - ${lib.concatMapStringsSep "\n" ( 182 - i: ''${" "}virtual-mailboxes "${i.name}" "notmuch://?query=tag:${i.name}"'' 183 - ) (lib.mapAttrsToList lib.nameValuePair mailboxes)} 191 + source "${genVirtualMailboxes}|" 184 192 virtual-mailboxes "TODO" "notmuch://?query=tag:TODO" 185 193 virtual-mailboxes "Starred" "notmuch://?query=tag:*" 186 194 virtual-mailboxes "Archive" "notmuch://?query=tag:archive"
+7 -69
tools/notmuch/flake-module.nix
··· 9 9 { 10 10 packages.notmuch = 11 11 let 12 - # Mailboxes configuration from mail.nix 13 - mailboxes = { 14 - afra = [ "to:afra@afra-berlin.de" ]; 15 - c-base = [ "to:c-base.org" ]; 16 - coins = [ 17 - "to:btce@lassul.us" 18 - "to:coinbase@lassul.us" 19 - "to:polo@lassul.us" 20 - "to:bitwala@lassul.us" 21 - "to:payeer@lassul.us" 22 - "to:gatehub@lassul.us" 23 - "to:bitfinex@lassul.us" 24 - "to:binance@lassul.us" 25 - "to:bitcoin.de@lassul.us" 26 - "to:robinhood@lassul.us" 27 - ]; 28 - dezentrale = [ "to:dezentrale.space" ]; 29 - dhl = [ "to:dhl@lassul.us" ]; 30 - dn42 = [ "to:dn42@lists.nox.tf" ]; 31 - eloop = [ "to:eloop.org" ]; 32 - github = [ "to:github@lassul.us" ]; 33 - gmail = [ 34 - "to:gmail@lassul.us" 35 - "to:lassulus@gmail.com" 36 - "lassulus@googlemail.com" 37 - ]; 38 - india = [ 39 - "to:hillhackers@lists.hillhacks.in" 40 - "to:hackbeach@lists.hackbeach.in" 41 - "to:hackbeach@mail.hackbeach.in" 42 - ]; 43 - kaosstuff = [ 44 - "to:gearbest@lassul.us" 45 - "to:banggood@lassul.us" 46 - "to:tomtop@lassul.us" 47 - ]; 48 - lugs = [ "to:lugs@lug-s.org" ]; 49 - meetup = [ "to:meetup@lassul.us" ]; 50 - nix = [ 51 - "to:nix-devel@googlegroups.com" 52 - "to:nix@lassul.us" 53 - ]; 54 - patreon = [ "to:patreon@lassul.us" ]; 55 - paypal = [ "to:paypal@lassul.us" ]; 56 - ptl = [ "to:ptl@posttenebraslab.ch" ]; 57 - retiolum = [ "to:lass@mors.r" ]; 58 - security = [ 59 - "to:seclists.org" 60 - "to:bugtraq" 61 - "to:securityfocus@lassul.us" 62 - "to:security-announce@lists.apple.com" 63 - ]; 64 - shack = [ "to:shackspace.de" ]; 65 - steam = [ "to:steam@lassul.us" ]; 66 - tinc = [ 67 - "to:tinc@tinc-vpn.org" 68 - "to:tinc-devel@tinc-vpn.org" 69 - ]; 70 - wireguard = [ "to:wireguard@lists.zx2c4" ]; 71 - zzz = [ 72 - "to:pizza@lassul.us" 73 - "to:spam@krebsco.de" 74 - ]; 75 - }; 76 - 77 12 notmuchConfig = inputs.wrappers.wrapperModules.notmuch.apply { 78 13 pkgs = pkgs; 79 14 settings = { ··· 87 22 user = { 88 23 name = "lassulus"; 89 24 primary_email = "lassulus@lassul.us"; 90 - other_email = lib.concatStringsSep ";" (lib.flatten (lib.attrValues mailboxes)); 25 + other_email = lib.concatStringsSep ";" [ 26 + "lass@lassul.us" 27 + "lassulus@c-base.org" 28 + "lassulus@gmail.com" 29 + "lassulus@googlemail.com" 30 + ]; 91 31 }; 92 32 }; 93 - passthru = { 94 - mailboxes = mailboxes; 95 - }; 33 + passthru = { }; 96 34 }; 97 35 in 98 36 notmuchConfig.wrapper;