ydotool.nix (705B)
1 { pkgs, username, ... }: 2 3 { 4 boot.kernelModules = [ "uinput" ]; 5 users.users.${username}.extraGroups = [ "uinput" ]; 6 # Define the uinput group 7 users.groups.uinput = {}; 8 9 # Install ydotool system-wide 10 environment.systemPackages = with pkgs; [ 11 ydotool 12 ]; 13 14 # Udev rule to allow group access to /dev/uinput 15 services.udev.extraRules = '' 16 KERNEL=="uinput", GROUP="uinput", MODE="0660" 17 ''; 18 19 # Set capabilities on ydotool via a wrapper so it persists rebuilds 20 security.wrappers.ydotool = { 21 source = "${pkgs.ydotool}/bin/ydotool"; 22 capabilities = "cap_sys_admin,cap_dac_override,cap_sys_nice+ep"; 23 owner = "root"; 24 group = "uinput"; 25 permissions = "u+rx,g+rx"; 26 }; 27 }