summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorPeter Simons <simons@cryp.to>2015-06-22 12:31:44 +0200
committerPeter Simons <simons@cryp.to>2015-06-22 12:47:23 +0200
commite08074ff6d57890ea7c1c526e73c998d2dcdcefa (patch)
treedc0431624ec529e137c40aac8ebac4a4676e448e /nixos
parent51fa6826559888cfc5dce2a93159b2474bf4eb1d (diff)
downloadnixlib-e08074ff6d57890ea7c1c526e73c998d2dcdcefa.tar
nixlib-e08074ff6d57890ea7c1c526e73c998d2dcdcefa.tar.gz
nixlib-e08074ff6d57890ea7c1c526e73c998d2dcdcefa.tar.bz2
nixlib-e08074ff6d57890ea7c1c526e73c998d2dcdcefa.tar.lz
nixlib-e08074ff6d57890ea7c1c526e73c998d2dcdcefa.tar.xz
nixlib-e08074ff6d57890ea7c1c526e73c998d2dcdcefa.tar.zst
nixlib-e08074ff6d57890ea7c1c526e73c998d2dcdcefa.zip
nixos: fix code that sets up /etc/postfix
The sample config files have moved from ${postfix}/share to ${postfix}/etc in
version 2.11.4.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/mail/postfix.nix49
1 files changed, 24 insertions, 25 deletions
diff --git a/nixos/modules/services/mail/postfix.nix b/nixos/modules/services/mail/postfix.nix
index 24bcc6bb57ce..d81380aac231 100644
--- a/nixos/modules/services/mail/postfix.nix
+++ b/nixos/modules/services/mail/postfix.nix
@@ -369,31 +369,30 @@ in
 
         daemonType = "fork";
 
-        preStart =
-          ''
-            if ! [ -d /var/spool/postfix ]; then
-              ${pkgs.coreutils}/bin/mkdir -p /var/spool/mail /var/postfix/conf /var/postfix/queue
-            fi
-
-            ${pkgs.coreutils}/bin/chown -R ${user}:${group} /var/postfix
-            ${pkgs.coreutils}/bin/chown -R ${user}:${setgidGroup} /var/postfix/queue
-            ${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
-
-            ln -sf ${aliasesFile} /var/postfix/conf/aliases
-            ln -sf ${virtualFile} /var/postfix/conf/virtual
-            ln -sf ${mainCfFile} /var/postfix/conf/main.cf
-            ln -sf ${masterCfFile} /var/postfix/conf/master.cf
-
-            ${pkgs.postfix}/sbin/postalias -c /var/postfix/conf /var/postfix/conf/aliases
-            ${pkgs.postfix}/sbin/postmap -c /var/postfix/conf /var/postfix/conf/virtual
-
-            ${pkgs.postfix}/sbin/postfix -c /var/postfix/conf start
-          '';
+        preStart = ''
+          if ! [ -d /var/spool/postfix ]; then
+            ${pkgs.coreutils}/bin/mkdir -p /var/spool/mail /var/postfix/conf /var/postfix/queue
+          fi
+
+          ${pkgs.coreutils}/bin/chown -R ${user}:${group} /var/postfix
+          ${pkgs.coreutils}/bin/chown -R ${user}:${setgidGroup} /var/postfix/queue
+          ${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}/etc/postfix/"* /var/postfix/conf
+
+          ln -sf ${aliasesFile} /var/postfix/conf/aliases
+          ln -sf ${virtualFile} /var/postfix/conf/virtual
+          ln -sf ${mainCfFile} /var/postfix/conf/main.cf
+          ln -sf ${masterCfFile} /var/postfix/conf/master.cf
+
+          ${pkgs.postfix}/sbin/postalias -c /var/postfix/conf /var/postfix/conf/aliases
+          ${pkgs.postfix}/sbin/postmap -c /var/postfix/conf /var/postfix/conf/virtual
+
+          ${pkgs.postfix}/sbin/postfix -c /var/postfix/conf start
+        '';
 
         preStop = ''
             ${pkgs.postfix}/sbin/postfix -c /var/postfix/conf stop