Add auto-cpufreq for adaptive CPU frequency scaling

This commit is contained in:
2025-09-27 14:58:23 +02:00
parent 8d12aec202
commit 6c48caaea8
4 changed files with 46 additions and 0 deletions

21
flake.lock generated
View File

@@ -1,5 +1,25 @@
{
"nodes": {
"auto-cpufreq": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1758887019,
"narHash": "sha256-5QDHaIKbmremgFh8Pc9ess59K4HJ5APM8pNgnYzAMno=",
"owner": "AdnanHodzic",
"repo": "auto-cpufreq",
"rev": "52194f4db364347626985fed5372eba2b6109cf4",
"type": "github"
},
"original": {
"owner": "AdnanHodzic",
"repo": "auto-cpufreq",
"type": "github"
}
},
"base16": {
"inputs": {
"fromYaml": "fromYaml"
@@ -276,6 +296,7 @@
},
"root": {
"inputs": {
"auto-cpufreq": "auto-cpufreq",
"firefox-addons": "firefox-addons",
"home-manager": "home-manager",
"nix-flatpak": "nix-flatpak",

View File

@@ -14,6 +14,11 @@
inputs.nixpkgs.follows = "nixpkgs";
};
auto-cpufreq = {
url = "github:AdnanHodzic/auto-cpufreq";
inputs.nixpkgs.follows = "nixpkgs";
};
firefox-addons = {
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
inputs.nixpkgs.follows = "nixpkgs";
@@ -32,6 +37,7 @@
nixpkgs,
home-manager,
nix-flatpak,
auto-cpufreq,
...
}@inputs:
let
@@ -59,6 +65,7 @@
modules = [
./profiles/${profile}
nix-flatpak.nixosModules.nix-flatpak
auto-cpufreq.nixosModules.default
];
};
in

View File

@@ -0,0 +1,17 @@
{ ... }:
{
programs.auto-cpufreq = {
enable = true;
settings = {
charger = {
governor = "performance";
turbo = "auto";
};
battery = {
governor = "powersave";
turbo = "auto";
};
};
};
}

View File

@@ -5,6 +5,7 @@
{
imports = [
./packages
./auto-cpufreq.nix
./boot.nix
./flatpak.nix
./fonts.nix