From e132ba1a2afa158f3d42d97c9097ef69ea3a00c0 Mon Sep 17 00:00:00 2001 From: niten Date: Thu, 28 Sep 2023 13:00:01 -0700 Subject: [PATCH] Seems TMPDIR doesn't exist --- dkim.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dkim.nix b/dkim.nix index 7df1416..c4aedb9 100644 --- a/dkim.nix +++ b/dkim.nix @@ -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 '';