nix config

attempting email notifications

+48 -11
+2
home/profiles/desktop/bspwmrc
··· 26 26 bspc config focused_border_color "#bd93f9" 27 27 bspc config presel_feedback_color "#bd93f9" 28 28 29 + bspc config split_ratio 0.71 30 + 29 31 # Extra padding for polybar 30 32 bspc config -m primary top_padding 34 31 33 bspc config -m primary bottom_padding 0
+2 -2
home/profiles/desktop/dunstrc
··· 35 35 origin = top-right 36 36 37 37 # Offset from the origin 38 - offset = 12x28 38 + offset = 22x28 39 39 40 40 # Scale factor. It is auto-detected if value is 0. 41 41 scale = 0 ··· 182 182 hide_duplicate_count = true 183 183 184 184 # Display indicators for URLs (U) and actions (A). 185 - show_indicators = no 185 + show_indicators = yes 186 186 187 187 ### Icons ### 188 188
+40 -9
home/profiles/email/default.nix
··· 1 - { pkgs, ... }: 1 + { config, pkgs, lib, ... }: 2 + with lib; 3 + let 4 + safeName = lib.replaceStrings [ "@" ":" "\\" "[" "]" ] [ "-" "-" "-" "" "" ]; 5 + imapnotifyAccounts = 6 + filter (a: a.imapnotify.enable) (attrValues config.accounts.email.accounts); 7 + genAccountUnit = account: 8 + let name = safeName account.name; 9 + in 10 + { 11 + name = "imapnotify-${name}-mine"; 12 + value = { 13 + Unit = { Description = "imapnotify for ${name}"; }; 14 + 15 + Service = { 16 + ExecStart = "${pkgs.goimapnotify}/bin/goimapnotify -conf /nix/store/6030i9xdga98l2zyqarrqv5mrjynwm3i-imapnotify-anish-config.json"; # TODO horrible hard coded config location 17 + Restart = "always"; 18 + RestartSec = 30; 19 + Type = "simple"; 20 + # this is why we're overriding this stupid thing 21 + # We need dbus for notify-send on systemd 22 + Environment = [ 23 + "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus" 24 + "NOTMUCH_CONFIG=${config.xdg.configHome}/notmuch/default/config" 25 + ]; 26 + }; 27 + 28 + Install = { WantedBy = [ "default.target" ]; }; 29 + }; 30 + }; 2 31 32 + in 3 33 { 4 34 #age.secrets.fastmail.file = "/etc/nixos/secrets/fastmail.age"; 5 35 #age.secrets.fastmail.owner = "anish"; ··· 13 43 frequency = "*:0/30"; 14 44 #postExec = "${pkgs.notmuch}/bin/notmuch new"; 15 45 }; 46 + 47 + # call our stupid way of overriding the imapnotify service 48 + systemd.user.services = listToAttrs (map genAccountUnit [{ name = "anish"; }]); 49 + 16 50 services.imapnotify.enable = true; 17 51 programs.mbsync.enable = true; 18 52 programs.msmtp.enable = true; ··· 23 57 image/png; feh %s 24 58 image/jpeg; feh %s 25 59 ''; 60 + 26 61 programs.neomutt = { 27 62 enable = true; 28 63 extraConfig = '' ··· 31 66 set editor = "nvim +':set textwidth=0'" 32 67 33 68 #set virtual_spoolfile=yes 34 - set folder="~/Mail/anish" 69 + set folder="~/Maildir/anish" 35 70 set mbox_type = Maildir 36 - mailboxes `find ~/Mail/anish/* -maxdepth 0 -type d | grep -v "Trash\|Spam\|tmp\|new\|cur" | sed 's|/home/anish/Mail/anish|=\"|g' | sed 's|$|\"|g' | tr '\n' ' '` 71 + mailboxes `find ~/Maildir/anish/* -maxdepth 0 -type d | grep -v "Trash\|Spam\|tmp\|new\|cur" | sed 's|/home/anish/Maildir/anish|=\"|g' | sed 's|$|\"|g' | tr '\n' ' '` 37 72 38 73 ## Folder with emails 39 74 #set folder = "~/Mail/anish" ··· 269 304 extraConfig.local.subFolders = "Verbatim"; 270 305 }; 271 306 imapnotify = { 272 - enable = true; 307 + enable = false; 273 308 boxes = [ "Inbox" ]; 274 309 onNotify = "${pkgs.isync}/bin/mbsync anish && ${pkgs.notmuch}/bin/notmuch index"; 275 - onNotifyPost = { 276 - mail = "${pkgs.libnotify}/bin/notify-send -a mail 'email: new in %s'"; 277 - #update = "${pkgs.libnotify}/bin/notify-send -a mail 'email: update %s'"; 278 - #expunge = "${pkgs.libnotify}/bin/notify-send -a mail 'email: expunge %s'"; 279 - }; 310 + onNotifyPost = "${pkgs.libnotify}/bin/notify-send -a mail 'email: new in %s'"; 280 311 }; 281 312 msmtp.enable = true; 282 313 msmtp.extraConfig = {
+1
home/profiles/email/imapnotify-anish-config.json
··· 1 + {"boxes":["Inbox"],"host":"imap.fastmail.com","onNewMail":"/nix/store/pmvvqwrsyv6ah0x8c82hgkddas5f9ajb-isync-1.4.4/bin/mbsync anish && /nix/store/wyi8a02kk3vh5y7qhdkfzyibb1yl0xc1-notmuch-0.37/bin/notmuch index","onNewMailPost":{"mail":"/nix/store/q360zpybna4djr4kjhjg6hmkk3vj7pjf-libnotify-0.8.1/bin/notify-send -a mail 'email: new in %s'"},"passwordCmd":"'/nix/store/a7gvj343m05j2s32xcnwr35v31ynlypr-coreutils-9.1/bin/cat' '/run/agenix/fastmail'","port":993,"tls":true,"username":"anish@lakhwara.com"}
+3
secrets/secrets.nix
··· 14 14 "mossnet.age".publicKeys = allUserKeys; 15 15 "curve-wg.age".publicKeys = curve; 16 16 "box-wg.age".publicKeys = [ mossnet ]; 17 + "wallabag-password.age".publicKeys = [ mossnet ]; 18 + "wallabag-secret.age".publicKeys = [ mossnet ]; 19 + 17 20 "borg-password.age".publicKeys = systemOnly; 18 21 "freshrss-dbpass.age".publicKeys = [ helix ]; 19 22 "synapse-config.age".publicKeys = [ lituus ];