最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

services.udev.extraRules causes novel error (NIXOS) - Stack Overflow

programmeradmin2浏览0评论

adding this line to my configuration.nix services.udev.extraRules = ''ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="acpi_video0", RUN+="/bin/chmod a+w /sys/class/backlight/$attr{type}/brightness"''; causes the error /bin/chmod is called by udev rules but is not executable or does not exist when running sudo nixos-rebuild switch --flake 'flake/#shivanix'

where chmod places the executable at /run/current-system/sw/bin/chmod, not at /bin/chmod

my configuration.nix []

I have searched for over 3 hours for this error. The only replication of this error anywhere online is in this thread: .

The solution is, and i quote, "You’ll need to do something like substituteInPlace to change the FHS paths to nix store paths". Not only does this function have little to no documentation, especially in relation to this problem(i'm relatively new to nixos), the idea that I need to fix something which is a builtin function of the OS and the only way to add custom udev rules is a completely absurd idea.

Yes, the only way. UDEV is read-only, and you're unable to change this by any means within nixos to my knowledge (i tried many, remounting, restarting system services, everything anywhere online told me to try)

I also fumbled around trying to use writeTextFile which was one persons solution to creating custom UDEV rules, this was also frivolous after about an hour and seems like a bad way to do it anyway.

and seem to be related, however they are solved and already merged.

I'm at a loss. I'm open to anything. 3 hours of my life so far just trying to set one custom udev rule...

i even tried just copying the executable to /bin/chmod out of desperation and it still gave the same error

anything helps, everyone...love

发布评论

评论列表(0)

  1. 暂无评论