monolith: extract undervolt config
This commit is contained in:
parent
2de6fdb7be
commit
b3aadef8cb
|
@ -23,6 +23,7 @@ in
|
|||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
./partition.nix
|
||||
./undervolt.nix
|
||||
];
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
|
@ -66,14 +67,6 @@ in
|
|||
|
||||
boot.kernelPackages = pkgs.linuxPackages_6_1;
|
||||
|
||||
programs.corectrl = {
|
||||
enable = true;
|
||||
gpuOverclock = {
|
||||
enable = true;
|
||||
ppfeaturemask = "0xffffffff";
|
||||
};
|
||||
};
|
||||
|
||||
fileSystems."/mnt/old" = {
|
||||
device = "/dev/disk/by-label/BTRFS_ROOT";
|
||||
fsType = "btrfs";
|
||||
|
|
16
hosts/monolith/undervolt.nix
Normal file
16
hosts/monolith/undervolt.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ pkgs, ... }:
|
||||
let
|
||||
undervoltGpu = pkgs.writeShellScript "undervolt-gpu" ''
|
||||
set -xe
|
||||
cd $1
|
||||
test -e pp_od_clk_voltage
|
||||
echo "vo -100" > pp_od_clk_voltage
|
||||
echo "c" > pp_od_clk_voltage
|
||||
'';
|
||||
in
|
||||
{
|
||||
boot.kernelParams = [ "amdgpu.ppfeaturemask=0xfffd7fff" ];
|
||||
services.udev.extraRules = ''
|
||||
ACTION=="add", SUBSYSTEM=="hwmon", ATTR{name}=="amdgpu", ATTR{power1_cap}="186000000", RUN+="${undervoltGpu} %S%p/device"
|
||||
'';
|
||||
}
|
Loading…
Reference in a new issue