Skip to content

Commit

Permalink
nixos/logrotate: use packages from buildPackages in configuration che…
Browse files Browse the repository at this point in the history
…ckPhase, fixing cross compilation
  • Loading branch information
NickCao committed Apr 3, 2022
1 parent 21299f3 commit c784837
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nixos/modules/services/logging/logrotate.nix
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ let
# file exist, but we only have sandboxed users here so brown these
# out. according to man page that means su, create and createolddir.
# files required to exist also won't be present, so missingok is forced.
user=$(${pkgs.coreutils}/bin/id -un)
group=$(${pkgs.coreutils}/bin/id -gn)
user=$(${pkgs.buildPackages.coreutils}/bin/id -un)
group=$(${pkgs.buildPackages.coreutils}/bin/id -gn)
sed -e "s/\bsu\s.*/su $user $group/" \
-e "s/\b\(create\s\+[0-9]*\s*\|createolddir\s\+[0-9]*\s\+\).*/\1$user $group/" \
-e "1imissingok" -e "s/\bnomissingok\b//" \
Expand All @@ -173,7 +173,7 @@ let
# 'error:' at common log level, so we can use grep, taking care
# to keep error codes
set -o pipefail
if ! ${pkgs.logrotate}/sbin/logrotate --debug /tmp/logrotate.conf 2>&1 \
if ! ${pkgs.buildPackages.logrotate}/sbin/logrotate --debug /tmp/logrotate.conf 2>&1 \
| ( ! grep "error:" ) > /tmp/logrotate-error; then
echo "Logrotate configuration check failed."
echo "The failing configuration (after adjustments to pass tests in sandbox) was:"
Expand Down

0 comments on commit c784837

Please sign in to comment.