diff --git a/flake.lock b/flake.lock index 65b8d99..b28e58f 100644 --- a/flake.lock +++ b/flake.lock @@ -21,6 +21,26 @@ "type": "github" } }, + "auto-cpufreq": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1787549773, + "narHash": "sha256-ZSTNqXLMfk+0er/w6PVANwRmbIUt0q9sz5FyoallQYU=", + "owner": "AdnanHodzic", + "repo": "auto-cpufreq", + "rev": "30bc44de0492689059dbf2eae49d2438333fdc63", + "type": "github" + }, + "original": { + "owner": "AdnanHodzic", + "repo": "auto-cpufreq", + "type": "github" + } + }, "base16": { "inputs": { "fromYaml": "fromYaml" @@ -1282,6 +1302,7 @@ "root": { "inputs": { "aerothemeplasma": "aerothemeplasma", + "auto-cpufreq": "auto-cpufreq", "catppuccin": "catppuccin", "catppuccin-userstyles-nix": "catppuccin-userstyles-nix", "copyparty": "copyparty", diff --git a/flake.nix b/flake.nix index 459821b..0011c12 100644 --- a/flake.nix +++ b/flake.nix @@ -93,5 +93,10 @@ millennium.url = "github:SteamClientHomebrew/Millennium?dir=packages/nix"; fetch.url = "github:areofyl/fetch"; + + auto-cpufreq = { + url = "github:AdnanHodzic/auto-cpufreq"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; } diff --git a/modules/core/autocpufreq.nix b/modules/core/autocpufreq.nix new file mode 100644 index 0000000..2d763b7 --- /dev/null +++ b/modules/core/autocpufreq.nix @@ -0,0 +1,19 @@ +{ + den.aspects.autocpufreq = { + nixos = { + programs.auto-cpufreq.enable = true; + + programs.auto-cpufreq.settings = { + charger = { + governor = "performance"; + turbo = "auto"; + }; + + battery = { + governor = "powersave"; + turbo = "auto"; + }; + }; + }; + }; +} diff --git a/modules/hosts/styx.nix b/modules/hosts/styx.nix index 8bb07a0..e2eb671 100644 --- a/modules/hosts/styx.nix +++ b/modules/hosts/styx.nix @@ -19,6 +19,8 @@ niri noctalia + + autocpufreq ]; nixos = {