Consistently format module argument blocks and convert aligned package comments to inline comments. Trim trailing whitespace and minor layout tweaks across modules. Bump opencode rev, narHash and lastModified in flake.lock and remove the original dev ref.
40 lines
2.3 KiB
Nix
40 lines
2.3 KiB
Nix
# modules/power.nix
|
|
# Power management for desktop: CPU governor control, power profiles
|
|
{
|
|
config,
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}:
|
|
|
|
{
|
|
# ═══════════════════════════════════════════════════════════════
|
|
# POWER PROFILES DAEMON
|
|
# ═══════════════════════════════════════════════════════════════
|
|
# Provides power-saver, balanced, and performance profiles
|
|
# Can be switched via CLI or desktop integration
|
|
services.power-profiles-daemon.enable = true;
|
|
|
|
# ═══════════════════════════════════════════════════════════════
|
|
# CPU FREQUENCY SCALING
|
|
# ═══════════════════════════════════════════════════════════════
|
|
# Use schedutil for modern AMD CPUs (responds to load dynamically)
|
|
powerManagement.cpuFreqGovernor = "schedutil";
|
|
|
|
# ═══════════════════════════════════════════════════════════════
|
|
# PACKAGES
|
|
# ═══════════════════════════════════════════════════════════════
|
|
environment.systemPackages = with pkgs; [
|
|
power-profiles-daemon # Already enabled as service, CLI tool for control
|
|
];
|
|
|
|
# ═══════════════════════════════════════════════════════════════
|
|
# KERNEL PARAMETERS FOR POWER EFFICIENCY
|
|
# ═══════════════════════════════════════════════════════════════
|
|
# These help reduce power draw on idle desktop systems
|
|
boot.kernelParams = [
|
|
# Enable AMD P-State driver for modern Ryzen CPUs
|
|
"amd_pstate=active"
|
|
];
|
|
}
|