make cpu/battery stuff configurable
This commit is contained in:
parent
d746cbc265
commit
07d318b15c
|
@ -6,6 +6,7 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
has_battery = true;
|
has_battery = true;
|
||||||
|
useThermald = true;
|
||||||
desktop_scale = 1.3;
|
desktop_scale = 1.3;
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod" ];
|
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod" ];
|
||||||
|
|
18
options.nix
18
options.nix
|
@ -35,5 +35,23 @@
|
||||||
default = {};
|
default = {};
|
||||||
description = "Additional config for sway outputs";
|
description = "Additional config for sway outputs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
cpufreqConfig = lib.mkOption {
|
||||||
|
type = lib.types.attrsOf lib.types.anything;
|
||||||
|
default = {};
|
||||||
|
description = "Additional config for auto-cpufreq";
|
||||||
|
};
|
||||||
|
|
||||||
|
useThermald = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Use thermald for thermal management";
|
||||||
|
};
|
||||||
|
|
||||||
|
tlpConfig = lib.mkOption {
|
||||||
|
type = lib.types.attrsOf lib.types.anything;
|
||||||
|
default = {};
|
||||||
|
description = "Additional config for TLP";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{inputs, pkgs, config, ...}: {
|
{inputs, lib, pkgs, config, ...}: {
|
||||||
imports = [
|
imports = [
|
||||||
../options.nix
|
../options.nix
|
||||||
];
|
];
|
||||||
|
@ -151,33 +151,35 @@
|
||||||
dnsovertls = "true";
|
dnsovertls = "true";
|
||||||
};
|
};
|
||||||
|
|
||||||
# thermald.enable = true;
|
thermald.enable = config.useThermald;
|
||||||
# tlp = {
|
|
||||||
# enable = true;
|
|
||||||
# settings = {
|
|
||||||
# START_CHARGE_THRESH_BAT0 = 50;
|
|
||||||
# STOP_CHARGE_THRESH_BAT0 = 85;
|
|
||||||
# };
|
|
||||||
# };
|
|
||||||
# auto-cpufreq = {
|
|
||||||
# enable = true;
|
|
||||||
# settings = {
|
|
||||||
# battery = {
|
|
||||||
# governor = "powersave"; # Set the CPU governor to powersave.
|
|
||||||
# energy_performance_preference = "powersave";
|
|
||||||
# turbo = "never";
|
|
||||||
|
|
||||||
# # enable_thresholds = true;
|
tlp = lib.mkIf (config.has_battery) {
|
||||||
# # start_threshold = 50;
|
enable = true;
|
||||||
# # stop_threshold = 90;
|
settings = {
|
||||||
# };
|
START_CHARGE_THRESH_BAT0 = 50;
|
||||||
|
STOP_CHARGE_THRESH_BAT0 = 85;
|
||||||
|
};
|
||||||
|
} // config.tlpConfig or {};
|
||||||
|
|
||||||
# charger = {
|
auto-cpufreq = lib.mkIf (config.has_battery) {
|
||||||
# governor = "performance"; # Set the CPU governor to performance when charging.
|
enable = true;
|
||||||
# turbo = "auto";
|
settings = {
|
||||||
# };
|
battery = {
|
||||||
# };
|
governor = "powersave"; # Set the CPU governor to powersave.
|
||||||
# };
|
energy_performance_preference = "powersave";
|
||||||
|
turbo = "never";
|
||||||
|
|
||||||
|
# enable_thresholds = true;
|
||||||
|
# start_threshold = 50;
|
||||||
|
# stop_threshold = 90;
|
||||||
|
};
|
||||||
|
|
||||||
|
charger = {
|
||||||
|
governor = "performance"; # Set the CPU governor to performance when charging.
|
||||||
|
turbo = "auto";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
} // config.cpufreqConfig or {};
|
||||||
|
|
||||||
pipewire = {
|
pipewire = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
Loading…
Reference in a new issue