Enforce thunderbolt to be enabled on speer boot
This commit is contained in:
parent
0911c7c418
commit
824bd10049
1 changed files with 21 additions and 1 deletions
|
@ -12,9 +12,29 @@
|
||||||
"igb"
|
"igb"
|
||||||
];
|
];
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ ];
|
||||||
boot.kernelModules = [ "kvm-amd" ];
|
boot.kernelModules = [ "kvm-amd" "uhid" ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
boot.kernelParams = [ "acpi_enforce_resources=lax" ];
|
||||||
|
|
||||||
|
|
||||||
|
hardware.firmware = [ pkgs.wireless-regdb ];
|
||||||
|
|
||||||
hardware.cpu.amd.updateMicrocode = true;
|
hardware.cpu.amd.updateMicrocode = true;
|
||||||
nix.maxJobs = lib.mkDefault 24;
|
nix.maxJobs = lib.mkDefault 24;
|
||||||
|
|
||||||
|
powerManagement.powerUpCommands = let
|
||||||
|
forceThunderboltOnScript = pkgs.writeScriptBin "force-thunderbolt-power-on" ''
|
||||||
|
#!${pkgs.stdenv.shell}
|
||||||
|
|
||||||
|
#echo 'on' > '/sys/bus/pci/devices/0000:03:00.0/power/control'; #TODO: Is the main controller required?
|
||||||
|
|
||||||
|
THUNDERBOLT_DEVICES="$(${pkgs.pciutils}/bin/lspci -D | ${pkgs.gnugrep}/bin/grep -i thunderbolt | cut --delimiter=' ' --fields=1)"
|
||||||
|
|
||||||
|
echo "Force PCI power on all thunderbolt devices"
|
||||||
|
|
||||||
|
for DEVICE in $THUNDERBOLT_DEVICES; do
|
||||||
|
echo 'on' > "/sys/bus/pci/devices/$DEVICE/power/control"
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
in "${forceThunderboltOnScript}/bin/force-thunderbolt-power-on";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue