From ab2bc9944360bd1e202d8f70d4814bc579d3566f Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Tue, 30 Dec 2025 19:00:52 -0600 Subject: [PATCH] nixos/udev: Copy dmi_memory_id only if installed This tool is only built on certain architectures that systemd enumerates as supporting DMI[1]. Notably, this excludes POWER. [1]: https://github.com/systemd/systemd/blob/v259/meson.build#L1529-L1530 --- nixos/modules/services/hardware/udev.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/hardware/udev.nix b/nixos/modules/services/hardware/udev.nix index 6e779df94e77..b8e7549b1322 100644 --- a/nixos/modules/services/hardware/udev.nix +++ b/nixos/modules/services/hardware/udev.nix @@ -462,10 +462,17 @@ in "${config.boot.initrd.systemd.package}/lib/systemd/systemd-udevd" "${config.boot.initrd.systemd.package}/lib/udev/ata_id" "${config.boot.initrd.systemd.package}/lib/udev/cdrom_id" - "${config.boot.initrd.systemd.package}/lib/udev/dmi_memory_id" "${config.boot.initrd.systemd.package}/lib/udev/scsi_id" "${config.boot.initrd.systemd.package}/lib/udev/rules.d" ] + ++ lib.optional ( + # https://github.com/systemd/systemd/blob/v259/meson.build#L1529-L1530 + pkgs.stdenv.hostPlatform.isx86 + || pkgs.stdenv.hostPlatform.isAarch + || pkgs.stdenv.hostPlatform.isLoongArch64 + || pkgs.stdenv.hostPlatform.isMips + || pkgs.stdenv.hostPlatform.isRiscV64 + ) "${config.boot.initrd.systemd.package}/lib/udev/dmi_memory_id" ++ map (x: "${x}/bin") config.boot.initrd.services.udev.binPackages; # Generate the udev rules for the initrd