fix (option laptop): change option to configure cpu for the laptop

additional, fix laptop thinkbook config
This commit is contained in:
Kirill Samoylenkov 2025-09-27 13:56:58 +05:00
parent 4af09f128b
commit 094d206afc
2 changed files with 27 additions and 19 deletions

View file

@ -9,8 +9,11 @@
enable = true;
battery.enable = true;
bluetooth.enable = true;
cpu.type = "intel";
sound.enable = true;
cpu = {
enable = true;
type = "intel";
};
};
device.zram.enable = false;

View file

@ -29,13 +29,20 @@ in
description = "Bluetooth configuration for the laptop.";
};
cpu.type = lib.mkOption {
type = lib.enum [
"intel"
"amd"
];
default = "intel";
description = "Laptop CPU type.";
cpu = {
enable = lib.mkOption {
type = lib.types.bool;
default = true;
description = "CPU configuration for the laptop.";
};
type = lib.mkOption {
type = lib.enum [
"intel"
"amd"
];
default = "intel";
description = "Laptop CPU type.";
};
};
sound.enable = lib.mkOption {
@ -85,18 +92,16 @@ in
};
imports = lib.optional (
cfg.cpu.type == "intel"
cfg.cpu.enable && cfg.cpu.type == "intel"
) inputs.nixos-hardware.nixosModules.common-cpu-intel;
services.thermald =
lib.mkIf cfg.cpu.type == "intel" {
enable = true;
package = pkgs.thermald;
};
hardware.graphics =
lib.mkIf cfg.cpu.type == "intel" {
enable = true;
enable32Bit = true;
};
services.thermald = lib.mkIf (cfg.cpu.enable && cfg.cpu.type == "intel") {
enable = true;
package = pkgs.thermald;
};
hardware.graphics = lib.mkIf (cfg.cpu.enable && cfg.cpu.type == "intel") {
enable = true;
enable32Bit = true;
};
security.rtkit.enable = lib.mkIf cfg.sound.enable true;
services.pulseaudio = lib.mkIf cfg.sound.enable {