Skip to content

Commit 4bf36e8

Browse files
committed
Update laptop config
1 parent 93dcc1f commit 4bf36e8

File tree

5 files changed

+58
-6
lines changed

5 files changed

+58
-6
lines changed

dots/nvim/lua/plugins/java.lua

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
return {
22
"nvim-java/nvim-java",
33

4-
event = "VeryLazy",
4+
enabled = false,
5+
6+
-- event = "VeryLazy",
57

68
config = function()
79
require("java").setup()

hosts/desktops/orion/default.nix

+8-4
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
./hardware-configuration.nix
77

88
../../../modules/llms.nix
9+
../../../modules/hardware/hp-wmi.nix
910
];
1011

1112
networking.hostName = "orion";
1213

1314
boot = {
1415
kernelModules = [
1516
"nct6775"
16-
"hp-wmi"
1717
"coretemp"
1818
];
1919
loader = {
@@ -50,9 +50,13 @@
5050
pkgs.alsa-ucm-conf
5151
];
5252

53-
# TODO: move to separate module for all desktops
54-
programs.coolercontrol = {
53+
services.thermald.enable = true;
54+
55+
services.tlp = {
5556
enable = true;
56-
nvidiaSupport = true;
57+
settings = {
58+
TLP_DEFAULT_MODE = "BAT";
59+
TLP_PERSISTENT_DEFAULT = 1;
60+
};
5761
};
5862
}

modules/graphics/nvidia.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
modesetting.enable = true;
1313

1414
powerManagement = {
15-
enable = false; # TODO: configure power management
15+
enable = true; # TODO: configure power management
1616
finegrained = false;
1717
};
1818

modules/hardware/hp-wmi.nix

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{ pkgs, ... }:
2+
3+
{
4+
boot.kernelModules = [ "hp-wmi" ];
5+
6+
environment.systemPackages = [
7+
(pkgs.writeShellApplication {
8+
name = "hp_wmi_boost_fan";
9+
runtimeInputs = [ pkgs.coreutils ]; # Provides cat, tr, echo
10+
text = builtins.readFile ../../scripts/hp_wmi_boost_fan.sh;
11+
})
12+
];
13+
}

scripts/hp_wmi_boost_fan.sh

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
set -e
2+
3+
TARGET_FILE="/sys/devices/platform/hp-wmi/hwmon/hwmon1/pwm1_enable"
4+
5+
if [ ! -f "$TARGET_FILE" ]; then
6+
echo "ERROR: Target file not found: $TARGET_FILE" >&2
7+
echo "Please ensure the path is correct and the hp-wmi kernel module is loaded." >&2
8+
exit 1
9+
fi
10+
11+
current_value=$(tr -d '[:space:]' < "$TARGET_FILE")
12+
13+
echo "Current fan setting in $TARGET_FILE is: '$current_value'"
14+
15+
new_value=""
16+
if [ "$current_value" = "0" ]; then
17+
new_value="2"
18+
else
19+
new_value="0"
20+
fi
21+
22+
echo "Changing fan setting to: '$new_value'"
23+
24+
if echo "$new_value" > "$TARGET_FILE"; then
25+
echo "Successfully changed fan setting to '$new_value'."
26+
else
27+
echo "ERROR: Failed to write '$new_value' to $TARGET_FILE." >&2
28+
echo "Please make sure you are running this script with sudo privileges." >&2
29+
exit 1
30+
fi
31+
32+
exit 0
33+

0 commit comments

Comments
 (0)