4
hosts/common/system/configs/powertop/default.nix
Normal file
4
hosts/common/system/configs/powertop/default.nix
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
environment.systemPackages = with pkgs; [ powertop ];
|
||||||
|
}
|
@@ -31,6 +31,7 @@
|
|||||||
../common/system/configs/ntp
|
../common/system/configs/ntp
|
||||||
../common/system/configs/pipewire
|
../common/system/configs/pipewire
|
||||||
../common/system/configs/plymouth
|
../common/system/configs/plymouth
|
||||||
|
../common/system/configs/powertop
|
||||||
../common/system/configs/printing
|
../common/system/configs/printing
|
||||||
../common/system/configs/ranger
|
../common/system/configs/ranger
|
||||||
../common/system/configs/sops
|
../common/system/configs/sops
|
||||||
@@ -47,6 +48,10 @@
|
|||||||
./users/nick.nix
|
./users/nick.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
networking.hostName = "eirene";
|
||||||
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
sops.defaultSopsFile = ./secrets/secrets.yaml;
|
||||||
|
|
||||||
# https://github.com/NixOS/nixos-hardware/tree/master/lenovo/legion/16achg6
|
# https://github.com/NixOS/nixos-hardware/tree/master/lenovo/legion/16achg6
|
||||||
hardware = {
|
hardware = {
|
||||||
enableAllFirmware = true;
|
enableAllFirmware = true;
|
||||||
@@ -83,9 +88,12 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.hostName = "eirene";
|
powerManagement = {
|
||||||
i18n.defaultLocale = "en_US.UTF-8";
|
enable = true;
|
||||||
sops.defaultSopsFile = ./secrets/secrets.yaml;
|
powertop.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.powertop.postStart = builtins.readFile ./scripts/mouse.sh;
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
xserver.videoDrivers = [ "nvidia" ];
|
xserver.videoDrivers = [ "nvidia" ];
|
||||||
|
13
hosts/eirene/scripts/mouse.sh
Normal file
13
hosts/eirene/scripts/mouse.sh
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
SEARCH_STRINGS=(
|
||||||
|
"Mouse"
|
||||||
|
"Razer DeathAdder Elite"
|
||||||
|
)
|
||||||
|
|
||||||
|
for search_string in "${SEARCH_STRINGS[@]}"; do
|
||||||
|
echo "Searching for devices matching: ${search_string}"
|
||||||
|
|
||||||
|
for f in $(grep -l "${search_string}" /sys/bus/usb/devices/*/product 2>/dev/null | sed "s/product/power\\/control/"); do
|
||||||
|
echo "Setting power control to 'on' for: ${f}"
|
||||||
|
echo on >| "${f}"
|
||||||
|
done
|
||||||
|
done
|
Reference in New Issue
Block a user