Created
August 28, 2019 17:18
-
-
Save tokudan/9e56e81bd93052f68d7f5c57710a6c63 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services.udev.extraRules = '' | |
# The next line sets the scheduler only for non-rotational disks | |
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="noop" | |
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="deadline" | |
# Some power management... | |
# PCI runtime power management | |
ACTION=="add", SUBSYSTEM=="pci", ATTR{power/control}="auto" | |
# USB autosuspend | |
ACTION=="add", SUBSYSTEM=="usb", ATTR{power/control}="auto" | |
ACTION=="add", SUBSYSTEM=="usb", TEST=="power/autosuspend" ATTR{power/autosuspend}="60" | |
# SATA active link power management | |
SUBSYSTEM=="scsi_host", KERNEL=="host*", ATTR{link_power_management_policy}="min_power" | |
# Wlan power save | |
ACTION=="add", SUBSYSTEM=="net", KERNEL=="wlan*" RUN+="${pkgs.iw.out}/bin/iw dev %k set power_save on" | |
# Disable bluetooth | |
SUBSYSTEM=="rfkill", ATTR{type}=="bluetooth", ATTR{state}="0" | |
# Disable wake-on-LAN | |
ACTION=="add", SUBSYSTEM=="net", KERNEL=="eth*" RUN+="${pkgs.ethtool.out}/bin/ethtool -s %k wol d" | |
# Configure disk spin down after 5 minutes... | |
ACTION=="add", SUBSYSTEM=="block", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", RUN+="${pkgs.hdparm}/bin/hdparm -S 60 /dev/sda" | |
# Yubikey | |
ACTION=="add", ATTR{idVendor}=="1050", ATTR{manufacturer}=="Yubico", GROUP="users" | |
''; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment