Skip to content

Commit

Permalink
nixos/exim: create spoolDir as home directory
Browse files Browse the repository at this point in the history
This fixes an issue causing exim.service to fail starting unless the
spool directory already exists or the exim user is allowed to create
it.

Closes #385522
  • Loading branch information
4z3 committed Feb 27, 2025
1 parent 94c6128 commit c32e581
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions nixos/modules/services/mail/exim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ in
description = "Exim mail transfer agent user";
uid = config.ids.uids.exim;
group = cfg.group;
home = cfg.spoolDir;
createHome = true;
};

users.groups.${cfg.group} = {
Expand All @@ -127,12 +129,6 @@ in
ExecReload = "!${coreutils}/bin/kill -HUP $MAINPID";
User = cfg.user;
};
preStart = ''
if ! test -d ${cfg.spoolDir}; then
${coreutils}/bin/mkdir -p ${cfg.spoolDir}
${coreutils}/bin/chown ${cfg.user}:${cfg.group} ${cfg.spoolDir}
fi
'';
};

};
Expand Down

0 comments on commit c32e581

Please sign in to comment.