From d64d42e023f99ae592bc7ccd6298d66a657aa8ea Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Fri, 22 May 2020 14:42:25 +0200 Subject: [PATCH] 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. --- nixos/modules/services/hardware/udev.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nixos/modules/services/hardware/udev.nix b/nixos/modules/services/hardware/udev.nix index 168056a475e..587b9b0234a 100644 --- a/nixos/modules/services/hardware/udev.nix +++ b/nixos/modules/services/hardware/udev.nix @@ -83,6 +83,10 @@ let run_progs=$(grep -v '^[[:space:]]*#' $out/* | grep 'RUN+="/' | sed -e 's/.*RUN+="\([^ "]*\)[ "].*/\1/' | uniq) for i in $import_progs $run_progs; do + # if the path refers to /run/current-system/systemd, replace with config.systemd.package + if [[ $i == /run/current-system/systemd* ]]; then + i="${config.systemd.package}/''${i#/run/current-system/systemd/}" + fi if [[ ! -x $i ]]; then echo "FAIL" echo "$i is called in udev rules but is not executable or does not exist"