Configure email client

This commit is contained in:
Kiana Sheibani 2024-02-13 15:13:46 -05:00
parent fbbee3a200
commit d8e0210c30
3 changed files with 43 additions and 4 deletions

View file

@ -26,7 +26,9 @@ outputs = { self,
let let
username = "kiana"; username = "kiana";
fullname = "Kiana Sheibani"; fullname = "Kiana Sheibani";
moduleArgs = { inherit username fullname; } // inputs; email = "kiana.a.sheibani@gmail.com";
moduleArgs = { inherit username fullname email; } // inputs;
lib = nixpkgs.lib; lib = nixpkgs.lib;
in { in {
nixosConfigurations = { nixosConfigurations = {

View file

@ -1,11 +1,11 @@
{ config, pkgs, username, fullname, ... }: { config, pkgs, username, fullname, email, ... }:
{ {
home.username = username; home.username = username;
home.homeDirectory = "/home/" + username; home.homeDirectory = "/home/" + username;
home.stateVersion = "21.11"; home.stateVersion = "21.11";
imports = [ ./shell ./wayland ]; imports = [ ./shell ./wayland ./email.nix ];
xdg.enable = true; xdg.enable = true;
xdg.userDirs.enable = true; xdg.userDirs.enable = true;
@ -13,7 +13,7 @@
programs.git = { programs.git = {
enable = true; enable = true;
userName = fullname; userName = fullname;
userEmail = "kiana.a.sheibani@gmail.com"; userEmail = email;
signing.key = "6CB106C25E86A9F7"; signing.key = "6CB106C25E86A9F7";
signing.signByDefault = true; signing.signByDefault = true;

37
home-manager/email.nix Normal file
View file

@ -0,0 +1,37 @@
{ pkgs, fullname, email, ... }:
let
maildir = "/home/kiana/.mail";
in {
accounts.email = {
maildirBasePath = maildir;
accounts = {
Gmail = {
address = email;
userName = email;
flavor = "gmail.com";
primary = true;
mbsync = {
enable = true;
create = "both";
expunge = "both";
patterns = [ "*" ];
};
realName = fullname;
msmtp.enable = true;
};
};
};
programs = {
msmtp.enable = true;
mbsync.enable = true;
};
services = {
mbsync = {
enable = true;
preExec = "${pkgs.isync}/bin/mbsync -Ha";
postExec = "${pkgs.mu}/bin/mu index -m ${maildir}";
};
};
}