diff --git a/devices/thinkbook/default.nix b/devices/thinkbook/default.nix index 003cf42..7893a7c 100644 --- a/devices/thinkbook/default.nix +++ b/devices/thinkbook/default.nix @@ -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; diff --git a/options/device/desktop.nix b/options/device/laptop.nix similarity index 76% rename from options/device/desktop.nix rename to options/device/laptop.nix index 5aac714..5a066f2 100644 --- a/options/device/desktop.nix +++ b/options/device/laptop.nix @@ -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 {