···22 lib,
33 makeSetupHook,
44 systemdMinimal,
55- udev,
65 stdenv,
76}:
87let
98 # udev rules can only be checked if systemd (specifically, 'udevadm') can be executed on build platform
1010- # if udev is not available on hostPlatform, there is no point in checking rules
1111- applyHook =
1212- lib.meta.availableOn stdenv.hostPlatform udev
1313- && lib.meta.availableOn stdenv.buildPlatform systemdMinimal;
99+ # If cross-compiling linux -> non-linux, udev rules are still checked, even if they end up being unused.
1010+ # This is not a problem:
1111+ # - If there are no udev rules, the hook is a noop
1212+ # - If the udev rules are broken, they should be flagged as such
1313+ # - if rules are not needed on a target platform where they are broken, they should be deleted from package output
1414+ applyHook = lib.meta.availableOn stdenv.buildPlatform systemdMinimal;
1415in
1516makeSetupHook {
1617 name = "udev-check-hook";