udevCheckHook: remove broken cross-compilation check

This commit is contained in:
Grimmauld 2025-05-31 18:08:09 +02:00
parent d313d94049
commit 4e690a2899
No known key found for this signature in database

View file

@ -2,15 +2,16 @@
lib,
makeSetupHook,
systemdMinimal,
udev,
stdenv,
}:
let
# udev rules can only be checked if systemd (specifically, 'udevadm') can be executed on build platform
# if udev is not available on hostPlatform, there is no point in checking rules
applyHook =
lib.meta.availableOn stdenv.hostPlatform udev
&& lib.meta.availableOn stdenv.buildPlatform systemdMinimal;
# If cross-compiling linux -> non-linux, udev rules are still checked, even if they end up being unused.
# This is not a problem:
# - If there are no udev rules, the hook is a noop
# - If the udev rules are broken, they should be flagged as such
# - if rules are not needed on a target platform where they are broken, they should be deleted from package output
applyHook = lib.meta.availableOn stdenv.buildPlatform systemdMinimal;
in
makeSetupHook {
name = "udev-check-hook";