From 2924b5d1a078c9e2c0e1256fc5b571ac8efb0bb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Yule=20B=C3=A4dorf?= Date: Tue, 26 Mar 2024 22:07:02 +0100 Subject: [PATCH] email: use home-manager configuration options --- flake.lock | 26 +-- flake.nix | 2 +- hosts/stroopwafel/configuration.nix | 1 + overlays/default.nix | 1 + pkgs/check-mail.nix | 14 ++ pkgs/default.nix | 3 +- pkgs/psos-docs.nix | 27 --- pkgs/psos.nix | 34 --- pkgs/toggle-kbd-layout.nix | 11 +- .../neomutt}/admins@pub.solar.signature | 0 .../mutt => .config/neomutt}/base16.muttrc | 0 ...le.baedorf@ext.ehealthexperts.de.signature | 0 .../benjamin.baedorf@rwth-aachen.de.signature | 0 ...jamin.yule.baedorf@verkstedt.com.signature | 0 .../neomutt}/byb@miom.space.signature | 0 .../neomutt}/crew@pub.solar.signature | 0 .../hello@benjaminbaedorf.eu.signature | 0 .../neomutt}/mail@b12f.io.signature | 0 .../.config/mutt => .config/neomutt}/mailcap | 0 users/b12f/default.nix | 2 +- users/b12f/email.nix | 206 ++++++++++++++++++ users/b12f/email/.config/msmtp/config | 63 ------ .../.config/mutt/admins@pub.solar.muttrc | 21 -- ...-yule.baedorf@ext.ehealthexperts.de.muttrc | 24 -- .../benjamin.baedorf@rwth-aachen.de.muttrc | 21 -- ...benjamin.yule.baedorf@verkstedt.com.muttrc | 32 --- .../email/.config/mutt/byb@miom.space.muttrc | 21 -- .../email/.config/mutt/crew@pub.solar.muttrc | 21 -- .../mutt/hello@benjaminbaedorf.eu.muttrc | 21 -- .../email/.config/mutt/mail@b12f.io.muttrc | 21 -- users/b12f/email/.config/mutt/muttrc | 104 --------- users/b12f/email/.config/offlineimap/config | 100 --------- .../email/.config/offlineimap/functions.py | 9 - users/b12f/email/default.nix | 60 ----- 34 files changed, 245 insertions(+), 600 deletions(-) create mode 100644 pkgs/check-mail.nix delete mode 100644 pkgs/psos-docs.nix delete mode 100644 pkgs/psos.nix rename users/b12f/{email/.config/mutt => .config/neomutt}/admins@pub.solar.signature (100%) rename users/b12f/{email/.config/mutt => .config/neomutt}/base16.muttrc (100%) rename users/b12f/{email/.config/mutt => .config/neomutt}/benjamin-yule.baedorf@ext.ehealthexperts.de.signature (100%) create mode 100644 users/b12f/.config/neomutt/benjamin.baedorf@rwth-aachen.de.signature rename users/b12f/{email/.config/mutt => .config/neomutt}/benjamin.yule.baedorf@verkstedt.com.signature (100%) rename users/b12f/{email/.config/mutt => .config/neomutt}/byb@miom.space.signature (100%) rename users/b12f/{email/.config/mutt => .config/neomutt}/crew@pub.solar.signature (100%) rename users/b12f/{email/.config/mutt => .config/neomutt}/hello@benjaminbaedorf.eu.signature (100%) rename users/b12f/{email/.config/mutt => .config/neomutt}/mail@b12f.io.signature (100%) rename users/b12f/{email/.config/mutt => .config/neomutt}/mailcap (100%) create mode 100644 users/b12f/email.nix delete mode 100644 users/b12f/email/.config/msmtp/config delete mode 100644 users/b12f/email/.config/mutt/admins@pub.solar.muttrc delete mode 100644 users/b12f/email/.config/mutt/benjamin-yule.baedorf@ext.ehealthexperts.de.muttrc delete mode 100644 users/b12f/email/.config/mutt/benjamin.baedorf@rwth-aachen.de.muttrc delete mode 100644 users/b12f/email/.config/mutt/benjamin.yule.baedorf@verkstedt.com.muttrc delete mode 100644 users/b12f/email/.config/mutt/byb@miom.space.muttrc delete mode 100644 users/b12f/email/.config/mutt/crew@pub.solar.muttrc delete mode 100644 users/b12f/email/.config/mutt/hello@benjaminbaedorf.eu.muttrc delete mode 100644 users/b12f/email/.config/mutt/mail@b12f.io.muttrc delete mode 100644 users/b12f/email/.config/mutt/muttrc delete mode 100644 users/b12f/email/.config/offlineimap/config delete mode 100644 users/b12f/email/.config/offlineimap/functions.py delete mode 100644 users/b12f/email/default.nix diff --git a/flake.lock b/flake.lock index 0e2f611..e58c787 100644 --- a/flake.lock +++ b/flake.lock @@ -256,16 +256,16 @@ ] }, "locked": { - "lastModified": 1702676849, - "narHash": "sha256-XqcREaTS38/QOsN8fk8PP325/UXHyF9enbP5ZPw5aiA=", + "lastModified": 1711133180, + "narHash": "sha256-WJOahf+6115+GMl3wUfURu8fszuNeJLv9qAWFQl3Vmo=", "owner": "nix-community", "repo": "home-manager", - "rev": "aa99c2f4e9847cbb7e46fac0844ea1eb164b3b3a", + "rev": "1c2c5e4cabba4c43504ef0f8cc3f3dfa284e2dbb", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-23.11", + "ref": "master", "repo": "home-manager", "type": "github" } @@ -423,11 +423,11 @@ }, "nixpkgs-master": { "locked": { - "lastModified": 1710871319, - "narHash": "sha256-y30iYkmVpi6o2yCLH8Iz7Bi7XXuNOmCPmxFIdNMW9Og=", + "lastModified": 1711485334, + "narHash": "sha256-qOHrFSfo6W5J5RkkJy7xLSECKaK/NITQXfeh715fD7s=", "owner": "nixos", "repo": "nixpkgs", - "rev": "f4fb648799ae71ac118a2a1c8b92698f2a01e246", + "rev": "e19e9bceda53148e8dd6e8f54bf19375e5e60af9", "type": "github" }, "original": { @@ -439,11 +439,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1710806803, - "narHash": "sha256-qrxvLS888pNJFwJdK+hf1wpRCSQcqA6W5+Ox202NDa0=", + "lastModified": 1711333969, + "narHash": "sha256-5PiWGn10DQjMZee5NXzeA6ccsv60iLu+Xtw+mfvkUAs=", "owner": "nixos", "repo": "nixpkgs", - "rev": "b06025f1533a1e07b6db3e75151caa155d1c7eb3", + "rev": "57e6b3a9e4ebec5aa121188301f04a6b8c354c9b", "type": "github" }, "original": { @@ -487,11 +487,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1710695816, - "narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=", + "lastModified": 1711124224, + "narHash": "sha256-l0zlN/3CiodvWDtfBOVxeTwYSRz93muVbXWSpaMjXxM=", "owner": "nixos", "repo": "nixpkgs", - "rev": "614b4613980a522ba49f0d194531beddbb7220d3", + "rev": "56528ee42526794d413d6f244648aaee4a7b56c0", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index dd6266d..58e0944 100644 --- a/flake.nix +++ b/flake.nix @@ -12,7 +12,7 @@ flake-compat.url = "github:edolstra/flake-compat"; flake-compat.flake = false; - home-manager.url = "github:nix-community/home-manager/release-23.11"; + home-manager.url = "github:nix-community/home-manager/master"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; flake-parts.url = "github:hercules-ci/flake-parts"; diff --git a/hosts/stroopwafel/configuration.nix b/hosts/stroopwafel/configuration.nix index 705a583..b5f5835 100644 --- a/hosts/stroopwafel/configuration.nix +++ b/hosts/stroopwafel/configuration.nix @@ -19,6 +19,7 @@ in { boot.swraid.mdadmConf = '' DEVICE /dev/nvme0n1p2 /dev/nvme1n1p2 ARRAY /dev/md/nixos:root metadata=1.2 name=nixos:root UUID=67d1aa81:1b348887:c17a75e8:f2edf2bd +MAILADDR ${psCfg.user.email} ''; pub-solar.core.hibernation.enable = true; diff --git a/overlays/default.nix b/overlays/default.nix index 73c48b7..5f4dc5f 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -17,6 +17,7 @@ factorio-headless = master.factorio-headless; paperless-ngx = master.paperless-ngx; waybar = master.waybar; + ungoogled-chromium = master.ungoogled-chromium; adlist = inputs.adblock-unbound.packages.${prev.system}; diff --git a/pkgs/check-mail.nix b/pkgs/check-mail.nix new file mode 100644 index 0000000..7a5390e --- /dev/null +++ b/pkgs/check-mail.nix @@ -0,0 +1,14 @@ +self: +with self; '' + ${offlineimap}/bin/offlineimap + + for dir in ~/Mail/* + do + unread=$(find "''${dir}/INBOX/" -type f | grep -vE ',[^,]*S[^,]*$') + + if [ ! -z "''${unread}" ]; then + inbox=$(basename $dir) + ${libnotify}/bin/notify-send "''${inbox} has unread mail" + fi + done +'' diff --git a/pkgs/default.nix b/pkgs/default.nix index 04031cb..6c5eef6 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -13,8 +13,7 @@ with prev; { mu = writeShellScriptBin "mu" (import ./mu.nix final); p = writeShellScriptBin "p" (import ./p.nix final); present-md = writeShellScriptBin "present-md" (import ./present-md.nix final); - psos = writeShellScriptBin "psos" (import ./psos.nix final); - psos-docs = import ./psos-docs.nix final; + check-mail = writeShellScriptBin "check-mail" (import ./check-mail.nix final); s = writeShellScriptBin "s" (import ./s.nix final); sway-launcher = writeScriptBin "sway-launcher" (import ./sway-launcher.nix final); sway-service = writeShellScriptBin "sway-service" (import ./sway-service.nix final); diff --git a/pkgs/psos-docs.nix b/pkgs/psos-docs.nix deleted file mode 100644 index 24e86bf..0000000 --- a/pkgs/psos-docs.nix +++ /dev/null @@ -1,27 +0,0 @@ -self: -with self; - stdenv.mkDerivation rec { - pname = "psos-docs"; - version = "0.0.1"; - buildInputs = [ - mdbook - mdbook-pdf - ]; - - src = ../docs/..; # wut - - phases = ["buildPhase" "installPhase"]; - - buildPhase = '' - cp -r $src/doc ./doc - cp $src/README.md ./README.md - chmod ug+w -R . - ls -la . - mdbook build doc - ''; - - installPhase = '' - mkdir -p $out/lib/ - cp -r doc/book $out/lib/html - ''; - } diff --git a/pkgs/psos.nix b/pkgs/psos.nix deleted file mode 100644 index 7846f80..0000000 --- a/pkgs/psos.nix +++ /dev/null @@ -1,34 +0,0 @@ -self: -with self; '' - case $1 in - rebuild) - shift; - exec sudo nixos-rebuild switch --flake "/etc/nixos#installed-host" $@ - ;; - update) - shift; - cd /etc/nixos - git pull - exec nix flake update - ;; - option) - shift; - exec nixos-option -I nixpkgs=/etc/nixos/lib/compat $@ - ;; - help) - shift; - exec xdg-open http://help.local/ - ;; - *) - if [[ "$@" != "" ]]; then - echo "Unknown command: psos $@" - echo "" - fi - echo "Usage: psos [COMMAND]" - echo " rebuild Rebuild the configuration and switch to it" - echo " update Pull git and update flake.lock" - echo " option [path] See the current value for an option in the flake config. Example: psos option nix.nixPath" - exit 1 - ;; - esac -'' diff --git a/pkgs/toggle-kbd-layout.nix b/pkgs/toggle-kbd-layout.nix index a35de23..a710eab 100644 --- a/pkgs/toggle-kbd-layout.nix +++ b/pkgs/toggle-kbd-layout.nix @@ -5,12 +5,15 @@ with self; '' current_layout=$(${sway}/bin/swaymsg -t get_inputs | ${jq}/bin/jq -r '.[] | select(.type == "keyboard") | .xkb_active_layout_index' | head -1) total_layouts=$(${sway}/bin/swaymsg -t get_inputs | ${jq}/bin/jq -r '.[] | select(.type == "keyboard") | .xkb_layout_names | length' | head -1) - next_layout=$(expr $current_layout + 1); + next_layout_index=$(expr $current_layout + 1); - if [ $next_layout -ge $total_layouts ]; then - next_layout=0; + if [ $next_layout_index -ge $total_layouts ]; then + next_layout_index=0; fi + ${sway}/bin/swaymsg input '*' xkb_switch_layout "$next_layout_index" + + echo $next_layout_index + next_layout=$(${sway}/bin/swaymsg -t get_inputs | ${jq}/bin/jq -r "[ .[] | select(.type == \"keyboard\") | .xkb_layout_names ][0].[$next_layout_index]") ${libnotify}/bin/notify-send "$next_layout" - ${sway}/bin/swaymsg input '*' xkb_switch_layout "$next_layout" '' diff --git a/users/b12f/email/.config/mutt/admins@pub.solar.signature b/users/b12f/.config/neomutt/admins@pub.solar.signature similarity index 100% rename from users/b12f/email/.config/mutt/admins@pub.solar.signature rename to users/b12f/.config/neomutt/admins@pub.solar.signature diff --git a/users/b12f/email/.config/mutt/base16.muttrc b/users/b12f/.config/neomutt/base16.muttrc similarity index 100% rename from users/b12f/email/.config/mutt/base16.muttrc rename to users/b12f/.config/neomutt/base16.muttrc diff --git a/users/b12f/email/.config/mutt/benjamin-yule.baedorf@ext.ehealthexperts.de.signature b/users/b12f/.config/neomutt/benjamin-yule.baedorf@ext.ehealthexperts.de.signature similarity index 100% rename from users/b12f/email/.config/mutt/benjamin-yule.baedorf@ext.ehealthexperts.de.signature rename to users/b12f/.config/neomutt/benjamin-yule.baedorf@ext.ehealthexperts.de.signature diff --git a/users/b12f/.config/neomutt/benjamin.baedorf@rwth-aachen.de.signature b/users/b12f/.config/neomutt/benjamin.baedorf@rwth-aachen.de.signature new file mode 100644 index 0000000..e69de29 diff --git a/users/b12f/email/.config/mutt/benjamin.yule.baedorf@verkstedt.com.signature b/users/b12f/.config/neomutt/benjamin.yule.baedorf@verkstedt.com.signature similarity index 100% rename from users/b12f/email/.config/mutt/benjamin.yule.baedorf@verkstedt.com.signature rename to users/b12f/.config/neomutt/benjamin.yule.baedorf@verkstedt.com.signature diff --git a/users/b12f/email/.config/mutt/byb@miom.space.signature b/users/b12f/.config/neomutt/byb@miom.space.signature similarity index 100% rename from users/b12f/email/.config/mutt/byb@miom.space.signature rename to users/b12f/.config/neomutt/byb@miom.space.signature diff --git a/users/b12f/email/.config/mutt/crew@pub.solar.signature b/users/b12f/.config/neomutt/crew@pub.solar.signature similarity index 100% rename from users/b12f/email/.config/mutt/crew@pub.solar.signature rename to users/b12f/.config/neomutt/crew@pub.solar.signature diff --git a/users/b12f/email/.config/mutt/hello@benjaminbaedorf.eu.signature b/users/b12f/.config/neomutt/hello@benjaminbaedorf.eu.signature similarity index 100% rename from users/b12f/email/.config/mutt/hello@benjaminbaedorf.eu.signature rename to users/b12f/.config/neomutt/hello@benjaminbaedorf.eu.signature diff --git a/users/b12f/email/.config/mutt/mail@b12f.io.signature b/users/b12f/.config/neomutt/mail@b12f.io.signature similarity index 100% rename from users/b12f/email/.config/mutt/mail@b12f.io.signature rename to users/b12f/.config/neomutt/mail@b12f.io.signature diff --git a/users/b12f/email/.config/mutt/mailcap b/users/b12f/.config/neomutt/mailcap similarity index 100% rename from users/b12f/email/.config/mutt/mailcap rename to users/b12f/.config/neomutt/mailcap diff --git a/users/b12f/default.nix b/users/b12f/default.nix index 6c17522..5c79c66 100644 --- a/users/b12f/default.nix +++ b/users/b12f/default.nix @@ -15,7 +15,7 @@ in { ./ssh.nix ./concepts-and-training.nix ./ehex.nix - ./email + ./email.nix ]; config = { diff --git a/users/b12f/email.nix b/users/b12f/email.nix new file mode 100644 index 0000000..2b96db4 --- /dev/null +++ b/users/b12f/email.nix @@ -0,0 +1,206 @@ +{ + lib, + config, + pkgs, + ... +}: +with lib; let + psCfg = config.pub-solar; + xdg = config.home-manager.users."${psCfg.user.name}".xdg; + configHome = xdg.configHome; + cacheHome = xdg.cacheHome; + + generateMailAccount = args@{ address, ... }: rec { + inherit address; + realName = psCfg.user.fullName; + signature = { + showSignature = "append"; + text = builtins.readFile (./.config/neomutt + "/${address}.signature"); + }; + + folders = { + inbox = "INBOX"; + drafts = "Drafts"; + sent = "Sent"; + trash = "Trash"; + }; + + gpg.key = psCfg.user.gpgKeyId; + + userName = address; + passwordCommand = "secret-tool lookup email ${address}"; + imap = { + host = mkIf (args ? "host") args.host; + port = 993; + }; + smtp = { + host = mkIf (args ? "host") args.host; + port = 587; + tls.useStartTls = true; + }; + + imapnotify = { + enable = true; + boxes = [ "INBOX" ]; + onNotifyPost = "${pkgs.libnotify}/bin/notify-send '${address} has new mail'"; + }; + msmtp.enable = true; + neomutt = { + enable = true; + sendMailCommand = "msmtp -a ${address}"; + extraConfig = '' + set pgp_default_key="${gpg.key}" + + mailboxes +INBOX \ + +Drafts \ + +Sent \ + +Archive \ + +Trash + ''; + }; + offlineimap.enable = true; + } // (if args ? "config" then args.config else {}); +in { + users.users."${psCfg.user.name}".packages = with pkgs; [ + w3m + mailto-mutt + check-mail + ]; + + home-manager.users."${psCfg.user.name}" = rec { + xdg.configFile."neomutt/base16.muttrc".source = ./.config/neomutt/base16.muttrc; + xdg.configFile."neomutt/mailcap".source = ./.config/neomutt/mailcap; + + accounts.email = { + maildirBasePath = "/home/${psCfg.user.name}/Mail"; + + accounts = lib.lists.foldr (item: set: (set // { "${item.address}" = generateMailAccount item; })) {} [ + { + address = "hello@benjaminbaedorf.eu"; + host = "mail.hosting.de"; + config.primary = true; + } + { + address = "mail@b12f.io"; + host = "mail.b12f.io"; + } + { + address = "benjamin.baedorf@rwth-aachen.de"; + host = "mail.rwth-aachen.de"; + config.userName = "bb564306@rwth-aachen.de"; + } + { + address = "byb@miom.space"; + host = "mail.hosting.de"; + } + { + address = "admins@pub.solar"; + host = "mail.greenbaum.zone"; + } + { + address = "crew@pub.solar"; + host = "mail.greenbaum.zone"; + } + { + address = "benjamin.yule.baedorf@verkstedt.com"; + flavor = "gmail"; + config = { + smtp.host = "smtp.gmail.com"; + imap.host = "imap.gmail.com"; + }; + } + { + address = "benjamin-yule.baedorf@ext.ehealthexperts.de"; + config = { + smtp.host = "smtp.mailbox.org"; + imap.host = "imap.mailbox.org"; + }; + } + ]; + }; + + programs.offlineimap.enable = true; + programs.msmtp.enable = true; + programs.neomutt = { + enable = true; + binds = [ + # Moving around + { map = ["generic"]; key = "g"; action = "noop"; } + { map = ["generic"]; key = "gg"; action = "first-entry"; } + { map = ["generic" "index"]; key = "G"; action = "last-entry"; } + { map = ["generic" "index"]; key = "i"; action = "previous-entry"; } + { map = ["generic" "index"]; key = "k"; action = "next-entry"; } + { map = ["pager" "index"]; key = "d"; action = "noop"; } + { map = ["pager" "index"]; key = "dd"; action = "delete-message"; } + { map = ["pager"]; key = "i"; action = "previous-line"; } + { map = ["pager"]; key = "k"; action = "next-line"; } + { map = ["pager"]; key = "I"; action = "previous-entry"; } + { map = ["pager"]; key = "K"; action = "next-entry"; } + + { map = ["pager"]; key = "r"; action = "noop"; } + { map = ["pager"]; key = "rr"; action = "reply"; } + { map = ["pager"]; key = "ra"; action = "group-reply"; } + { map = ["pager"]; key = "rn"; action = "group-chat-reply"; } + { map = ["pager"]; key = "rl"; action = "list-reply"; } + + # Threads + { map = ["browser" "pager" "index"]; key = "N"; action = "search-opposite"; } + { map = ["pager" "index"]; key = "dT"; action = "delete-thread"; } + { map = ["pager" "index"]; key = "dt"; action = "delete-subthread"; } + { map = ["pager" "index"]; key = "g"; action = "noop"; } + { map = ["pager" "index"]; key = "gt"; action = "next-thread"; } + { map = ["pager" "index"]; key = "gT"; action = "previous-thread"; } + { map = ["index"]; key = "za"; action = "collapse-thread"; } + { map = ["index"]; key = "zA"; action = "collapse-all"; } + ]; + + macros = [ + # Enable URL opening + { + map = ["index" "pager"]; + key = "\\Cb"; + action = '' urlscan" "call urlscan to extract URLs out of a message''; + } + { + map = ["attach" "compose"]; + key = "\\Cb"; + action = '' urlscan" "call urlscan to extract URLs out of a message''; + } + # Translate markdown to html + { + map = ["compose"]; + key = "\\e5"; + action = ''F pandoc -s -f markdown -t html \ny^T^Utext/html; charset=utf-8\n''; + } + # Save to ~/Downloads by default + { + map = ["attach"]; + key = "S"; + action = ''~/Downloads/" "Save to Downloads''; + } + ] ++ lib.lists.imap1 (i: address: { + map = ["index" "pager"]; + key = ""; + action = ''source ${configHome}/neomutt/${address}!''; + }) (builtins.attrNames accounts.email.accounts); + + unmailboxes = true; + extraConfig = '' + source ${configHome}/neomutt/base16.muttrc + + # HTML emails + auto_view text/html # view html automatically + alternative_order text/plain text/enriched text/html # save html for last + ''; + + settings = { + sendmail_wait = "0"; + crypt_verify_sig = "yes"; + imap_check_subscribed = "yes"; + date_format = ''"!%d.%m.%Y %H:%M"''; + index_format = ''"%4C %Z %D %4c %20.20L %s"''; + mailcap_path = "${configHome}/neomutt/mailcap"; + }; + }; + }; +} diff --git a/users/b12f/email/.config/msmtp/config b/users/b12f/email/.config/msmtp/config deleted file mode 100644 index bcbce82..0000000 --- a/users/b12f/email/.config/msmtp/config +++ /dev/null @@ -1,63 +0,0 @@ -defaults - auth on - tls on - tls_trust_file /etc/ssl/certs/ca-certificates.crt - -account hello@benjaminbaedorf.eu - host mail.hosting.de - port 587 - protocol smtp - from hello@benjaminbaedorf.eu - user hello@benjaminbaedorf.eu - -account benjamin.baedorf@rwth-aachen.de - host mail.rwth-aachen.de - port 587 - protocol smtp - from benjamin.baedorf@rwth-aachen.de - user bb564306@rwth-aachen.de - -account byb@miom.space - host mail.hosting.de - port 587 - protocol smtp - from byb@miom.space - user byb@miom.space - -account admins@pub.solar - host mail.greenbaum.zone - port 587 - protocol smtp - from admins@pub.solar - user admins@pub.solar - -account crew@pub.solar - host mail.greenbaum.zone - port 587 - protocol smtp - from crew@pub.solar - user crew@pub.solar - -account mail@b12f.io - host mail.b12f.io - port 587 - protocol smtp - from mail@b12f.io - user mail@b12f.io - -account benjamin.yule.baedorf@verkstedt.com - host smtp.gmail.com - port 587 - protocol smtp - from benjamin.yule.baedorf@verkstedt.com - user benjamin.yule.baedorf@verkstedt.com - -account benjamin-yule.baedorf@ext.ehealthexperts.de - host smtp.mailbox.org - port 587 - protocol smtp - from benjamin-yule.baedorf@ext.ehealthexperts.de - user benjamin-yule.baedorf@ext.ehealthexperts.de - - -account default : hello@benjaminbaedorf.eu diff --git a/users/b12f/email/.config/mutt/admins@pub.solar.muttrc b/users/b12f/email/.config/mutt/admins@pub.solar.muttrc deleted file mode 100644 index df2df8e..0000000 --- a/users/b12f/email/.config/mutt/admins@pub.solar.muttrc +++ /dev/null @@ -1,21 +0,0 @@ -# vim: filetype=muttrc - -set from = "pub.solar Admins " -set sendmail = "msmtp -a admins@pub.solar" -set signature = "~/.config/mutt/admins@pub.solar.signature" - -set pgp_default_key="8A8987ADE3736C8CA2EB315A9B809EBBDD62BAE3" - -set mbox_type = Maildir -set folder = ~/Mail -set spoolfile = "+admins\@pub.solar/INBOX" -set postponed = "+admins\@pub.solar/Drafts" -set record = "+admins\@pub.solar/Sent" -set trash = "+admins\@pub.solar/Trash" -mbox-hook = "+admins\@pub.solar/Archive" -unmailboxes * -mailboxes +admins\@pub.solar/INBOX \ - +admins\@pub.solar/Drafts \ - +admins\@pub.solar/Sent \ - +admins\@pub.solar/Archive \ - +admins\@pub.solar/Trash diff --git a/users/b12f/email/.config/mutt/benjamin-yule.baedorf@ext.ehealthexperts.de.muttrc b/users/b12f/email/.config/mutt/benjamin-yule.baedorf@ext.ehealthexperts.de.muttrc deleted file mode 100644 index 5bd9348..0000000 --- a/users/b12f/email/.config/mutt/benjamin-yule.baedorf@ext.ehealthexperts.de.muttrc +++ /dev/null @@ -1,24 +0,0 @@ -# vim: filetype=muttrc - -set from = "Yule Bädorf " -set sendmail = "msmtp -a benjamin-yule.baedorf@ext.ehealthexperts.de" -set signature = "~/.config/mutt/benjamin-yule.baedorf@ext.ehealthexperts.de.signature" - -set pgp_default_key="8A8987ADE3736C8CA2EB315A9B809EBBDD62BAE3" - -set imap_user = benjamin-yule.baedorf@ext.ehealthexperts.de -set imap_pass = `secret-tool lookup service smtp host smtp.mailbox.org user benjamin-yule.baedorf@ext.ehealthexperts.de` - -set folder = imaps://imap.mailbox.org:993 - -set spoolfile = "+INBOX" -set postponed = "+Drafts" -set record = "+Sent" -set trash = "+Trash" -mbox-hook = "+Archive" -unmailboxes * -mailboxes +INBOX \ - +Drafts \ - +Sent \ - +Archive \ - +Trash diff --git a/users/b12f/email/.config/mutt/benjamin.baedorf@rwth-aachen.de.muttrc b/users/b12f/email/.config/mutt/benjamin.baedorf@rwth-aachen.de.muttrc deleted file mode 100644 index 94bafd9..0000000 --- a/users/b12f/email/.config/mutt/benjamin.baedorf@rwth-aachen.de.muttrc +++ /dev/null @@ -1,21 +0,0 @@ -# vim: filetype=muttrc - -set from = "Benjamin Bädorf " -set sendmail = "msmtp -a benjamin.baedorf@rwth-aachen.de" -set signature = "~/.config/mutt/hello@benjaminbaedorf.eu.signature" - -set pgp_default_key="FC623BBCBD2604D5CC9D90BAE77B0AAAF0D9B76B" - -set mbox_type = Maildir -set folder = ~/Mail -set spoolfile = "+benjamin.baedorf\@rwth-aachen.de/INBOX" -set postponed = "+benjamin.baedorf\@rwth-aachen.de/Drafts" -set record = "+benjamin.baedorf\@rwth-aachen.de/Sent" -set trash = "+benjamin.baedorf\@rwth-aachen.de/Trash" -mbox-hook = "+benjamin.baedorf\@rwth-aachen.de/Journal" -unmailboxes * -mailboxes +benjamin.baedorf\@rwth-aachen.de/INBOX \ - +benjamin.baedorf\@rwth-aachen.de/Drafts \ - +benjamin.baedorf\@rwth-aachen.de/Sent \ - +benjamin.baedorf\@rwth-aachen.de/Journal \ - +benjamin.baedorf\@rwth-aachen.de/Trash diff --git a/users/b12f/email/.config/mutt/benjamin.yule.baedorf@verkstedt.com.muttrc b/users/b12f/email/.config/mutt/benjamin.yule.baedorf@verkstedt.com.muttrc deleted file mode 100644 index 4d5d095..0000000 --- a/users/b12f/email/.config/mutt/benjamin.yule.baedorf@verkstedt.com.muttrc +++ /dev/null @@ -1,32 +0,0 @@ -# vim: filetype=muttrc - -set from = "Yule Bädorf " -set sendmail = "msmtp -a benjamin.yule.baedorf@verkstedt.com" -set signature = "~/.config/mutt/benjamin.yule.baedorf@verkstedt.com.signature" - -set pgp_default_key="8A8987ADE3736C8CA2EB315A9B809EBBDD62BAE3" - -set imap_user = benjamin.yule.baedorf@verkstedt.com -set imap_pass = `secret-tool lookup service smtp host smtp.gmail.com user benjamin.yule.baedorf@verkstedt.com` - -# My mailboxes -set folder = "imaps://imap.gmail.com:993" -set spoolfile = "+INBOX" -set postponed = "+[Gmail]/Drafts" - -set folder = imaps://imap.mailbox.org:993 - -set spoolfile = "+INBOX" -set postponed = "+Drafts" -set record = "+Sent" -set trash = "+Trash" -mbox-hook = "+Archive" -unmailboxes * -mailboxes +INBOX \ - +Drafts \ - +Sent \ - +Archive \ - +Trash - - - diff --git a/users/b12f/email/.config/mutt/byb@miom.space.muttrc b/users/b12f/email/.config/mutt/byb@miom.space.muttrc deleted file mode 100644 index 5de9b95..0000000 --- a/users/b12f/email/.config/mutt/byb@miom.space.muttrc +++ /dev/null @@ -1,21 +0,0 @@ -# vim: filetype=muttrc - -set from = "Benjamin Bädorf " -set sendmail = "msmtp -a byb@miom.space" -set signature = "~/.config/mutt/byb@miom.space.signature" - -set pgp_default_key="FC623BBCBD2604D5CC9D90BAE77B0AAAF0D9B76B" - -set mbox_type = Maildir -set folder = ~/Mail -set spoolfile = "+byb\@miom.space/INBOX" -set postponed = "+byb\@miom.space/Drafts" -set record = "+byb\@miom.space/Sent" -set trash = "+byb\@miom.space/Trash" -mbox-hook = "+byb\@miom.space/Archive" -unmailboxes * -mailboxes +byb\@miom.space/INBOX \ - +byb\@miom.space/Drafts \ - +byb\@miom.space/Sent \ - +byb\@miom.space/Archive \ - +byb\@miom.space/Trash diff --git a/users/b12f/email/.config/mutt/crew@pub.solar.muttrc b/users/b12f/email/.config/mutt/crew@pub.solar.muttrc deleted file mode 100644 index b2e0ef6..0000000 --- a/users/b12f/email/.config/mutt/crew@pub.solar.muttrc +++ /dev/null @@ -1,21 +0,0 @@ -# vim: filetype=muttrc - -set from = "pub.solar crew " -set sendmail = "msmtp -a crew@pub.solar" -set signature = "~/.config/mutt/crew@pub.solar.signature" - -set pgp_default_key="8A8987ADE3736C8CA2EB315A9B809EBBDD62BAE3" - -set mbox_type = Maildir -set folder = ~/Mail -set spoolfile = "+crew\@pub.solar/INBOX" -set postponed = "+crew\@pub.solar/Drafts" -set record = "+crew\@pub.solar/Sent" -set trash = "+crew\@pub.solar/Trash" -mbox-hook = "+crew\@pub.solar/Archive" -unmailboxes * -mailboxes +crew\@pub.solar/INBOX \ - +crew\@pub.solar/Drafts \ - +crew\@pub.solar/Sent \ - +crew\@pub.solar/Archive \ - +crew\@pub.solar/Trash diff --git a/users/b12f/email/.config/mutt/hello@benjaminbaedorf.eu.muttrc b/users/b12f/email/.config/mutt/hello@benjaminbaedorf.eu.muttrc deleted file mode 100644 index 581adf2..0000000 --- a/users/b12f/email/.config/mutt/hello@benjaminbaedorf.eu.muttrc +++ /dev/null @@ -1,21 +0,0 @@ -# vim: filetype=muttrc - -set from = "Benjamin Bädorf " -set sendmail = "msmtp -a hello@benjaminbaedorf.eu" -set signature = "~/.config/mutt/hello@benjaminbaedorf.eu.signature" - -set pgp_default_key="FC623BBCBD2604D5CC9D90BAE77B0AAAF0D9B76B" - -set mbox_type = Maildir -set folder = ~/Mail -set spoolfile = "+hello\@benjaminbaedorf.eu/INBOX" -set postponed = "+hello\@benjaminbaedorf.eu/Drafts" -set record = "+hello\@benjaminbaedorf.eu/Sent" -set trash = "+hello\@benjaminbaedorf.eu/Trash" -mbox-hook = "+hello\@benjaminbaedorf.eu/Archive" -unmailboxes * -mailboxes +hello\@benjaminbaedorf.eu/INBOX \ - +hello\@benjaminbaedorf.eu/Drafts \ - +hello\@benjaminbaedorf.eu/Sent \ - +hello\@benjaminbaedorf.eu/Archive \ - +hello\@benjaminbaedorf.eu/Trash diff --git a/users/b12f/email/.config/mutt/mail@b12f.io.muttrc b/users/b12f/email/.config/mutt/mail@b12f.io.muttrc deleted file mode 100644 index 6f36c2d..0000000 --- a/users/b12f/email/.config/mutt/mail@b12f.io.muttrc +++ /dev/null @@ -1,21 +0,0 @@ -# vim: filetype=muttrc - -set from = "Benjamin Bädorf " -set sendmail = "msmtp -a mail@b12f.io" -set signature = "~/.config/mutt/mail@b12f.io.signature" - -set pgp_default_key="FC623BBCBD2604D5CC9D90BAE77B0AAAF0D9B76B" - -set mbox_type = Maildir -set folder = ~/Mail -set spoolfile = "+mail\@b12f.io/INBOX" -set postponed = "+mail\@b12f.io/Drafts" -set record = "+mail\@b12f.io/Sent" -set trash = "+mail\@b12f.io/Trash" -mbox-hook = "+mail\@b12f.io/Archive" -unmailboxes * -mailboxes +mail\@b12f.io/INBOX \ - +mail\@b12f.io/Drafts \ - +mail\@b12f.io/Sent \ - +mail\@b12f.io/Archive \ - +mail\@b12f.io/Trash diff --git a/users/b12f/email/.config/mutt/muttrc b/users/b12f/email/.config/mutt/muttrc deleted file mode 100644 index 37a78c7..0000000 --- a/users/b12f/email/.config/mutt/muttrc +++ /dev/null @@ -1,104 +0,0 @@ -# vim: filetype=muttrc - -source $XDG_CONFIG_HOME/mutt/base16.muttrc -source $XDG_CONFIG_HOME/mutt/accounts.muttrc - -set editor = `echo \$EDITOR` - -set sidebar_visible = yes -set sidebar_width = 50 -set sidebar_format = "%B%?F? [%F]?%* %?N?%N/?%S" - -set sendmail_wait = 0 - -set mail_check_stats - -set crypt_use_gpgme=yes -set crypt_autosign=yes -set crypt_verify_sig=yes -set crypt_replysign=yes -set crypt_replyencrypt=yes -set crypt_replysignencrypted=yes -set crypt_autoencrypt=yes - -set pgp_check_gpg_decrypt_status_fd -set pgp_use_gpg_agent=yes -set pgp_self_encrypt=yes - -# Store message headers locally to speed things up. -# If hcache is a folder, Mutt will create sub cache folders for each account which may speeds things up even more. -set header_cache = $XDG_CACHE_HOME/mutt - -# Store messages locally to speed things up, like searching message bodies. -# Can be the same folder as header_cache. -# This will cost important disk usage according to your e-mail amount. -set message_cachedir = $XDG_CACHE_HOME/mutt -set imap_check_subscribed - -# Allow Mutt to open a new IMAP connection automatically. -unset imap_passive - -# Keep the IMAP connection alive by polling intermittently (time in seconds). -set imap_keepalive = 300 - -# How often to check for new mail (time in seconds). -set mail_check = 120 - -set askcc -set askbcc - -set date_format="!%d.%m.%Y %H:%M" -set index_format="%4C %Z %D %4c %20.20L %s" - -#------------------------------------------------------------ -# Vi Key Bindings -#------------------------------------------------------------ - -# Moving around -bind generic g noop -bind generic gg first-entry -bind generic,index G last-entry -bind generic,index i previous-entry -bind generic,index k next-entry - -bind pager,index d noop -bind pager,index dd delete-message - -bind pager i previous-line -bind pager k next-line -bind pager I previous-entry -bind pager K next-entry - -bind pager r noop -bind pager rr reply -bind pager ra group-reply -bind pager rn group-chat-reply -bind pager rl list-reply - -# Threads -bind browser,pager,index N search-opposite -bind pager,index dT delete-thread -bind pager,index dt delete-subthread -bind pager,index g noop -bind pager,index gt next-thread -bind pager,index gT previous-thread -bind index za collapse-thread -bind index zA collapse-all # Missing :folddisable/foldenable - -# Enable URL opening -macro index,pager \cb " urlscan" "call urlscan to extract URLs out of a message" -macro attach,compose \cb " urlscan" "call urlscan to extract URLs out of a message" - -# Translate markdown to html -macro compose \e5 "F pandoc -s -f markdown -t html \ny^T^Utext/html; charset=utf-8\n" -set wait_key=no - -# Save to ~/Downloads by default -macro attach D "~/Downloads/" "Save to Downloads" - -set mailcap_path = $XDG_CONFIG_HOME/mutt/mailcap - -# HTML emails -auto_view text/html # view html automatically -alternative_order text/plain text/enriched text/html # save html for last - diff --git a/users/b12f/email/.config/offlineimap/config b/users/b12f/email/.config/offlineimap/config deleted file mode 100644 index df132a8..0000000 --- a/users/b12f/email/.config/offlineimap/config +++ /dev/null @@ -1,100 +0,0 @@ -[general] -pythonfile = $XDG_CONFIG_HOME/offlineimap/functions.py -metadata = $XDG_DATA_HOME/offlineimap -accounts = BBEU, MiOM, b12f, RWTH, AdminsPubSolar, CrewPubSolar - -[Account BBEU] -localrepository = LocalBBEU -remoterepository = RemoteBBEU - -[Repository LocalBBEU] -type = Maildir -localfolders = ~/Mail/hello@benjaminbaedorf.eu - -[Repository RemoteBBEU] -type = IMAP -remotehost = mail.hosting.de -remoteuser = hello@benjaminbaedorf.eu -remotepasseval = get_secret("service", "smtp", "host", "mail.hosting.de", "user", "hello@benjaminbaedorf.eu") -sslcacertfile = /etc/ssl/certs/ca-certificates.crt - -[Account MiOM] -localrepository = LocalMiOM -remoterepository = RemoteMiOM - -[Repository LocalMiOM] -type = Maildir -localfolders = ~/Mail/byb@miom.space - -[Repository RemoteMiOM] -type = IMAP -remotehost = mail.hosting.de -remoteuser = byb@miom.space -remotepasseval = get_secret("service", "smtp", "host", "mail.hosting.de", "user", "byb@miom.space") -sslcacertfile = /etc/ssl/certs/ca-certificates.crt - -[Account AdminsPubSolar] -localrepository = LocalAdminsPubSolar -remoterepository = RemoteAdminsPubSolar - -[Repository LocalAdminsPubSolar] -type = Maildir -localfolders = ~/Mail/admins@pub.solar - -[Repository RemoteAdminsPubSolar] -type = IMAP -remotehost = mail.greenbaum.zone -remoteport = 993 -remoteuser = admins@pub.solar -remotepasseval = get_secret("service", "smtp", "host", "mail.greenbaum.zone", "user", "admins@pub.solar") -sslcacertfile = /etc/ssl/certs/ca-certificates.crt -ssl = yes - -[Account CrewPubSolar] -localrepository = LocalCrewPubSolar -remoterepository = RemoteCrewPubSolar - -[Repository LocalCrewPubSolar] -type = Maildir -localfolders = ~/Mail/crew@pub.solar - -[Repository RemoteCrewPubSolar] -type = IMAP -remotehost = mail.greenbaum.zone -remoteport = 993 -remoteuser = crew@pub.solar -remotepasseval = get_secret("service", "smtp", "host", "mail.greenbaum.zone", "user", "crew@pub.solar") -sslcacertfile = /etc/ssl/certs/ca-certificates.crt -ssl = yes - -[Account b12f] -localrepository = Localb12f -remoterepository = Remoteb12f - -[Repository Localb12f] -type = Maildir -localfolders = ~/Mail/mail@b12f.io - -[Repository Remoteb12f] -type = IMAP -remotehost = mail.b12f.io -remoteuser = mail@b12f.io -remoteport = 993 -remotepasseval = get_secret("service", "smtp", "host", "mail.b12f.io", "user", "mail@b12f.io") -sslcacertfile = /etc/ssl/certs/ca-certificates.crt -ssl = yes - -[Account RWTH] -localrepository = LocalRWTH -remoterepository = RemoteRWTH - -[Repository LocalRWTH] -type = Maildir -localfolders = ~/Mail/benjamin.baedorf@rwth-aachen.de - -[Repository RemoteRWTH] -type = IMAP -remotehost = mail.rwth-aachen.de -remoteuser = bb564306@rwth-aachen.de -remotepasseval = get_secret("service", "smtp", "host", "mail.rwth-aachen.de", "user", "bb564306@rwth-aachen.de") -sslcacertfile = /etc/ssl/certs/ca-certificates.crt diff --git a/users/b12f/email/.config/offlineimap/functions.py b/users/b12f/email/.config/offlineimap/functions.py deleted file mode 100644 index 110b9e4..0000000 --- a/users/b12f/email/.config/offlineimap/functions.py +++ /dev/null @@ -1,9 +0,0 @@ -#! /usr/bin/env python2 -import os -import subprocess - -def get_env(key): - return os.getenv(key) - -def get_secret(*attributes): - return subprocess.check_output(["secret-tool", "lookup"] + list(attributes)) diff --git a/users/b12f/email/default.nix b/users/b12f/email/default.nix deleted file mode 100644 index 10222bc..0000000 --- a/users/b12f/email/default.nix +++ /dev/null @@ -1,60 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: -with lib; let - psCfg = config.pub-solar; -in { - users.users."${psCfg.user.name}".packages = with pkgs; [ - w3m - urlscan - neomutt - offlineimap - msmtp - mailto-mutt - ]; - - home-manager.users."${psCfg.user.name}" = { - programs.offlineimap = { - enable = true; - pythonFile = builtins.readFile ./.config/offlineimap/functions.py; - }; - - xdg.configFile."mutt/muttrc".source = ./.config/mutt/muttrc; - xdg.configFile."mutt/base16.muttrc".source = ./.config/mutt/base16.muttrc; - xdg.configFile."mutt/mailcap".source = ./.config/mutt/mailcap; - xdg.configFile."offlineimap/functions.py".source = ./.config/offlineimap/functions.py; - - xdg.configFile."mutt/accounts.muttrc".text = '' - source ./hello@benjaminbaedorf.eu.muttrc - - macro index 'source $XDG_CONFIG_HOME/mutt/hello@benjaminbaedorf.eu.muttrc!' - macro index 'source $XDG_CONFIG_HOME/mutt/benjamin.baedorf@rwth-aachen.de.muttrc!' - macro index 'source $XDG_CONFIG_HOME/mutt/byb@miom.space.muttrc!' - macro index 'source $XDG_CONFIG_HOME/mutt/mail@b12f.io.muttrc!' - macro index 'source $XDG_CONFIG_HOME/mutt/admins@pub.solar.muttrc!' - macro index 'source $XDG_CONFIG_HOME/mutt/crew@pub.solar.muttrc!' - macro index 'source $XDG_CONFIG_HOME/mutt/benjamin.yule.baedorf@verkstedt.com.muttrc!' - macro index 'source $XDG_CONFIG_HOME/mutt/benjamin-yule.baedorf@ext.ehealthexperts.de.muttrc!' - ''; - xdg.configFile."mutt/hello@benjaminbaedorf.eu.muttrc".source = ./.config/mutt + "/hello@benjaminbaedorf.eu.muttrc"; - xdg.configFile."mutt/benjamin.baedorf@rwth-aachen.de.muttrc".source = ./.config/mutt + "/benjamin.baedorf@rwth-aachen.de.muttrc"; - xdg.configFile."mutt/hello@benjaminbaedorf.eu.signature".source = ./.config/mutt + "/hello@benjaminbaedorf.eu.signature"; - xdg.configFile."mutt/byb@miom.space.muttrc".source = ./.config/mutt + "/byb@miom.space.muttrc"; - xdg.configFile."mutt/byb@miom.space.signature".source = ./.config/mutt + "/byb@miom.space.signature"; - xdg.configFile."mutt/mail@b12f.io.muttrc".source = ./.config/mutt + "/mail@b12f.io.muttrc"; - xdg.configFile."mutt/mail@b12f.io.signature".source = ./.config/mutt + "/mail@b12f.io.signature"; - xdg.configFile."mutt/admins@pub.solar.muttrc".source = ./.config/mutt + "/admins@pub.solar.muttrc"; - xdg.configFile."mutt/admins@pub.solar.signature".source = ./.config/mutt + "/admins@pub.solar.signature"; - xdg.configFile."mutt/crew@pub.solar.muttrc".source = ./.config/mutt + "/crew@pub.solar.muttrc"; - xdg.configFile."mutt/crew@pub.solar.signature".source = ./.config/mutt + "/crew@pub.solar.signature"; - xdg.configFile."mutt/benjamin.yule.baedorf@verkstedt.com.muttrc".source = ./.config/mutt + "/benjamin.yule.baedorf@verkstedt.com.muttrc"; - xdg.configFile."mutt/benjamin.yule.baedorf@verkstedt.com.signature".source = ./.config/mutt + "/benjamin.yule.baedorf@verkstedt.com.signature"; - xdg.configFile."mutt/benjamin-yule.baedorf@ext.ehealthexperts.de.muttrc".source = ./.config/mutt + "/benjamin-yule.baedorf@ext.ehealthexperts.de.muttrc"; - xdg.configFile."mutt/benjamin-yule.baedorf@ext.ehealthexperts.de.signature".source = ./.config/mutt + "/benjamin-yule.baedorf@ext.ehealthexperts.de.signature"; - xdg.configFile."offlineimap/config".source = ./.config/offlineimap/config; - xdg.configFile."msmtp/config".source = ./.config/msmtp/config; - }; -}