From 87757e52be32c2f5fb94ab2a63b3598708c65451 Mon Sep 17 00:00:00 2001 From: larstvei Date: Tue, 20 Sep 2022 21:14:28 +0200 Subject: [PATCH] A small working email-setup --- modules/home.nix | 29 +++++++++++++++++++++++++++++ modules/mac.nix | 2 ++ 2 files changed, 31 insertions(+) diff --git a/modules/home.nix b/modules/home.nix index e1a9e0f..b8e74f4 100644 --- a/modules/home.nix +++ b/modules/home.nix @@ -30,6 +30,7 @@ (epkgs: with epkgs; [ vterm pdf-tools + pkgs.mu ])) (aspellWithDicts (dpkgs: with dpkgs; [ @@ -53,6 +54,30 @@ # Somehow related to: https://github.com/NixOS/nixpkgs/issues/1000 home.file.".aspell.conf".text = "data-dir ${pkgs.aspell}/lib/aspell"; + accounts.email = { + accounts.uio = { + address = "larstvei@ifi.uio.no"; + userName = "larstvei@ifi.uio.no"; + realName = "Lars Tveito"; + imap.host = "imap.uio.no"; + smtp.host = "smtp.uio.no"; + + mbsync = { + enable = true; + create = "maildir"; + # Because of Office 365, see: https://kdecherf.com/blog/2017/05/01/mbsync-and-office-365/ + extraConfig.account.Timeout = 120; + extraConfig.account.PipelineDepth = 1; + }; + + msmtp.enable = true; + mu.enable = true; + + primary = true; + passwordCommand = "security find-internet-password -s imap.uio.no -a larstvei -w"; + }; + }; + programs = { direnv = { @@ -98,6 +123,10 @@ ignores = [ ".dir-locals.el" ".envrc" ".DS_Store" ]; }; + mu.enable = true; + msmtp.enable = true; + mbsync.enable = true; + # Let Home Manager install and manage itself. home-manager.enable = true; }; diff --git a/modules/mac.nix b/modules/mac.nix index 8503b5e..fc7f8bc 100644 --- a/modules/mac.nix +++ b/modules/mac.nix @@ -20,6 +20,8 @@ ]; }; + users.users."larstvei".home = "/Users/larstvei"; + programs.fish.enable = true; system.activationScripts.postActivation.text = '' # Set the default shell as fish for the user. MacOS doesn't do this like nixOS does