moar modules
This commit is contained in:
parent
a1175ba492
commit
011009d22f
17 changed files with 556 additions and 240 deletions
63
lib/modules/email.nix
Normal file
63
lib/modules/email.nix
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
{ user, userName }: { lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.roles.email;
|
||||
in
|
||||
{
|
||||
options.roles = {
|
||||
email = {
|
||||
enable = mkEnableOption "email settings";
|
||||
email = mkOption {
|
||||
description = "email address";
|
||||
};
|
||||
terminal = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.${user}.imports = [{
|
||||
programs.git = {
|
||||
userName = userName;
|
||||
userEmail = cfg.email;
|
||||
};
|
||||
|
||||
accounts.email.accounts.${cfg.email} = mkIf cfg.terminal {
|
||||
notmuch.enable = true;
|
||||
neomutt.enable = true;
|
||||
aerc.enable = true;
|
||||
mbsync.enable = true;
|
||||
mbsync.create = "both";
|
||||
userName = cfg.email;
|
||||
realName = userName;
|
||||
address = cfg.email;
|
||||
primary = true;
|
||||
passwordCommand = "${pkgs.rbw}/bin/rbw get privateemail";
|
||||
smtp = {
|
||||
host = "mail.privateemail.com";
|
||||
port = 465;
|
||||
tls.enable = true;
|
||||
};
|
||||
imap = {
|
||||
host = "mail.privateemail.com";
|
||||
port = 993;
|
||||
tls.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
programs.notmuch.enable = cfg.terminal;
|
||||
programs.neomutt = {
|
||||
enable = cfg.terminal;
|
||||
vimKeys = true;
|
||||
sort = "reverse-date";
|
||||
sidebar.enable = true;
|
||||
};
|
||||
programs.mbsync.enable = cfg.terminal;
|
||||
services.mbsync.enable = cfg.terminal;
|
||||
programs.aerc.enable = cfg.terminal;
|
||||
}];
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue