git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #88607 from flokli/udev-rules-run-current-system-systemd

nixos/udev: support /run/current-system/systemd in udevRules

commit93ff93d53970b645a2732914cc7244399b31d2f0 authorFlorian Klink <flokli@flokli.de> dateFri 22 May 2020, 17:10 (6 years ago) parent3d4c307d64d42e
1 file changed+4
nixos/modules/services/hardware/udev.nix+4
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"