diff options
author | Felix Buehler <account@buehler.rocks> | 2024-02-28 21:10:58 +0100 |
---|---|---|
committer | Felix Buehler <account@buehler.rocks> | 2024-04-30 22:51:40 +0200 |
commit | a181e098c90c19e55979bb6776f70953c9120deb (patch) | |
tree | ea9bbe35e4c25b4703a3be262f53b9ad2bcbf286 /nixos/modules | |
parent | 7e151ba98012d774bcc1d1b6a1ccb3a7f94fd865 (diff) |
nixos/mailman: prefer 'install' over 'chmod/chown'
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/services/mail/mailman.nix | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/nixos/modules/services/mail/mailman.nix b/nixos/modules/services/mail/mailman.nix index 7e7ca7e4060ec..180c9800d7345 100644 --- a/nixos/modules/services/mail/mailman.nix +++ b/nixos/modules/services/mail/mailman.nix @@ -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")" |