nixos/udev: support /run/current-system/systemd in udevRules
https://github.com/NixOS/nixpkgs/pull/88492 flipped some references to
systemctl from config.systemd.package to /run/current-system/systemd/,
which udevRules obviously isn't able resolve.
If we encounter such references, replace them with
config.systemd.package before doing the check.
commitd64d42e023f99ae592bc7ccd6298d66a657aa8ea
authorFlorian Klink <flokli@flokli.de>
dateFri 22 May 2020, 14:42 (6 years ago)
parent8cbf811
nixos/modules/services/hardware/udev.nix+4
@@ -83,6 +83,10 @@ let
8383 run_progs=$(grep -v '^[[:space:]]*#' $out/* | grep 'RUN+="/' |
8484 sed -e 's/.*RUN+="\([^ "]*\)[ "].*/\1/' | uniq)
8585 for i in $import_progs $run_progs; do
86+ # if the path refers to /run/current-system/systemd, replace with config.systemd.package
87+ if [[ $i == /run/current-system/systemd* ]]; then
88+ i="${config.systemd.package}/''${i#/run/current-system/systemd/}"
89+ fi
8690 if [[ ! -x $i ]]; then
8791 echo "FAIL"
8892 echo "$i is called in udev rules but is not executable or does not exist"