diff options
| -rw-r--r-- | lib/ivi.nix | 4 | ||||
| -rw-r--r-- | machines/serber.nix | 4 | ||||
| -rwxr-xr-x | mut/bin/notmuch-hook | 8 | ||||
| -rw-r--r-- | overlays/vimPlugins.nix | 1 | ||||
| -rw-r--r-- | profiles/email/neomutt.nix | 5 | ||||
| -rw-r--r-- | profiles/email/server.nix | 59 | ||||
| -rw-r--r-- | profiles/email/vinkland.nix | 49 |
7 files changed, 71 insertions, 59 deletions
diff --git a/lib/ivi.nix b/lib/ivi.nix index d4488d4..8fabf1b 100644 --- a/lib/ivi.nix +++ b/lib/ivi.nix @@ -54,8 +54,8 @@ self: lib: with lib; let username = "ivi"; githubUsername = "ivi-vink"; realName = "Mike Vink"; - domain = "vinkland.xyz"; - email = "ivi@vinkland.xyz"; + domain = "vinkies.net"; + email = "ivi@vinkies.net"; sshKeys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMT59Kbv+rO0PvB1q5u3l9wdUgsKT0M8vQ7WHnjq+kYN ${ivi.email}" "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDqsfYS7sOLfLWvGTmxT2QYGkbXJ5kREFl42n3jtte5sLps76KECgKqEjA4OLhNZ51lKFBDzcn1QOUl3RN4+qHsBtkr+02a7hhf1bBLeb1sx6+FVXdsarln5lUF/NMcpj6stUi8mqY4aQ21jQKxZsGip9fI8fx3HtXYCVhIarRbshQlwDqTplJBLDtrnmWTprxVnz1xSZRr3euXsIh1FFQZI6klPPBa6qFJtWWtGNBCRr8Sruo6I4on7QjNyW/s1OgiNAR0N2IO9wCdjlXrjNnFEAaMrpDpZde7eULbiFP2pHYVVy/InwNhhePYkeBh/4BzlaUZVv6gXsX7wOC5OyWaXbbMzWEopbnqeXXLwNyOZ88YpN/c+kZk2/1CHl+xmlVGAr9TnZ9VST5Y4ZAEqq8OKoP3ZcchAWxWjzTgPogSfiIAP/n5xrgB+8uRZb/gkN+I7RTQKGrS2Ex7gfkj39beDeevQj3XVQ1U2kp3n+jUBHItCCpZyHISgTYW2Ct6lrziJpD0kPlAOrN3BGQtkStHYK+4EE1PrrwWGkG7Ue+tlETe8FTg+AMv1VjLV9b3pHZJCrao5/cY2MxkfGzf4HTfeueqSLSsrYuiogHAPvvzfvOV5un+dWX8HyeBjmKTBwDBFuhdca/wzk0ArHSgEYUmh2NXj/G4gaSF3EX5ZSxmMQ== ${ivi.email}" diff --git a/machines/serber.nix b/machines/serber.nix index cf772ca..c94cdb6 100644 --- a/machines/serber.nix +++ b/machines/serber.nix @@ -37,8 +37,8 @@ system.stateVersion = "23.05"; boot.tmp.cleanOnBoot = true; zramSwap.enable = true; - networking.hostName = "vinkland"; - networking.domain = "xyz"; + networking.hostName = "vinkies"; + networking.domain = "net"; services.openssh.enable = true; } diff --git a/mut/bin/notmuch-hook b/mut/bin/notmuch-hook index da376b6..32cf9ab 100755 --- a/mut/bin/notmuch-hook +++ b/mut/bin/notmuch-hook @@ -8,10 +8,14 @@ notmuch tag -new +inbox +unread -- tag:new # Gmail + mbsync = a lot of duplicates due to the archive notmuch tag -new -inbox +archive -- 'folder:/Archive/ -folder:/Inbox/ -folder:/\[Gmail\]/ -folder:/FarDrafts/ -folder:/Important/ -folder:/Sent/' +notmuch tag --remove-all +sent -- folder:/Sent/ +notmuch tag --remove-all +drafts -- folder:/Drafts/ # Tag messages with files that were moved to trash in neomutt notmuch tag --remove-all +trash -- folder:/Trash/ + # Same but with messages with files that were moved to spam -notmuch tag --remove-all +spam -- folder:/Spam/ +notmuch tag --remove-all +spam -- folder:/Spam/ or folder:/Junk/ # Remove files of messages that were tagged but still have files left behind in the mailbox, should be fine since gmail already keeps a duplicate in the Archive so the message will not be deleted only one file of the message -notmuch search --output=files -- 'folder:/Inbox/ -tag:inbox' | grep Inbox | xargs >/dev/null 2>&1 rm +# TODO(): make this work with non gmail emails too +# notmuch search --output=files -- 'folder:/Inbox/ -tag:inbox' | grep Inbox | xargs >/dev/null 2>&1 rm diff --git a/overlays/vimPlugins.nix b/overlays/vimPlugins.nix index 65235fa..7933c5a 100644 --- a/overlays/vimPlugins.nix +++ b/overlays/vimPlugins.nix @@ -1,4 +1,3 @@ - {pkgs, ...}: (final: prev: { vimPlugins = let getVimPlugin = { diff --git a/profiles/email/neomutt.nix b/profiles/email/neomutt.nix index 4106f5b..da81207 100644 --- a/profiles/email/neomutt.nix +++ b/profiles/email/neomutt.nix @@ -188,10 +188,9 @@ macros = [ { map = ["index"]; key = "X"; action = "<save-message>=Spam<enter>y"; } { map = ["index"]; key = "A"; action = "<modify-labels-then-hide>+archive -unread -inbox<enter><mark-message>z<enter><change-folder>^<enter>'z"; } - { map = ["index"]; key = "h"; action = "<mark-message>z<enter><change-folder>^<enter>'z"; } { map = ["index"]; key = "D"; action = "<delete-message>"; } - { map = ["index" "pager"]; key = "S"; action = "<sync-mailbox>!notmuch-hook &<enter>"; } - { map = ["index"]; key = "c"; action = "<change-vfolder>?"; } + { map = ["index" "pager"]; key = "S"; action = "<sync-mailbox>!notmuch-hook<enter><mark-message>z<enter><change-folder>^<enter>'z"; } + { map = ["index"]; key = "h"; action = "<change-vfolder>?h"; } { map = ["index"]; key = "\\\\"; action = "<vfolder-from-query>"; } { map = ["browser"]; key = "h"; action = "<change-dir><kill-line>..<enter>"; } ]; diff --git a/profiles/email/server.nix b/profiles/email/server.nix new file mode 100644 index 0000000..9a5e16c --- /dev/null +++ b/profiles/email/server.nix @@ -0,0 +1,59 @@ +{ + inputs, + config, + pkgs, + lib, + ... +}: with lib; { + hm = { + accounts.email = { + accounts = { + ${ivi.username} = { + realName = "${ivi.realName}"; + userName = "${ivi.email}"; + address = "${ivi.email}"; + passwordCommand = ["${pkgs.pass}/bin/pass" "personal/mailserver"]; + imap = { host = "${ivi.domain}"; port = 993; tls = { enable = true; }; }; + smtp = { host = "${ivi.domain}"; port = 587; tls = { enable = true; useStartTls = true; }; }; + msmtp = { + enable = true; + }; + neomutt = { + enable = true; + sendMailCommand = "msmtp -a ${ivi.username}"; + mailboxName = "=== ${ivi.username} ==="; + extraConfig = '' + set spoolfile='Inbox' + unvirtual-mailboxes * + ''; + }; + mbsync = { + enable = true; + create = "both"; remove = "both"; expunge = "both"; + groups = { + ${ivi.username} = { + channels = { + All = { patterns = ["*"]; extraConfig = { Create = "Both"; Expunge = "Both"; Remove = "Both"; }; }; + }; + }; + }; + }; + notmuch = { + enable = true; + neomutt = { + enable = true; + virtualMailboxes = [ + { name = "Inbox"; query = "folder:/${ivi.username}/ tag:inbox"; } + { name = "Sent"; query = "folder:/${ivi.username}/ tag:sent"; } + { name = "Archive"; query = "folder:/${ivi.username}/ tag:archive"; } + { name = "Drafts"; query = "folder:/${ivi.username}/ tag:drafts"; } + { name = "Junk"; query = "folder:/${ivi.username}/ tag:spam"; } + { name = "Trash"; query = "folder:/${ivi.username}/ tag:trash"; } + ]; + }; + }; + }; + }; + }; + }; +} diff --git a/profiles/email/vinkland.nix b/profiles/email/vinkland.nix deleted file mode 100644 index 6e93d8b..0000000 --- a/profiles/email/vinkland.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ - inputs, - config, - pkgs, - ... -}: { - hm = { - accounts.email = { - accounts = { - ivi = { - realName = "Mike Vink"; - userName = "ivi@vinkland.xyz"; - address = "ivi@vinkland.xyz"; - passwordCommand = ["${pkgs.pass}/bin/pass" "personal/mailserver"]; - imap = { host = "vinkland.xyz"; port = 993; tls = { enable = true; }; }; - smtp = { host = "vinkland.xyz"; port = 587; tls = { enable = true; useStartTls = true; }; }; - msmtp = { - enable = true; - }; - neomutt = { - enable = true; - sendMailCommand = "msmtp -a ivi"; - mailboxName = "=== ivi ==="; - extraConfig = '' - set spoolfile='Inbox' - unvirtual-mailboxes * - ''; - }; - mbsync = { - enable = true; - create = "both"; remove = "both"; expunge = "both"; - }; - notmuch = { - enable = true; - neomutt = { - enable = true; - virtualMailboxes = [ - { name = "Drafts"; query = "folder:/ivi/ tag:trash"; } - { name = "Inbox"; query = "folder:/ivi/ tag:inbox"; } - { name = "Sent"; query = "folder:/ivi/ tag:sent"; } - { name = "Junk"; query = "folder:/ivi/ tag:trash"; } - ]; - }; - }; - }; - }; - }; - }; -} |
