{ pkgs, lib, config, ... }: let inherit (lib.my) getExe' mkStringIf; isDesktop = config.modules.system.roles.desktop.enable; in { services.udev.extraRules = '' ${mkStringIf isDesktop '' # Rule for the MacBook Air SuperDrive ACTION=="add", \ ATTRS{product}=="MacBook Air SuperDrive", \ ATTRS{idProduct}=="1500", ATTRS{idVendor}=="05ac", \ DRIVERS=="usb", \ RUN+="${getExe' pkgs.sg3_utils "sg_raw"} %r/sr%n EA 00 00 00 00 00 01" ''} ''; }