feat: add personal email profile
This commit is contained in:
parent
d2a4ec7f03
commit
0ca1625a75
3 changed files with 101 additions and 28 deletions
|
@ -3,6 +3,7 @@
|
|||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||
{ pkgs
|
||||
, config
|
||||
, inputs
|
||||
, ...
|
||||
}:
|
||||
|
||||
|
@ -19,6 +20,7 @@
|
|||
desktop.enable = true;
|
||||
gaming.enable = true;
|
||||
personal.enable = true;
|
||||
personal.mail = true;
|
||||
impermanence.enable = true;
|
||||
webis.enable = true;
|
||||
};
|
||||
|
|
|
@ -10,40 +10,39 @@ in
|
|||
{
|
||||
options.my.profiles.personal.enable = mkEnableOption "personal profile";
|
||||
|
||||
config = mkIf cfg.enable
|
||||
{
|
||||
my = {
|
||||
services = {
|
||||
openconnect.enable = true;
|
||||
synology-drive.enable = true;
|
||||
};
|
||||
programs = {
|
||||
ssh.includeSecrets = [ ../../secrets/ssh-home.age ];
|
||||
git.signing = mkDefault true;
|
||||
hub.enable = mkDefault true;
|
||||
firefox.arkenfox = {
|
||||
enable = mkDefault true;
|
||||
overrides = mkDefault {
|
||||
## arkenfox overrides
|
||||
# automatic search
|
||||
"keyword.enabled" = true;
|
||||
"browser.search.suggest.enabled" = true;
|
||||
"browser.urlbar.suggest.searches" = true;
|
||||
config = mkIf cfg.enable {
|
||||
my = {
|
||||
services = {
|
||||
openconnect.enable = true;
|
||||
synology-drive.enable = true;
|
||||
};
|
||||
programs = {
|
||||
ssh.includeSecrets = [ ../../secrets/ssh-home.age ];
|
||||
git.signing = mkDefault true;
|
||||
hub.enable = mkDefault true;
|
||||
firefox.arkenfox = {
|
||||
enable = mkDefault true;
|
||||
overrides = mkDefault {
|
||||
## arkenfox overrides
|
||||
# automatic search
|
||||
"keyword.enabled" = true;
|
||||
"browser.search.suggest.enabled" = true;
|
||||
"browser.urlbar.suggest.searches" = true;
|
||||
|
||||
# Restore previous session on startup
|
||||
"browser.startup.page" = 3;
|
||||
# Restore previous session on startup
|
||||
"browser.startup.page" = 3;
|
||||
|
||||
# drm
|
||||
"media.eme.enabled" = true;
|
||||
# drm
|
||||
"media.eme.enabled" = true;
|
||||
|
||||
# sanitisation
|
||||
"privacy.clearOnShutdown.history" = false;
|
||||
# sanitisation
|
||||
"privacy.clearOnShutdown.history" = false;
|
||||
|
||||
# disable letterboxing
|
||||
"privacy.resistFingerprinting.letterboxing" = false;
|
||||
};
|
||||
# disable letterboxing
|
||||
"privacy.resistFingerprinting.letterboxing" = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
72
modules/profiles/personal_mail.nix
Normal file
72
modules/profiles/personal_mail.nix
Normal file
|
@ -0,0 +1,72 @@
|
|||
{ lib
|
||||
, config
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.profiles.personal;
|
||||
|
||||
filterHtml = pkgs.writeScript "filter_html" ''
|
||||
${lib.getExe pkgs.w3m} -T text/html \
|
||||
-cols $(tput cols) \
|
||||
-dump \
|
||||
-o display_image=false \
|
||||
-o display_link_number=true "$@"
|
||||
'';
|
||||
in
|
||||
{
|
||||
options.my.profiles.personal.mail = mkEnableOption "personal email";
|
||||
|
||||
config = mkIf cfg.mail {
|
||||
home-manager.users.moritz = {
|
||||
home.packages = with pkgs; [
|
||||
w3m
|
||||
];
|
||||
programs.aerc = {
|
||||
enable = true;
|
||||
extraConfig = {
|
||||
general.unsafe-accounts-conf = true;
|
||||
viewer = {
|
||||
alternatives = "text/plain,text/html";
|
||||
header-layout = "From,To,Cc,Bcc,Date,Subject";
|
||||
};
|
||||
filters = {
|
||||
"text/html" = "${filterHtml}";
|
||||
"text/plain" = "colorize";
|
||||
"text/calendar" = "calendar";
|
||||
"message/delivery-status" = "colorize";
|
||||
"message/rfc822" = "colorize";
|
||||
".headers" = "colorize";
|
||||
};
|
||||
};
|
||||
};
|
||||
services.mbsync.enable = true;
|
||||
services.imapnotify.enable = true;
|
||||
programs.mbsync.enable = true;
|
||||
accounts.email.accounts.personal = {
|
||||
imapnotify.enable = true;
|
||||
imapnotify.boxes = [ "Inbox" ];
|
||||
imapnotify.onNotify = "systemctl start --user mbsync.service";
|
||||
primary = true;
|
||||
address = "mail@moritzboeh.me";
|
||||
userName = "mail@moritzboeh.me";
|
||||
aerc.enable = true;
|
||||
gpg.signByDefault = true;
|
||||
gpg.key = "0xE4F362A3F5C338A0";
|
||||
imap.host = "mail.your-server.de";
|
||||
smtp.host = "mail.your-server.de";
|
||||
realName = "Moritz Böhme";
|
||||
mbsync.enable = true;
|
||||
mbsync.create = "both";
|
||||
passwordCommand = "cat /run/agenix/email";
|
||||
};
|
||||
accounts.email.maildirBasePath = "Documents/Mail";
|
||||
};
|
||||
age.secrets.email = {
|
||||
file = ../../secrets/email.age;
|
||||
owner = "1000";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue