Skip to content

Commit

Permalink
nixos/mailman: prefer 'install' over 'chmod/chown'
Browse files Browse the repository at this point in the history
  • Loading branch information
Stunkymonkey committed Apr 30, 2024
1 parent 7e151ba commit a181e09
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions nixos/modules/services/mail/mailman.nix
Original file line number Diff line number Diff line change
Expand Up @@ -534,14 +534,11 @@ in {
hyperkittyApiKey=$(tr -dc A-Za-z0-9 < /dev/urandom | head -c 64)
secretKey=$(tr -dc A-Za-z0-9 < /dev/urandom | head -c 64)
mailmanWebCfgTmp=$(mktemp)
jq -n '.MAILMAN_ARCHIVER_KEY=$archiver_key | .SECRET_KEY=$secret_key' \
install -m 0440 -o root -g mailman \
<(jq -n '.MAILMAN_ARCHIVER_KEY=$archiver_key | .SECRET_KEY=$secret_key' \
--arg archiver_key "$hyperkittyApiKey" \
--arg secret_key "$secretKey" \
>"$mailmanWebCfgTmp"
chown root:mailman "$mailmanWebCfgTmp"
chmod 440 "$mailmanWebCfgTmp"
mv -n "$mailmanWebCfgTmp" "$mailmanWebCfg"
--arg secret_key "$secretKey") \
"$mailmanWebCfg"
fi
hyperkittyApiKey="$(jq -r .MAILMAN_ARCHIVER_KEY "$mailmanWebCfg")"
Expand Down

0 comments on commit a181e09

Please sign in to comment.