diff --git a/configuration.nix b/configuration.nix index dc31fc5..1c5d5d9 100644 --- a/configuration.nix +++ b/configuration.nix @@ -49,6 +49,7 @@ # Users #################################################################### users.users.jez = { isNormalUser = true; + description = "Jez Cope"; group = "jez"; extraGroups = [ "wheel" "video" "audio" "networkmanager" ]; shell = pkgs.zsh; diff --git a/home/profiles/email/default.nix b/home/profiles/email/default.nix new file mode 100644 index 0000000..229e23a --- /dev/null +++ b/home/profiles/email/default.nix @@ -0,0 +1,50 @@ +{ config, lib, pkgs, nixosConfig, ... }: + +let + params = import ../../../secrets/email.nix; + realName = nixosConfig.users.users.jez.description; +in { + accounts.email.accounts.main = rec { + primary = true; + inherit realName; + inherit (params.main) address userName passwordCommand aliases; + + imap = { + inherit (params.main) host; + tls.useStartTls = true; + }; + mu.enable = true; + mbsync = { + enable = true; + create = "both"; + flatten = "."; + patterns = [ "*" ]; + }; + }; + + accounts.email.accounts.protonmail = rec { + inherit realName; + inherit (params.protonmail) address userName passwordCommand; + + imap = { + host = "127.0.0.1"; + port = 1143; + tls.enable = false; + }; + mbsync = { + enable = false; + create = "maildir"; + flatten = "."; + patterns = [ "INBOX" "Sent" "All Mail" ]; + extraConfig.account = { Timeout = 300; }; + }; + }; + + programs.mu.enable = true; + + programs.mbsync.enable = true; + services.mbsync = { + enable = true; + postExec = "${pkgs.mu}/bin/mu index"; + }; +} diff --git a/secrets/email.nix b/secrets/email.nix new file mode 100644 index 0000000..34156de Binary files /dev/null and b/secrets/email.nix differ