From 6555ec03c30fe4221c3de8f6293a3e902c155c4c Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Tue, 21 Mar 2017 19:41:25 +0300 Subject: [PATCH] udev module: filter duplicate udev paths Fixes #24174 --- nixos/modules/services/hardware/udev.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/hardware/udev.nix b/nixos/modules/services/hardware/udev.nix index 028907693a5a..9f42f9e59ad5 100644 --- a/nixos/modules/services/hardware/udev.nix +++ b/nixos/modules/services/hardware/udev.nix @@ -35,6 +35,7 @@ let udevRules = pkgs.runCommand "udev-rules" { preferLocalBuild = true; allowSubstitutes = false; + packages = unique (map toString cfg.packages); } '' mkdir -p $out @@ -45,7 +46,7 @@ let echo 'ENV{PATH}="${udevPath}/bin:${udevPath}/sbin"' > $out/00-path.rules # Add the udev rules from other packages. - for i in ${toString cfg.packages}; do + for i in $packages; do echo "Adding rules for package $i" for j in $i/{etc,lib}/udev/rules.d/*; do echo "Copying $j to $out/$(basename $j)" @@ -132,10 +133,11 @@ let hwdbBin = pkgs.runCommand "hwdb.bin" { preferLocalBuild = true; allowSubstitutes = false; + packages = unique (map toString ([udev] ++ cfg.packages)); } '' mkdir -p etc/udev/hwdb.d - for i in ${toString ([udev] ++ cfg.packages)}; do + for i in $packages; do echo "Adding hwdb files for package $i" for j in $i/{etc,lib}/udev/hwdb.d/*; do ln -s $j etc/udev/hwdb.d/$(basename $j)