nixos/public-inbox: fix inboxdir option

This wasn't consistently used — sometimes the default value was
hardcoded.

Changed files
+4 -4
nixos
modules
services
+4 -4
nixos/modules/services/mail/public-inbox.nix
···
''
+ concatStrings (
mapAttrsToList (name: inbox: ''
-
if [ ! -e ${stateDir}/inboxes/${escapeShellArg name} ]; then
+
if [ ! -e ${escapeShellArg inbox.inboxdir} ]; then
# public-inbox-init creates an inbox and adds it to a config file.
# It tries to atomically write the config file by creating
# another file in the same directory, and renaming it.
···
${escapeShellArgs (
[
name
-
"${stateDir}/inboxes/${name}"
+
inbox.inboxdir
inbox.url
]
++ inbox.address
···
fi
ln -sf ${inbox.description} \
-
${stateDir}/inboxes/${escapeShellArg name}/description
+
${escapeShellArg inbox.inboxdir}/description
-
export GIT_DIR=${stateDir}/inboxes/${escapeShellArg name}/all.git
+
export GIT_DIR=${escapeShellArg inbox.inboxdir}/all.git
if test -d "$GIT_DIR"; then
# Config is inherited by each epoch repository,
# so just needs to be set for all.git.