mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-09 12:29:19 -08:00
feat(goliath): refactor, make fans sane
This commit is contained in:
parent
67f6cccf47
commit
69d4363c8c
18 changed files with 178 additions and 335 deletions
10
nixos/hardware/amd_cpu.nix
Normal file
10
nixos/hardware/amd_cpu.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkDefault;
|
||||
in {
|
||||
boot.kernelModules = ["kvm-amd"];
|
||||
hardware.cpu.amd.updateMicrocode = mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
5
nixos/hardware/amd_gpu.nix
Normal file
5
nixos/hardware/amd_gpu.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
_: {
|
||||
boot.kernelParams = [
|
||||
"amdgpu.gpu_recovery=1"
|
||||
];
|
||||
}
|
||||
91
nixos/hardware/b550m-itx-ac.nix
Normal file
91
nixos/hardware/b550m-itx-ac.nix
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
{pkgs, ...}: {
|
||||
systemd.services.fanSetup = let
|
||||
# https://github.com/arcnmx/home/blob/9eb1cd4dd43883e1a0c6a2a55c00d7c3bede1776/hw/x370gpc/default.nix#L80 <3
|
||||
nct = "/sys/devices/platform/nct6775.656/hwmon/hwmon*/";
|
||||
# https://www.kernel.org/doc/html/next/hwmon/nct6775.html
|
||||
#nct = ".//.//.sys.devices.platform.nct6775/656.hwmon.hwmon0";
|
||||
|
||||
# take in celcius, turn it into millicelcius
|
||||
tempIn = x: toString (x * 1000);
|
||||
# take in a percentage, turn it into a number between 0 and 255
|
||||
pwmIn = x: toString (x * 255 / 100);
|
||||
|
||||
pwmEnable = {
|
||||
maximum = 0;
|
||||
manual = 1;
|
||||
thermalCruise = 2;
|
||||
speedCruise = 3;
|
||||
# smart_fan_3 = 4;
|
||||
smart_fan = 5;
|
||||
};
|
||||
|
||||
cpu_sensor = 2;
|
||||
mobo_sensor = 3;
|
||||
|
||||
cpu_temp = "temp${toString cpu_sensor}";
|
||||
mobo_temp = "temp${toString mobo_sensor}";
|
||||
exhaust = "pwm1";
|
||||
intake = "pwm3";
|
||||
|
||||
temps = {
|
||||
cpu = {
|
||||
max = 80;
|
||||
max_hyst = 75;
|
||||
};
|
||||
|
||||
mobo = {
|
||||
max = 50;
|
||||
max_hyst = 45;
|
||||
};
|
||||
};
|
||||
|
||||
fanScript = pkgs.writeShellScriptBin "fan" ''
|
||||
cd ${nct}
|
||||
echo "${toString temps.cpu.max}" > ${cpu_temp}_max
|
||||
echo "${toString temps.cpu.max_hyst}" > ${cpu_temp}_max_hyst
|
||||
echo "${toString temps.mobo.max}" > ${mobo_temp}_max
|
||||
echo "${toString temps.mobo.max_hyst}" > ${mobo_temp}_max_hyst
|
||||
|
||||
# Rear and Top Exhaust
|
||||
|
||||
echo "${toString pwmEnable.smart_fan}" > ${exhaust}_enable
|
||||
echo "${toString mobo_sensor}" > ${exhaust}_temp_sel
|
||||
echo "${tempIn 35}" > ${exhaust}_auto_point1_temp
|
||||
echo "${pwmIn 10}" > ${exhaust}_auto_point1_pwm
|
||||
echo "${tempIn 40}" > ${exhaust}_auto_point2_temp
|
||||
echo "${pwmIn 20}" > ${exhaust}_auto_point2_pwm
|
||||
echo "${tempIn 45}" > ${exhaust}_auto_point3_temp
|
||||
echo "${pwmIn 50}" > ${exhaust}_auto_point3_pwm
|
||||
echo "${tempIn 50}" > ${exhaust}_auto_point4_temp
|
||||
echo "${pwmIn 75}" > ${exhaust}_auto_point4_pwm
|
||||
echo "${tempIn 55}" > ${exhaust}_auto_point5_temp
|
||||
echo "${pwmIn 100}" > ${exhaust}_auto_point5_pwm
|
||||
|
||||
# Bottom Intake
|
||||
|
||||
echo "${toString pwmEnable.smart_fan}" > ${intake}_enable
|
||||
echo "${toString mobo_sensor}" > ${intake}_temp_sel
|
||||
echo "${tempIn 35}" > ${intake}_auto_point1_temp
|
||||
echo "${pwmIn 10}" > ${intake}_auto_point1_pwm
|
||||
echo "${tempIn 40}" > ${intake}_auto_point2_temp
|
||||
echo "${pwmIn 20}" > ${intake}_auto_point2_pwm
|
||||
echo "${tempIn 45}" > ${intake}_auto_point3_temp
|
||||
echo "${pwmIn 50}" > ${intake}_auto_point3_pwm
|
||||
echo "${tempIn 50}" > ${intake}_auto_point4_temp
|
||||
echo "${pwmIn 75}" > ${intake}_auto_point4_pwm
|
||||
echo "${tempIn 55}" > ${intake}_auto_point5_temp
|
||||
echo "${pwmIn 100}" > ${intake}_auto_point5_pwm
|
||||
|
||||
# CLC
|
||||
${pkgs.liquidctl}/bin/liquidctl --match clc set fan speed 20 0 30 0 40 10 50 50 60 75 70 100
|
||||
'';
|
||||
in {
|
||||
wantedBy = ["multi-user.target"];
|
||||
description = "Set up the fan speeds for the system";
|
||||
after = ["systemd-modules-load.service"];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${fanScript}/bin/fan";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
in {
|
||||
config = mkIf (config.machine.cpuVendor == "intel") {
|
||||
boot.kernelModules = ["kvm-intel"];
|
||||
};
|
||||
}
|
||||
5
nixos/hardware/intel_cpu.nix
Normal file
5
nixos/hardware/intel_cpu.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
_: let
|
||||
in {
|
||||
boot.kernelModules = ["kvm-intel"];
|
||||
services.thermald.enable = true;
|
||||
}
|
||||
13
nixos/hardware/uefi.nix
Normal file
13
nixos/hardware/uefi.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
_: {
|
||||
boot.loader = {
|
||||
grub = {
|
||||
devices = ["nodev"];
|
||||
efiSupport = true;
|
||||
gfxmodeEfi = "1920x1080";
|
||||
};
|
||||
efi = {
|
||||
canTouchEfiVariables = true;
|
||||
efiSysMountPoint = "/boot";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,8 +1,9 @@
|
|||
_: {
|
||||
boot.loader = {
|
||||
timeout = -1;
|
||||
timeout = null;
|
||||
grub = {
|
||||
# theme = pkgs.nixos-grub2-theme; # so like, this turbo-breaks the fuck out of GRUB, i have no clue why?
|
||||
enable = true;
|
||||
useOSProber = true;
|
||||
splashImage = ./splash.jpg;
|
||||
extraConfig = ''
|
||||
set color_normal=black/black
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
dnsutils
|
||||
firefox
|
||||
usbutils
|
||||
plexamp
|
||||
inputs.konawall-py.packages.${pkgs.system}.konawall-py
|
||||
];
|
||||
services.udev.packages = [
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
in {
|
||||
config = mkIf (config.machine.cpuVendor == "intel") {
|
||||
services.thermald.enable = true;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue