-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
136 additions
and
128 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,5 +19,6 @@ | |
gimp | ||
inkscape | ||
keepassxc | ||
dconf | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,87 @@ | ||
{ | ||
pkgs, | ||
config, | ||
lib, | ||
... | ||
}: { | ||
}: let | ||
MHz = x: x * 1000; | ||
inherit (lib) mkDefault; | ||
in { | ||
imports = [./hardware-configuration.nix]; | ||
environment.systemPackages = with pkgs; [ | ||
acpi | ||
powertop | ||
]; | ||
|
||
services = { | ||
fprintd.enable = true; | ||
thermald.enable = true; | ||
power-profiles-daemon.enable = false; # conflicts with tlp | ||
tlp = { | ||
power-profiles-daemon.enable = true; | ||
undervolt = { | ||
enable = true; | ||
coreOffset = -100; | ||
gpuOffset = -80; | ||
tempBat = 65; | ||
}; | ||
# DBus service that provides power management support to applications. | ||
upower = { | ||
enable = true; | ||
percentageLow = 15; | ||
percentageCritical = 5; | ||
percentageAction = 3; | ||
criticalPowerAction = "Hibernate"; | ||
}; | ||
# superior power management (brought to you by raf :3) | ||
auto-cpufreq = { | ||
enable = true; | ||
settings = { | ||
DEVICES_TO_DISABLE_ON_STARTUP = "bluetooth"; | ||
START_CHARGE_THRESH_BAT0 = 75; | ||
STOP_CHARGE_THRESH_BAT0 = 90; | ||
CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; | ||
ENERGY_PERF_POLICY_ON_BAT = "powersave"; | ||
CPU_BOOST_ON_AC = 1; | ||
CPU_BOOST_ON_BAT = 0; | ||
CPU_HWP_DYN_BOOST_ON_AC = 1; | ||
CPU_HWP_DYN_BOOST_ON_BAT = 0; | ||
SCHED_POWERSAVE_ON_AC = 0; | ||
SCHED_POWERSAVE_ON_BAT = 1; | ||
NMI_WATCHDOG = 0; | ||
PLATFORM_PROFILE_ON_AC = "performance"; | ||
WOL_DISABLE = "Y"; | ||
PLATFORM_PROFILE_ON_BAT = "low-power"; | ||
RUNTIME_PM_ON_AC = "on"; | ||
RUNTIME_PM_ON_BAT = "auto"; | ||
USB_AUTOSUSPEND = 1; | ||
CPU_MIN_PERF_ON_AC = 0; | ||
CPU_MAX_PERF_ON_AC = 100; | ||
CPU_MIN_PERF_ON_BAT = 0; | ||
CPU_MAX_PERF_ON_BAT = 27; | ||
battery = { | ||
governor = "powersave"; | ||
scaling_min_freq = mkDefault (MHz 1800); | ||
scaling_max_freq = mkDefault (MHz 3600); | ||
turbo = "never"; | ||
}; | ||
charger = { | ||
governor = "performance"; | ||
scaling_min_freq = mkDefault (MHz 2000); | ||
scaling_max_freq = mkDefault (MHz 4800); | ||
turbo = "auto"; | ||
}; | ||
}; | ||
}; | ||
}; | ||
|
||
# https://github.com/NixOS/nixpkgs/issues/211345#issuecomment-1397825573 | ||
systemd.tmpfiles.rules = map | ||
(e: | ||
"w /sys/bus/${e}/power/control - - - - auto" | ||
) [ | ||
"pci/devices/0000:00:01.0" # Renoir PCIe Dummy Host Bridge | ||
"pci/devices/0000:00:02.0" # Renoir PCIe Dummy Host Bridge | ||
"pci/devices/0000:00:14.0" # FCH SMBus Controller | ||
"pci/devices/0000:00:14.3" # FCH LPC bridge | ||
"pci/devices/0000:04:00.0" # FCH SATA Controller [AHCI mode] | ||
"pci/devices/0000:04:00.1/ata1" # FCH SATA Controller, port 1 | ||
"pci/devices/0000:04:00.1/ata2" # FCH SATA Controller, port 2 | ||
"usb/devices/1-3" # USB camera | ||
]; | ||
# https://github.com/NixOS/nixpkgs/issues/211345#issuecomment-1397825573 | ||
systemd.tmpfiles.rules = | ||
map | ||
( | ||
e: "w /sys/bus/${e}/power/control - - - - auto" | ||
) [ | ||
"pci/devices/0000:00:01.0" # Renoir PCIe Dummy Host Bridge | ||
"pci/devices/0000:00:02.0" # Renoir PCIe Dummy Host Bridge | ||
"pci/devices/0000:00:14.0" # FCH SMBus Controller | ||
"pci/devices/0000:00:14.3" # FCH LPC bridge | ||
"pci/devices/0000:04:00.0" # FCH SATA Controller [AHCI mode] | ||
"pci/devices/0000:04:00.1/ata1" # FCH SATA Controller, port 1 | ||
"pci/devices/0000:04:00.1/ata2" # FCH SATA Controller, port 2 | ||
"usb/devices/1-3" # USB camera | ||
]; | ||
|
||
powerManagement = { | ||
cpuFreqGovernor = "powersave"; | ||
enable = true; | ||
boot = { | ||
kernelModules = ["acpi_call"]; | ||
extraModulePackages = with config.boot.kernelPackages; | ||
[ | ||
acpi_call | ||
cpupower | ||
] | ||
++ [pkgs.cpupower-gui]; | ||
}; | ||
security.pam.services.login.fprintAuth = true; | ||
hardware.trackpoint = { | ||
enable = true; | ||
emulateWheel = true; | ||
sensitivity = 250; | ||
speed = 30; | ||
sensitivity = 60; | ||
}; | ||
hardware.opengl.extraPackages = with pkgs; [vaapiIntel libvdpau-va-gl vaapiVdpau]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,6 @@ | |
|
||
boot.resumeDevice = "/dev/disk/by-label/swap"; | ||
|
||
|
||
boot.initrd.availableKernelModules = | ||
[ | ||
"xhci_pci" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.