diff --git a/configuration.nix b/configuration.nix index e8fba2d..eda1d88 100644 --- a/configuration.nix +++ b/configuration.nix @@ -4,6 +4,7 @@ imports = [ ./hardware-configuration.nix + ./mail.nix #./ipv6.nix ]; @@ -31,12 +32,9 @@ optipng gimp oh-my-zsh stow lemonbar git st - msmtp neomutt - ripmime w3m #email nethogs (import ./vim.nix) (texlive.combine { inherit (texlive) scheme-small latexmk bibtex; }) #for vimtex - (mu.override { withMug = false; }) # no webkit dependency ghostscript pavucontrol dell-530cdn @@ -128,10 +126,6 @@ enable = true; stateDir = "/tmp/peerflix"; }; - offlineimap = { - enable = true; - onCalendar = "*:0/5"; - }; cron.enable = false; nixosManual.enable = false; printing = { @@ -194,20 +188,6 @@ }; }; - systemd.user.services = { - mu = { - description = "Updating mail database"; - script = "/run/current-system/sw/bin/mu index --quiet -m ~/mail"; - startAt = "daily"; - wantedBy = [ "timers.target" ]; - }; - - offlineimap-fast = { - description = "Quick mail synchronization"; - script = "/run/current-system/sw/bin/offlineimap -u quiet -q"; - }; - }; - systemd.mounts = [ { what = "/dev/sdb1"; diff --git a/mail.nix b/mail.nix new file mode 100644 index 0000000..d7e8a93 --- /dev/null +++ b/mail.nix @@ -0,0 +1,39 @@ +# Mail stack: +# Read and write emails neomutt +# Receive emails & synchronize maildir offlineimap +# Submit emails to send msmtp +# dealing with MIME encoded email packages ripmime +# Display HTML emails w3m +# Search maildirs mu +# and various automation provided by systemd +{ config, pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + msmtp + neomutt + ripmime + w3m + (mu.override { withMug = false; }) # no webkit dependency + ]; + + services.offlineimap = { + enable = true; + onCalendar = "*:0/5"; + }; + + systemd.user.services = { + mu = { + description = "Updating mail database"; + script = "/run/current-system/sw/bin/mu index --quiet -m ~/mail"; + startAt = "daily"; + wantedBy = [ "timers.target" ]; + }; + + offlineimap-fast = { + description = "Quick mail synchronization"; + script = "/run/current-system/sw/bin/offlineimap -u quiet -q"; + }; + }; + +}