fix (option laptop): change option to configure cpu for the laptop
additional, fix laptop thinkbook config
This commit is contained in:
parent
4af09f128b
commit
094d206afc
2 changed files with 27 additions and 19 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,13 @@ in
|
|||
description = "Bluetooth configuration for the laptop.";
|
||||
};
|
||||
|
||||
cpu.type = lib.mkOption {
|
||||
cpu = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "CPU configuration for the laptop.";
|
||||
};
|
||||
type = lib.mkOption {
|
||||
type = lib.enum [
|
||||
"intel"
|
||||
"amd"
|
||||
|
|
@ -37,6 +43,7 @@ in
|
|||
default = "intel";
|
||||
description = "Laptop CPU type.";
|
||||
};
|
||||
};
|
||||
|
||||
sound.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
|
|
@ -85,15 +92,13 @@ 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" {
|
||||
services.thermald = lib.mkIf (cfg.cpu.enable && cfg.cpu.type == "intel") {
|
||||
enable = true;
|
||||
package = pkgs.thermald;
|
||||
};
|
||||
hardware.graphics =
|
||||
lib.mkIf cfg.cpu.type == "intel" {
|
||||
hardware.graphics = lib.mkIf (cfg.cpu.enable && cfg.cpu.type == "intel") {
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
};
|
||||
Reference in a new issue