mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2025-11-07 02:18:47 +08:00
common/gpu/intel: reformat
This commit is contained in:
@@ -1,7 +1,5 @@
|
|||||||
{
|
{
|
||||||
imports = [ ../. ];
|
imports = [ ../. ];
|
||||||
|
|
||||||
boot.kernelParams = [
|
boot.kernelParams = [ "i915.enable_guc=2" ];
|
||||||
"i915.enable_guc=2"
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,9 @@
|
|||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
imports = [ ../24.05-compat.nix ];
|
imports = [ ../24.05-compat.nix ];
|
||||||
options.hardware.intelgpu.driver = lib.mkOption {
|
|
||||||
|
options.hardware.intelgpu = {
|
||||||
|
driver = lib.mkOption {
|
||||||
description = "Intel GPU driver to use";
|
description = "Intel GPU driver to use";
|
||||||
type = lib.types.enum [
|
type = lib.types.enum [
|
||||||
"i915"
|
"i915"
|
||||||
@@ -15,16 +17,19 @@
|
|||||||
default = "i915";
|
default = "i915";
|
||||||
};
|
};
|
||||||
|
|
||||||
options.hardware.intelgpu.loadInInitrd =
|
loadInInitrd =
|
||||||
lib.mkEnableOption "Load the Intel GPU kernel module at stage 1 boot. (Added to `boot.initrd.kernelModules`)"
|
lib.mkEnableOption "Load the Intel GPU kernel module at stage 1 boot. (Added to `boot.initrd.kernelModules`)"
|
||||||
// {
|
// {
|
||||||
default = true;
|
default = true;
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
config = {
|
config =
|
||||||
boot.initrd.kernelModules = lib.optionals config.hardware.intelgpu.loadInInitrd [
|
let
|
||||||
config.hardware.intelgpu.driver
|
cfg = config.hardware.intelgpu;
|
||||||
];
|
in
|
||||||
|
{
|
||||||
|
boot.initrd.kernelModules = lib.optionals cfg.loadInInitrd [ cfg.driver ];
|
||||||
|
|
||||||
hardware.graphics.extraPackages = with pkgs; [
|
hardware.graphics.extraPackages = with pkgs; [
|
||||||
(
|
(
|
||||||
@@ -49,8 +54,7 @@
|
|||||||
assertions = [
|
assertions = [
|
||||||
{
|
{
|
||||||
assertion = (
|
assertion = (
|
||||||
config.hardware.intelgpu.driver != "xe"
|
cfg.driver != "xe" || lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.8"
|
||||||
|| lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.8"
|
|
||||||
);
|
);
|
||||||
message = "Intel Xe GPU driver is not supported on kernels earlier than 6.8. Update or use the i915 driver.";
|
message = "Intel Xe GPU driver is not supported on kernels earlier than 6.8. Update or use the i915 driver.";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
{
|
{
|
||||||
imports = [ ../. ];
|
imports = [ ../. ];
|
||||||
|
|
||||||
boot.kernelParams = [
|
boot.kernelParams = [ "i915.enable_guc=2" ];
|
||||||
"i915.enable_guc=2"
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
{
|
{
|
||||||
imports = [ ../. ];
|
imports = [ ../. ];
|
||||||
|
|
||||||
boot.kernelParams = [
|
boot.kernelParams = [ "i915.enable_guc=2" ];
|
||||||
"i915.enable_guc=2"
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,5 @@
|
|||||||
|
|
||||||
# Enables RC6, RC6p and RC6pp.
|
# Enables RC6, RC6p and RC6pp.
|
||||||
# Last two are only available on Sandy Bridge CPUs (circa 2011).
|
# Last two are only available on Sandy Bridge CPUs (circa 2011).
|
||||||
boot.kernelParams = [
|
boot.kernelParams = [ "i915.enable_rc6=7" ];
|
||||||
"i915.enable_rc6=7"
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user