ma home-manager: update mail with mbsync

This commit is contained in:
makefu 2020-03-13 10:42:08 +01:00
parent c325d7d6cf
commit f88e30e5ad
No known key found for this signature in database
GPG Key ID: 36F7711F3FC0F225
2 changed files with 20 additions and 59 deletions

View File

@ -1,6 +1,8 @@
{ {
home-manager.users.makefu = { home-manager.users.makefu = {
programs.mbsync.enable = true;
accounts.email.maildirBasePath = "/home/makefu/Mail"; accounts.email.maildirBasePath = "/home/makefu/Mail";
accounts.email.certificatesFile = "/etc/ssl/certs/ca-certificates.crt";
accounts.email.accounts.syntaxfehler = { accounts.email.accounts.syntaxfehler = {
address = "felix.richter@syntax-fehler.de"; address = "felix.richter@syntax-fehler.de";
userName = "Felix.Richter@syntax-fehler.de"; userName = "Felix.Richter@syntax-fehler.de";
@ -10,18 +12,34 @@
enable = true; enable = true;
}; };
}; };
mbsync = {
enable = true;
create = "both";
remove = "both";
expunge = "both";
patterns = [ "*" "!INBOX.Sent*"];
};
smtp = { smtp = {
host = "syntax-fehler.de"; host = "syntax-fehler.de";
tls = { tls = {
enable = true; enable = true;
}; };
}; };
folders = {
sent = "Sent";
trash = "Trash";
inbox = "INBOX";
drafts = "Drafts";
};
msmtp.enable = true; msmtp.enable = true;
notmuch.enable = true; notmuch.enable = true;
offlineimap = { offlineimap = {
enable = true; enable = true;
postSyncHookCommand = "notmuch new"; postSyncHookCommand = "notmuch new";
extraConfig.remote = { extraConfig.remote = {
auth_mechanisms = "LOGIN";
tls_level = "tls_secure";
ssl_version = "tls1_2";
holdconnectionopen = true; holdconnectionopen = true;
idlefolders = "['INBOX']"; idlefolders = "['INBOX']";
}; };

View File

@ -2,65 +2,8 @@
{ {
imports = [ imports = [
{ #direnv { #direnv
home-manager.users.makefu.home.packages = [ pkgs.direnv ]; home-manager.users.makefu.home.packages = [ pkgs.direnv pkgs.nur.repos.kalbasit.nixify ];
home-manager.users.makefu.home.file.".direnvrc".text = '' # home-manager.users.makefu.home.file.".direnvrc".text = '''';
use_nix() {
local path="$(nix-instantiate --find-file nixpkgs)"
if [ -f "$${path}/.version-suffix" ]; then
local version="$(< $path/.version-suffix)"
elif [ -f "$path/.version" ]; then
local version="$(< $path/.version)"
else
local version="$(< $(< $path/.git/HEAD))"
fi
local cache=".direnv/cache-''${version:-unknown}"
if [[ ! -e "$cache" ]] || \
[[ "$HOME/.direnvrc" -nt "$cache" ]] || \
[[ .envrc -nt "$cache" ]] || \
[[ default.nix -nt "$cache" ]] || \
[[ shell.nix -nt "$cache" ]];
then
[ -d .direnv ] || mkdir .direnv
local tmp=$(nix-shell --show-trace "$@" \
--run "\"$direnv\" dump zsh")
echo "$tmp" > "$cache"
fi
local path_backup=$PATH term_backup=$TERM
. "$cache"
export PATH=$PATH:$path_backup TERM=$term_backup
if [[ $# = 0 ]]; then
watch_file default.nix
watch_file shell.nix
fi
}
'';
home-manager.users.makefu.programs.zsh.initExtra = ''
nixify() {
if [ ! -e ./.envrc ]; then
echo "use nix" > .envrc
direnv allow
fi
if [ ! -e default.nix ]; then
cat > default.nix <<'EOF'
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "env";
buildInputs = [
bashInteractive
];
}
EOF
''${EDITOR:-vim} default.nix
fi
}
eval "$(direnv hook zsh)"
'';
} }
{ # bat { # bat
home-manager.users.makefu.home.packages = [ pkgs.bat ]; home-manager.users.makefu.home.packages = [ pkgs.bat ];