Seems TMPDIR doesn't exist

This commit is contained in:
niten 2023-09-28 13:00:01 -07:00
parent a5ed6cc504
commit e132ba1a2a
1 changed files with 6 additions and 5 deletions

View File

@ -10,13 +10,14 @@ let
dkimTxt = "${keyDir}/${domain}.mail.txt";
in ''
if [ ! -f "${dkimKey}" ] || [ ! -f ${dkimTxt} ]; then
OUT=$(${pkgs.coreutils}/bin/mktemp -d -t dkim-XXXXXXXXXX)
opendkim-genkey \
-s mail \
-d ${domain} \
--selector=mail \
--domain=${domain} \
--bits="${toString cfg.key-bits}" \
--directory=$TMPDIR
mv $TMPDIR/mail.private ${dkimKey}
mv $TMPDIR/mail.txt ${dkimTxt}
--directory=$OUT
mv $OUT/mail.private ${dkimKey}
mv $OUT/mail.txt ${dkimTxt}
fi
'';