hosts | add auto-cpufreq, switch loki & smaug to use, formating

This commit is contained in:
Don Harper 2025-08-21 13:39:59 -05:00
parent b7ca0e0020
commit 43fe882270
5 changed files with 54 additions and 7 deletions

View file

@ -1,4 +1,11 @@
{ inputs, outputs, lib, config, pkgs, ... }: {
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
imports = [
inputs.nixos-hardware.nixosModules.dell-xps-13-9310
./hardware-configuration.nix
@ -6,7 +13,7 @@
../workstation
];
networking.hostName = "loki";
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
boot.binfmt.emulatedSystems = ["aarch64-linux"];
variables.address = "100.72.0.1";
variables.swayScale = "1.1";
@ -18,7 +25,8 @@
kvm.enable = false;
games.enable = true;
wine.enable = false;
tlp.enable = true;
tlp.enable = false;
auto-cpufreq.enable = true;
gnome-calendar.enable = true;
};
wm = {

View file

@ -1,4 +1,11 @@
{ inputs, outputs, lib, config, pkgs, ... }: {
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
imports = [
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-x260
inputs.nixos-hardware.nixosModules.common-pc-laptop
@ -19,7 +26,8 @@
kvm.enable = true;
games.enable = true;
wine.enable = false;
tlp.enable = true;
tlp.enable = false;
auto-cpufreq = true;
gnome-calendar.enable = true;
};
wm = {

View file

@ -1,8 +1,8 @@
{ lib, ... }: {
{lib, ...}: {
options = {
variables = lib.mkOption {
type = lib.types.attrs;
default = { };
default = {};
};
};
}

View file

@ -0,0 +1,30 @@
{
pkgs,
inputs,
config,
lib,
...
}:
with lib; let
cfg = config.roles.auto-cpufreq;
in {
options.roles.auto-cpufreq = {enable = mkEnableOption "roles auto-cpufreq";};
config = mkIf cfg.enable {
services.auto-cpufreq = {
enable = true;
settings = {
battery = {
governor = "powersave";
turbo = "never";
enable_thresholds = true;
start_threshold = 50;
stop_threshold = 80;
};
charger = {
governor = "performance";
turbo = "auto";
};
};
};
};
}

View file

@ -48,6 +48,7 @@ in {
./detect-reboot-needed.nix
./kmscon.nix
./systemd.nix
./auto-cpufreq.nix
./tlp.nix
./upgrade-diff.nix
./wine.nix