WIP: refactor homeeConfigs
All checks were successful
Build iso when a new version is pushed / test (push) Successful in 2m0s
All checks were successful
Build iso when a new version is pushed / test (push) Successful in 2m0s
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
# By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ #
|
||||
# +#+#+#+#+#+ +#+ #
|
||||
# Created: 2025/09/06 00:56:57 by tomoron #+# #+# #
|
||||
# Updated: 2025/09/17 18:46:28 by tomoron ### ########.fr #
|
||||
# Updated: 2025/09/23 04:08:25 by tomoron ### ########.fr #
|
||||
# #
|
||||
# **************************************************************************** #
|
||||
|
||||
@ -79,16 +79,20 @@
|
||||
|
||||
mods.touchpad.enable = true;
|
||||
|
||||
mods.powerSave.enable = true;
|
||||
mods.powerSave.powahCommandAdditions = [
|
||||
"supergfxctl -m Hybrid"
|
||||
"if asusctl profile -p | grep Balanced ; then asusctl profile -P Performance; fi"
|
||||
"if asusctl profile -p | grep Quiet ; then asusctl profile -P Balanced; fi"
|
||||
];
|
||||
mods.powerSave.tagueuleCommandAdditions = [
|
||||
"echo \"can't safely turn off the GPU\""
|
||||
"asusctl profile -P Quiet"
|
||||
];
|
||||
mods.powerSave = {
|
||||
enable = true;
|
||||
powahCommandAdditions = [
|
||||
"supergfxctl -m Hybrid"
|
||||
"if asusctl profile -p | grep Balanced ; then asusctl profile -P Performance; fi"
|
||||
"if asusctl profile -p | grep Quiet ; then asusctl profile -P Balanced; fi"
|
||||
];
|
||||
tagueuleCommandAdditions = [
|
||||
"echo \"can't safely turn off the GPU\""
|
||||
"asusctl profile -P Quiet"
|
||||
];
|
||||
cpuMaxFreq = 4465261;
|
||||
|
||||
};
|
||||
|
||||
services.asusd = {
|
||||
enable = true;
|
||||
|
@ -6,7 +6,7 @@
|
||||
# By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ #
|
||||
# +#+#+#+#+#+ +#+ #
|
||||
# Created: 2025/09/06 00:45:04 by tomoron #+# #+# #
|
||||
# Updated: 2025/09/21 00:51:55 by tomoron ### ########.fr #
|
||||
# Updated: 2025/09/23 04:25:20 by tomoron ### ########.fr #
|
||||
# #
|
||||
# **************************************************************************** #
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
default = false;
|
||||
description = "enable services and settings to save power";
|
||||
};
|
||||
|
||||
powahCommandAdditions = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [];
|
||||
@ -29,6 +30,41 @@
|
||||
default = [];
|
||||
description = "commands the `tagueule` script runs";
|
||||
};
|
||||
|
||||
pStateCompatible = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "is the cpu p-state compatible. only most of intel cpu's";
|
||||
};
|
||||
|
||||
cpuMaxFreq = lib.mkOption {
|
||||
type = lib.types.ints.positive;
|
||||
default = 5000000;
|
||||
description = "the max frequency of the cpu (in KHz)";
|
||||
};
|
||||
|
||||
governorPowers = {
|
||||
ac.min = lib.mkOption {
|
||||
type = lib.types.ints.unsigned;
|
||||
default = 30;
|
||||
description = "min frequency on AC";
|
||||
};
|
||||
ac.max = lib.mkOption {
|
||||
type = lib.types.ints.unsigned;
|
||||
default = 100;
|
||||
description = "max frequency on AC";
|
||||
};
|
||||
bat.min = lib.mkOption {
|
||||
type = lib.types.ints.unsigned;
|
||||
default = 0;
|
||||
description = "min frequency on BAT";
|
||||
};
|
||||
bat.max = lib.mkOption {
|
||||
type = lib.types.ints.unsigned;
|
||||
default = 40;
|
||||
description = "max frequency on BAT";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -44,12 +80,19 @@
|
||||
|
||||
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
|
||||
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
|
||||
|
||||
CPU_MIN_PERF_ON_AC = 0;
|
||||
CPU_MAX_PERF_ON_AC = 100;
|
||||
CPU_MIN_PERF_ON_BAT = 0;
|
||||
CPU_MAX_PERF_ON_BAT = 20;
|
||||
};
|
||||
}
|
||||
// lib.optionalAttrs (!config.mods.powerSave.pStateCompatible) (with config.mods.powerSave; {
|
||||
CPU_SCALING_MIN_FREQ_ON_AC = (cpuMaxFreq * governorPowers.ac.min) / 100;
|
||||
CPU_SCALING_MAX_FREQ_ON_AC = (cpuMaxFreq * governorPowers.ac.max) / 100;
|
||||
CPU_SCALING_MIN_FREQ_ON_BAT = (cpuMaxFreq * governorPowers.bat.min) / 100;
|
||||
CPU_SCALING_MAX_FREQ_ON_BAT = (cpuMaxFreq * governorPowers.bat.max) / 100;
|
||||
})
|
||||
// lib.optionalAttrs config.mods.powerSave.pStateCompatible (with config.mods.powerSave.governorPowers; {
|
||||
CPU_MIN_PERF_ON_AC = ac.min;
|
||||
CPU_MAX_PERF_ON_AC = ac.max;
|
||||
CPU_MIN_PERF_ON_BAT = bat.min;
|
||||
CPU_MAX_PERF_ON_BAT = bat.max;
|
||||
});
|
||||
};
|
||||
|
||||
environment.systemPackages = [
|
||||
@ -77,7 +120,6 @@
|
||||
];
|
||||
|
||||
powerManagement.enable = true;
|
||||
services.upower.enable = true;
|
||||
mods.nvidia.prime = true;
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user