Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

26 lines
904 B
Nix

{
lib,
makeSetupHook,
systemdMinimal,
stdenv,
}:
let
# udev rules can only be checked if systemd (specifically, 'udevadm') can be executed on build platform
# 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";
substitutions = {
udevadm = if applyHook then lib.getExe' systemdMinimal "udevadm" else "";
};
meta = {
description = "Check validity of udev rules in outputs";
maintainers = with lib.maintainers; [ grimmauld ];
};
} ./hook.sh