diff --git a/nixos/modules/services/hardware/udev.nix b/nixos/modules/services/hardware/udev.nix index 1284dc86f0a77..0d5a001c0e599 100644 --- a/nixos/modules/services/hardware/udev.nix +++ b/nixos/modules/services/hardware/udev.nix @@ -55,6 +55,13 @@ let preferLocalBuild = true; allowSubstitutes = false; packages = lib.unique (map toString udevPackages); + + nativeBuildInputs = [ + # We only include the out output here to avoid needing to include all + # other outputs in the installer tests as well + # We only need the udevadm command anyway + pkgs.systemdMinimal.out + ]; } '' mkdir -p $out @@ -147,6 +154,11 @@ let exit 1 fi + # Verify all the udev rules + echo "Verifying udev rules using udevadm verify..." + udevadm verify --resolve-names=never --no-style $out + echo "OK" + # If auto-configuration is disabled, then remove # udev's 80-drivers.rules file, which contains rules for # automatically calling modprobe. diff --git a/nixos/tests/installer.nix b/nixos/tests/installer.nix index f6dcd1951a136..f089e0074085b 100644 --- a/nixos/tests/installer.nix +++ b/nixos/tests/installer.nix @@ -681,7 +681,7 @@ let { # The configuration of the system used to run "nixos-install". installer = - { config, ... }: + { config, pkgs, ... }: { imports = [ commonConfig @@ -740,6 +740,11 @@ let xorg.lndir shellcheck-minimal + # Only the out output is included here, which is what is + # required to build the NixOS udev rules + # See the comment in services/hardware/udev.nix + systemdMinimal.out + # add curl so that rather than seeing the test attempt to download # curl's tarball, we see what it's trying to download curl