summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorBjørn Forsman <bjorn.forsman@gmail.com>2015-06-07 10:22:20 +0200
committerBjørn Forsman <bjorn.forsman@gmail.com>2015-06-07 10:38:11 +0200
commit12e84c63784116ee9c4e69516d68c6661ffd5eb1 (patch)
treeda7f22861856d27b2a38c7157f1df17754d18d17 /nixos
parent944972ba4aa218d370f28014299b4dd742d661f9 (diff)
nixos/postfix: make symlink /var/mail -> /var/spool/mail
This solves the problem of e.g. mutt not finding mail unless the user
sets MAIL=/var/spool/mail/$USER.

The default MAIL variable seems come from bash. Reasons for adding
symlink instead of changing MAIL default in bash:

- No need to rebuild world
- FHS recommends /var/mail over /var/spool/mail anyway[1]. Better fix
  NixOS mail location than change MAIL in bash to something that doesn't
  work on non-NixOS (however unlikely that users run nixpkgs bash on a
  non-NixOS distro...).

[1] http://www.pathname.com/fhs/pub/fhs-2.3.html#VARMAILUSERMAILBOXFILES
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/mail/postfix.nix1
1 files changed, 1 insertions, 0 deletions
diff --git a/nixos/modules/services/mail/postfix.nix b/nixos/modules/services/mail/postfix.nix
index 839da7407ef9b..24bcc6bb57cef 100644
--- a/nixos/modules/services/mail/postfix.nix
+++ b/nixos/modules/services/mail/postfix.nix
@@ -380,6 +380,7 @@ in
             ${pkgs.coreutils}/bin/chmod -R ug+rwX /var/postfix/queue
             ${pkgs.coreutils}/bin/chown root:root /var/spool/mail
             ${pkgs.coreutils}/bin/chmod a+rwxt /var/spool/mail
+            ${pkgs.coreutils}/bin/ln -sf /var/spool/mail /var/mail
 
             ln -sf "${pkgs.postfix}/share/postfix/conf/"* /var/postfix/conf