From 68ef79e804710488c4ba158ad14a529b12a65279 Mon Sep 17 00:00:00 2001 From: Zach Coyle Date: Thu, 20 Jun 2024 17:15:06 -0400 Subject: [PATCH 1/4] apple/t2: update to kernel 6.9.4 --- apple/t2/pkgs/linux-t2.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apple/t2/pkgs/linux-t2.nix b/apple/t2/pkgs/linux-t2.nix index beff7a3..ea8fbdc 100644 --- a/apple/t2/pkgs/linux-t2.nix +++ b/apple/t2/pkgs/linux-t2.nix @@ -5,11 +5,11 @@ let patchRepo = fetchFromGitHub { owner = "t2linux"; repo = "linux-t2-patches"; - rev = "33d5a01c41f140a416a7f840cc06e7f30dc58d8d"; - hash = "sha256-wx5jkOQ8l/4XRGLV9KFrxXuqunwcFA9RB1yhrtseP2A="; + rev = "0ad2b3913f5484ba8e86b6965f5d88903464261d"; + hash = "sha256-mwT4cuIBrz3tz8+fAxVKmnRtkPRp3lWmNbocuXCsm44="; }; - version = "6.9.3"; + version = "6.9.4"; majorVersion = with lib; (elemAt (take 1 (splitVersion version)) 0); in buildLinux (args // { @@ -22,7 +22,7 @@ buildLinux (args // { src = runCommand "patched-source" {} '' cp -r ${fetchzip { url = "mirror://kernel/linux/kernel/v${majorVersion}.x/linux-${version}.tar.xz"; - hash = "sha256-7262WHO2veIn+9cd4m9io1ov93LsfpgRKfmvBx0DCBA="; + hash = "sha256-8jC5DpPi6poig1gmJPIIZ2HMwQQt1kTK4PcvyYm+Hsg="; }} $out chmod -R u+w $out cd $out From cc634b69c8312c4e88469d3c7e8fb5ecc72e7dc6 Mon Sep 17 00:00:00 2001 From: toastal Date: Fri, 21 Jun 2024 20:44:42 +0700 Subject: [PATCH 2/4] =?UTF-8?q?remove=20driSupport,=20opengl=20=E2=86=92?= =?UTF-8?q?=20graphics?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- acer/aspire/4810t/default.nix | 3 --- apple/macbook-pro/10-1/default.nix | 4 +++- apple/macmini/4/default.nix | 23 ++++++++++---------- asus/zephyrus/ga402x/amdgpu/default.nix | 2 +- asus/zephyrus/ga402x/nvidia/default.nix | 2 +- common/gpu/amd/default.nix | 6 ++--- common/gpu/intel/default.nix | 6 ++--- common/gpu/nvidia/default.nix | 2 +- dell/precision/7520/default.nix | 29 +++++++++++++------------ dell/xps/15-9510/nvidia/default.nix | 10 ++++----- focus/m2/gen1/default.nix | 5 ++--- gpd/pocket-3/default.nix | 2 +- lenovo/thinkpad/p1/3th-gen/nvidia.nix | 23 ++++++++++++-------- lenovo/thinkpad/p50/default.nix | 6 ----- lenovo/thinkpad/p51/default.nix | 11 +++++----- lenovo/thinkpad/p52/default.nix | 12 +++++----- lenovo/yoga/6/13ALC6/default.nix | 2 +- lenovo/yoga/7/14ARH7/amdgpu/default.nix | 2 +- lenovo/yoga/7/14ARH7/nvidia/default.nix | 2 +- system76/gaze18/default.nix | 5 ++--- 20 files changed, 77 insertions(+), 80 deletions(-) diff --git a/acer/aspire/4810t/default.nix b/acer/aspire/4810t/default.nix index d40b454..c0f95dc 100644 --- a/acer/aspire/4810t/default.nix +++ b/acer/aspire/4810t/default.nix @@ -19,9 +19,6 @@ ]; }; - # TODO: reverse compat - hardware.opengl.driSupport = false; - # TODO: reverse compat services.xserver = { defaultDepth = lib.mkDefault 24; diff --git a/apple/macbook-pro/10-1/default.nix b/apple/macbook-pro/10-1/default.nix index 3703096..f3f58c2 100644 --- a/apple/macbook-pro/10-1/default.nix +++ b/apple/macbook-pro/10-1/default.nix @@ -1,3 +1,5 @@ +{ lib, ... }: + { imports = [ ../. @@ -5,7 +7,7 @@ ]; # TODO: reverse compat - hardware.opengl.driSupport32Bit = true; + hardware.graphics.enable32Bit = lib.mkDefault true; services.xserver = { # TODO: we should not enable unfree drivers diff --git a/apple/macmini/4/default.nix b/apple/macmini/4/default.nix index fd3062d..86210c4 100644 --- a/apple/macmini/4/default.nix +++ b/apple/macmini/4/default.nix @@ -12,17 +12,18 @@ in services.xserver.videoDrivers = mkDefault [ "nvidiaLegacy340" ]; - hardware.opengl = { - enable = mkDefault true; - driSupport = mkDefault true; - driSupport32Bit = mkDefault true; - }; + hardware = { + graphics = { + enable = mkDefault true; + enable32Bit = mkDefault true; + }; - hardware.nvidia = { - modesetting.enable = mkDefault true; - powerManagement.enable = mkDefault false; - powerManagement.finegrained = mkDefault false; - open = mkDefault false; - nvidiaSettings = mkDefault true; + nvidia = { + modesetting.enable = mkDefault true; + powerManagement.enable = mkDefault false; + powerManagement.finegrained = mkDefault false; + open = mkDefault false; + nvidiaSettings = mkDefault true; + }; }; } diff --git a/asus/zephyrus/ga402x/amdgpu/default.nix b/asus/zephyrus/ga402x/amdgpu/default.nix index 17103c5..80a508f 100644 --- a/asus/zephyrus/ga402x/amdgpu/default.nix +++ b/asus/zephyrus/ga402x/amdgpu/default.nix @@ -26,7 +26,7 @@ in { hardware = { amdgpu.loadInInitrd = true; - opengl.extraPackages = with pkgs; [ + graphics.extraPackages = with pkgs; [ vaapiVdpau libvdpau-va-gl ]; diff --git a/asus/zephyrus/ga402x/nvidia/default.nix b/asus/zephyrus/ga402x/nvidia/default.nix index 7a1a8c3..73a2b9d 100644 --- a/asus/zephyrus/ga402x/nvidia/default.nix +++ b/asus/zephyrus/ga402x/nvidia/default.nix @@ -26,7 +26,7 @@ in { hardware = { ## Enable the Nvidia card, as well as Prime and Offload: amdgpu.loadInInitrd = true; - opengl.extraPackages = with pkgs; [ + graphics.extraPackages = with pkgs; [ # Also in nvidia/default.nix vaapiVdpau libvdpau-va-gl diff --git a/common/gpu/amd/default.nix b/common/gpu/amd/default.nix index 6987d6e..9228bc3 100644 --- a/common/gpu/amd/default.nix +++ b/common/gpu/amd/default.nix @@ -11,9 +11,9 @@ { services.xserver.videoDrivers = lib.mkDefault [ "modesetting" ]; - hardware.opengl = { - driSupport = lib.mkDefault true; - driSupport32Bit = lib.mkDefault true; + hardware.graphics = { + enable = lib.mkDefault true; + enable32Bit = lib.mkDefault true; }; } (lib.mkIf config.hardware.amdgpu.loadInInitrd { diff --git a/common/gpu/intel/default.nix b/common/gpu/intel/default.nix index 91c8765..90afad1 100644 --- a/common/gpu/intel/default.nix +++ b/common/gpu/intel/default.nix @@ -26,10 +26,10 @@ boot.initrd.kernelModules = [ config.hardware.intelgpu.driver ]; environment.variables = { - VDPAU_DRIVER = lib.mkIf config.hardware.opengl.enable (lib.mkDefault "va_gl"); + VDPAU_DRIVER = lib.mkIf config.hardware.graphics.enable (lib.mkDefault "va_gl"); }; - hardware.opengl.extraPackages = with pkgs; [ + hardware.graphics.extraPackages = with pkgs; [ ( if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then vaapiIntel @@ -40,7 +40,7 @@ intel-media-driver ]; - hardware.opengl.extraPackages32 = with pkgs.driversi686Linux; [ + hardware.graphics.extraPackages32 = with pkgs.driversi686Linux; [ ( if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then vaapiIntel diff --git a/common/gpu/nvidia/default.nix b/common/gpu/nvidia/default.nix index 47f2d34..43b4608 100644 --- a/common/gpu/nvidia/default.nix +++ b/common/gpu/nvidia/default.nix @@ -2,7 +2,7 @@ { services.xserver.videoDrivers = lib.mkDefault [ "nvidia" ]; - hardware.opengl.extraPackages = with pkgs; [ + hardware.graphics.extraPackages = with pkgs; [ vaapiVdpau ]; } diff --git a/dell/precision/7520/default.nix b/dell/precision/7520/default.nix index c20ea89..db5626f 100644 --- a/dell/precision/7520/default.nix +++ b/dell/precision/7520/default.nix @@ -21,25 +21,26 @@ }; boot.kernelParams = ["i915.modeset=1"]; - hardware.nvidia = { - package = config.boot.kernelPackages.nvidiaPackages.legacy_390; - nvidiaSettings = lib.mkDefault true; - modesetting.enable = lib.mkDefault true; - open = lib.mkDefault false; - prime = { - intelBusId = "PCI:0:2:0"; - nvidiaBusId = "PCI:1:0:0"; + hardware = { + graphics = { + enable = lib.mkDefault true; + enable32Bit = lib.mkDefault true; + }; + nvidia = { + package = config.boot.kernelPackages.nvidiaPackages.legacy_390; + nvidiaSettings = lib.mkDefault true; + modesetting.enable = lib.mkDefault true; + open = lib.mkDefault false; + prime = { + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:1:0:0"; + }; }; - }; - hardware.opengl = { - enable = lib.mkDefault true; - driSupport = lib.mkDefault true; - driSupport32Bit = lib.mkDefault true; }; # Override the intel gpu driver setting imported above environment.variables = { - VDPAU_DRIVER = lib.mkIf config.hardware.opengl.enable (lib.mkOverride 990 "nvidia"); + VDPAU_DRIVER = lib.mkIf config.hardware.graphics.enable (lib.mkOverride 990 "nvidia"); }; services.thermald.enable = lib.mkDefault true; diff --git a/dell/xps/15-9510/nvidia/default.nix b/dell/xps/15-9510/nvidia/default.nix index 723c574..990aea7 100644 --- a/dell/xps/15-9510/nvidia/default.nix +++ b/dell/xps/15-9510/nvidia/default.nix @@ -5,6 +5,11 @@ services.switcherooControl.enable = lib.mkDefault true; hardware = { + graphics = { + enable = lib.mkDefault true; + enable32Bit = lib.mkDefault true; + extraPackages = with pkgs; [ intel-media-driver intel-compute-runtime ]; + }; nvidia = { prime = { # Bus ID of the Intel GPU. @@ -20,10 +25,5 @@ finegrained = lib.mkDefault true; }; }; - opengl = { - enable = lib.mkDefault true; - driSupport32Bit = lib.mkDefault true; - extraPackages = with pkgs; [ intel-media-driver intel-compute-runtime ]; - }; }; } diff --git a/focus/m2/gen1/default.nix b/focus/m2/gen1/default.nix index 74e4df3..27ee1f3 100644 --- a/focus/m2/gen1/default.nix +++ b/focus/m2/gen1/default.nix @@ -18,10 +18,9 @@ boot.blacklistedKernelModules = [ "i2c_nvidia_gpu" ]; hardware.nvidia.modesetting.enable = lib.mkDefault true; - hardware.opengl = { + hardware.graphics = { enable = lib.mkDefault true; - driSupport = lib.mkDefault true; - driSupport32Bit = lib.mkDefault true; + enable32Bit = lib.mkDefault true; }; hardware.nvidia.prime = { diff --git a/gpd/pocket-3/default.nix b/gpd/pocket-3/default.nix index 52d0913..73d2bed 100644 --- a/gpd/pocket-3/default.nix +++ b/gpd/pocket-3/default.nix @@ -14,7 +14,7 @@ in # GPU is an Intel Iris Xe, on a “TigerLake” mobile CPU boot.initrd.kernelModules = [ "i915" ]; # Early loading so the passphrase prompt appears on external displays services.xserver.videoDrivers = [ "intel" ]; - hardware.opengl.extraPackages = with pkgs; [ + hardware.graphics.extraPackages = with pkgs; [ intel-media-driver (if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then vaapiIntel else intel-vaapi-driver) ]; diff --git a/lenovo/thinkpad/p1/3th-gen/nvidia.nix b/lenovo/thinkpad/p1/3th-gen/nvidia.nix index 0808107..6f939e9 100644 --- a/lenovo/thinkpad/p1/3th-gen/nvidia.nix +++ b/lenovo/thinkpad/p1/3th-gen/nvidia.nix @@ -1,13 +1,18 @@ { lib, ... }: { - hardware.nvidia.modesetting.enable = true; - hardware.opengl.driSupport32Bit = true; - hardware.opengl.enable = true; - - hardware.nvidia.prime = { - # Bus ID of the Intel GPU. - intelBusId = lib.mkDefault "PCI:0:2:0"; - # Bus ID of the NVIDIA GPU. - nvidiaBusId = lib.mkDefault "PCI:1:0:0"; + hardware = { + graphics = { + enable = lib.mkDefault true; + enable32Bit = lib.mkDefault true; + }; + nvidia = { + modesetting.enable = lib.mkDefault true; + prime = { + # Bus ID of the Intel GPU. + intelBusId = lib.mkDefault "PCI:0:2:0"; + # Bus ID of the NVIDIA GPU. + nvidiaBusId = lib.mkDefault "PCI:1:0:0"; + }; + }; }; } diff --git a/lenovo/thinkpad/p50/default.nix b/lenovo/thinkpad/p50/default.nix index 3e77eb5..ef2cbd5 100644 --- a/lenovo/thinkpad/p50/default.nix +++ b/lenovo/thinkpad/p50/default.nix @@ -13,12 +13,6 @@ nvidiaBusId = lib.mkDefault "PCI:1:0:0"; }; }; - - # is this too much? It's convenient for Steam. - opengl = { - driSupport = lib.mkDefault true; - driSupport32Bit = lib.mkDefault true; - }; }; # required to make wireless work diff --git a/lenovo/thinkpad/p51/default.nix b/lenovo/thinkpad/p51/default.nix index 4c9be3c..ca86455 100644 --- a/lenovo/thinkpad/p51/default.nix +++ b/lenovo/thinkpad/p51/default.nix @@ -8,18 +8,17 @@ ]; hardware = { + graphics = { + enable = lib.mkDefault true; + enable32Bit = lib.mkDefault true; + }; + nvidia = { prime = { intelBusId = lib.mkDefault "PCI:0:2:0"; nvidiaBusId = lib.mkDefault "PCI:1:0:0"; }; }; - - # is this too much? It's convenient for Steam. - opengl = { - driSupport = lib.mkDefault true; - driSupport32Bit = lib.mkDefault true; - }; }; # required to make wireless work diff --git a/lenovo/thinkpad/p52/default.nix b/lenovo/thinkpad/p52/default.nix index 31c9294..e768923 100644 --- a/lenovo/thinkpad/p52/default.nix +++ b/lenovo/thinkpad/p52/default.nix @@ -7,18 +7,18 @@ ]; hardware = { + # is this too much? It's convenient for Steam. + graphics = { + enable = lib.mkDefault true; + enable32Bit = lib.mkDefault true; + }; + nvidia = { prime = { intelBusId = lib.mkDefault "PCI:0:2:0"; nvidiaBusId = lib.mkDefault "PCI:1:0:0"; }; }; - - # is this too much? It's convenient for Steam. - opengl = { - driSupport = lib.mkDefault true; - driSupport32Bit = lib.mkDefault true; - }; }; # required to make wireless work diff --git a/lenovo/yoga/6/13ALC6/default.nix b/lenovo/yoga/6/13ALC6/default.nix index bd2e80c..1177bc7 100644 --- a/lenovo/yoga/6/13ALC6/default.nix +++ b/lenovo/yoga/6/13ALC6/default.nix @@ -7,7 +7,7 @@ ]; boot.initrd.kernelModules = [ "ideapad_laptop" ]; - hardware.opengl.extraPackages = with pkgs; [ + hardware.graphics.extraPackages = with pkgs; [ vaapiVdpau libvdpau-va-gl ]; diff --git a/lenovo/yoga/7/14ARH7/amdgpu/default.nix b/lenovo/yoga/7/14ARH7/amdgpu/default.nix index 4d16de0..6630911 100644 --- a/lenovo/yoga/7/14ARH7/amdgpu/default.nix +++ b/lenovo/yoga/7/14ARH7/amdgpu/default.nix @@ -15,7 +15,7 @@ in { hardware = { amdgpu.loadInInitrd = true; - opengl.extraPackages = with pkgs; [ + graphics.extraPackages = with pkgs; [ vaapiVdpau libvdpau-va-gl ]; diff --git a/lenovo/yoga/7/14ARH7/nvidia/default.nix b/lenovo/yoga/7/14ARH7/nvidia/default.nix index fb4553e..6c97a07 100644 --- a/lenovo/yoga/7/14ARH7/nvidia/default.nix +++ b/lenovo/yoga/7/14ARH7/nvidia/default.nix @@ -19,7 +19,7 @@ in { hardware = { ## Enable the Nvidia card, as well as Prime and Offload: amdgpu.loadInInitrd = true; - opengl.extraPackages = with pkgs; [ + graphics.extraPackages = with pkgs; [ vaapiVdpau libvdpau-va-gl ]; diff --git a/system76/gaze18/default.nix b/system76/gaze18/default.nix index 7b87f1a..0485e16 100644 --- a/system76/gaze18/default.nix +++ b/system76/gaze18/default.nix @@ -7,10 +7,9 @@ boot.initrd.kernelModules = [ "nvidia" ]; - hardware.opengl = { + hardware.graphics = { enable = lib.mkDefault true; - # adds ~100MB of 32-bit mesa drivers. - driSupport32Bit = lib.mkDefault true; + enable32Bit = lib.mkDefault true; }; hardware.nvidia = { From 584a5e551885382c1cf9b09a990fbcd2ccbc992f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 21 Jun 2024 23:26:44 +0200 Subject: [PATCH 3/4] fix 24.05 evaluation --- .github/workflows/test.yml | 5 +++- apple/macbook-pro/10-1/default.nix | 1 + apple/macmini/4/default.nix | 1 + asus/zephyrus/ga402x/amdgpu/default.nix | 1 + common/gpu/24.05-compat.nix | 37 +++++++++++++++++++++++++ common/gpu/amd/default.nix | 1 + common/gpu/intel/default.nix | 1 + common/gpu/nvidia/default.nix | 1 + dell/precision/7520/default.nix | 2 -- gpd/pocket-3/default.nix | 1 + lenovo/thinkpad/p1/3th-gen/nvidia.nix | 3 ++ lenovo/thinkpad/p51/default.nix | 1 + lenovo/thinkpad/p52/default.nix | 1 + lenovo/yoga/6/13ALC6/default.nix | 1 + lenovo/yoga/7/14ARH7/amdgpu/default.nix | 1 + tests/run.py | 2 +- 16 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 common/gpu/24.05-compat.nix diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 54a9c48..7c67a21 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,11 +7,14 @@ on: jobs: tests: runs-on: ubuntu-latest + strategy: + matrix: + channel: [ nixos-unstable, nixos-24.05 ] steps: - uses: actions/checkout@v4 - uses: cachix/install-nix-action@V27 with: - nix_path: nixpkgs=channel:nixos-unstable + nix_path: nixpkgs=channel:${{ matrix.channel }} - name: Show nixpkgs version run: nix-instantiate --eval -E '(import {}).lib.version' - run: ./tests/run.py diff --git a/apple/macbook-pro/10-1/default.nix b/apple/macbook-pro/10-1/default.nix index f3f58c2..2a2c624 100644 --- a/apple/macbook-pro/10-1/default.nix +++ b/apple/macbook-pro/10-1/default.nix @@ -4,6 +4,7 @@ imports = [ ../. ../../../common/pc/laptop/ssd + ../../../common/gpu/24.05-compat.nix ]; # TODO: reverse compat diff --git a/apple/macmini/4/default.nix b/apple/macmini/4/default.nix index 86210c4..fd6d9c9 100644 --- a/apple/macmini/4/default.nix +++ b/apple/macmini/4/default.nix @@ -8,6 +8,7 @@ in { imports = [ ../. + ../../../common/gpu/24.05-compat.nix ]; services.xserver.videoDrivers = mkDefault [ "nvidiaLegacy340" ]; diff --git a/asus/zephyrus/ga402x/amdgpu/default.nix b/asus/zephyrus/ga402x/amdgpu/default.nix index 80a508f..b1791d7 100644 --- a/asus/zephyrus/ga402x/amdgpu/default.nix +++ b/asus/zephyrus/ga402x/amdgpu/default.nix @@ -11,6 +11,7 @@ let in { imports = [ ../shared.nix + ../../../../common/gpu/24.05-compat.nix ]; options.hardware.asus.zephyrus.ga402x.amdgpu = { diff --git a/common/gpu/24.05-compat.nix b/common/gpu/24.05-compat.nix new file mode 100644 index 0000000..ca53247 --- /dev/null +++ b/common/gpu/24.05-compat.nix @@ -0,0 +1,37 @@ +{ + config, + lib, + ... +}: +{ + # Backward-compat for 24.05, can be removed after we drop 24.05 support + options = { + hardware.graphics = lib.optionalAttrs (lib.versionOlder lib.version "24.11pre") { + enable = lib.mkOption { + type = lib.types.bool; + default = false; + }; + enable32Bit = lib.mkOption { + type = lib.types.bool; + default = false; + }; + extraPackages = lib.mkOption { + type = lib.types.listOf lib.types.package; + default = []; + }; + extraPackages32 = lib.mkOption { + type = lib.types.listOf lib.types.package; + default = []; + }; + }; + }; + + config = { + hardware.opengl = lib.optionalAttrs (lib.versionOlder lib.version "24.11pre") { + enable = config.hardware.graphics.enable; + driSupport32Bit = config.hardware.graphics.enable32Bit; + extraPackages = config.hardware.graphics.extraPackages; + extraPackages32 = config.hardware.graphics.extraPackages32; + }; + }; +} diff --git a/common/gpu/amd/default.nix b/common/gpu/amd/default.nix index 9228bc3..f4bd7f1 100644 --- a/common/gpu/amd/default.nix +++ b/common/gpu/amd/default.nix @@ -7,6 +7,7 @@ default = true; }; + imports = [ ../24.05-compat.nix ]; config = lib.mkMerge [ { services.xserver.videoDrivers = lib.mkDefault [ "modesetting" ]; diff --git a/common/gpu/intel/default.nix b/common/gpu/intel/default.nix index 90afad1..b5c0dcd 100644 --- a/common/gpu/intel/default.nix +++ b/common/gpu/intel/default.nix @@ -5,6 +5,7 @@ ... }: { + imports = [ ../24.05-compat.nix ]; options.hardware.intelgpu.driver = lib.mkOption { description = "Intel GPU driver to use"; type = lib.types.enum [ diff --git a/common/gpu/nvidia/default.nix b/common/gpu/nvidia/default.nix index 43b4608..6141aaf 100644 --- a/common/gpu/nvidia/default.nix +++ b/common/gpu/nvidia/default.nix @@ -1,6 +1,7 @@ { lib, pkgs, ... }: { + imports = [ ../24.05-compat.nix ]; services.xserver.videoDrivers = lib.mkDefault [ "nvidia" ]; hardware.graphics.extraPackages = with pkgs; [ vaapiVdpau diff --git a/dell/precision/7520/default.nix b/dell/precision/7520/default.nix index db5626f..59fa95e 100644 --- a/dell/precision/7520/default.nix +++ b/dell/precision/7520/default.nix @@ -1,8 +1,6 @@ { config, lib, - pkgs, - inputs, ... }: { imports = [ diff --git a/gpd/pocket-3/default.nix b/gpd/pocket-3/default.nix index 73d2bed..1ed95eb 100644 --- a/gpd/pocket-3/default.nix +++ b/gpd/pocket-3/default.nix @@ -6,6 +6,7 @@ in ../../common/pc/laptop ../../common/pc/laptop/ssd ../../common/hidpi.nix + ../../common/gpu/24.05-compat.nix ]; # Necessary kernel modules diff --git a/lenovo/thinkpad/p1/3th-gen/nvidia.nix b/lenovo/thinkpad/p1/3th-gen/nvidia.nix index 6f939e9..ae19167 100644 --- a/lenovo/thinkpad/p1/3th-gen/nvidia.nix +++ b/lenovo/thinkpad/p1/3th-gen/nvidia.nix @@ -1,5 +1,8 @@ { lib, ... }: { + imports = [ + ../../../../common/gpu/24.05-compat.nix + ]; hardware = { graphics = { enable = lib.mkDefault true; diff --git a/lenovo/thinkpad/p51/default.nix b/lenovo/thinkpad/p51/default.nix index ca86455..9128970 100644 --- a/lenovo/thinkpad/p51/default.nix +++ b/lenovo/thinkpad/p51/default.nix @@ -1,5 +1,6 @@ { config, lib, ... }: { imports = [ + ../../../common/gpu/24.05-compat.nix ../../../common/gpu/nvidia/prime.nix ../../../common/cpu/intel ../../../common/cpu/intel/kaby-lake diff --git a/lenovo/thinkpad/p52/default.nix b/lenovo/thinkpad/p52/default.nix index e768923..2f6676a 100644 --- a/lenovo/thinkpad/p52/default.nix +++ b/lenovo/thinkpad/p52/default.nix @@ -1,5 +1,6 @@ { lib, config, ... }: { imports = [ + ../../../common/gpu/24.05-compat.nix ../../../common/gpu/nvidia/prime.nix ../../../common/cpu/intel ../../../common/pc/laptop/acpi_call.nix diff --git a/lenovo/yoga/6/13ALC6/default.nix b/lenovo/yoga/6/13ALC6/default.nix index 1177bc7..78784c7 100644 --- a/lenovo/yoga/6/13ALC6/default.nix +++ b/lenovo/yoga/6/13ALC6/default.nix @@ -4,6 +4,7 @@ imports = [ ../../../thinkpad/yoga.nix ../../../../common/gpu/amd/default.nix + ../../../../common/gpu/24.05-compat.nix ]; boot.initrd.kernelModules = [ "ideapad_laptop" ]; diff --git a/lenovo/yoga/7/14ARH7/amdgpu/default.nix b/lenovo/yoga/7/14ARH7/amdgpu/default.nix index 6630911..454a914 100644 --- a/lenovo/yoga/7/14ARH7/amdgpu/default.nix +++ b/lenovo/yoga/7/14ARH7/amdgpu/default.nix @@ -8,6 +8,7 @@ let in { imports = [ ../shared.nix + ../../../../../common/gpu/24.05-compat.nix ]; # AMD RX680 diff --git a/tests/run.py b/tests/run.py index 07a86c0..ec8d8ce 100755 --- a/tests/run.py +++ b/tests/run.py @@ -81,7 +81,7 @@ def write_eval_test(f: IO[str], profiles: list[str]) -> None: continue system = "x86_64-linux" - if "raspberry-pi/4" == profile or "raspberry-pi/5" == profile: + if profile in ("raspberry-pi/4", "raspberry-pi/5"): system = "aarch64-linux" f.write( From 4e59e4c9e9fed47dc0517041eac0deb16711d9b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sat, 22 Jun 2024 08:42:43 +0200 Subject: [PATCH 4/4] common/gpu/24.05-compat: don't create conflicts with user configuration fixes https://github.com/NixOS/nixos-hardware/issues/1000 --- common/gpu/24.05-compat.nix | 36 ++++++------------------------------ 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/common/gpu/24.05-compat.nix b/common/gpu/24.05-compat.nix index ca53247..3e3495f 100644 --- a/common/gpu/24.05-compat.nix +++ b/common/gpu/24.05-compat.nix @@ -1,37 +1,13 @@ { - config, lib, ... }: { # Backward-compat for 24.05, can be removed after we drop 24.05 support - options = { - hardware.graphics = lib.optionalAttrs (lib.versionOlder lib.version "24.11pre") { - enable = lib.mkOption { - type = lib.types.bool; - default = false; - }; - enable32Bit = lib.mkOption { - type = lib.types.bool; - default = false; - }; - extraPackages = lib.mkOption { - type = lib.types.listOf lib.types.package; - default = []; - }; - extraPackages32 = lib.mkOption { - type = lib.types.listOf lib.types.package; - default = []; - }; - }; - }; - - config = { - hardware.opengl = lib.optionalAttrs (lib.versionOlder lib.version "24.11pre") { - enable = config.hardware.graphics.enable; - driSupport32Bit = config.hardware.graphics.enable32Bit; - extraPackages = config.hardware.graphics.extraPackages; - extraPackages32 = config.hardware.graphics.extraPackages32; - }; - }; + imports = lib.optionals (lib.versionOlder lib.version "24.11pre") [ + (lib.mkAliasOptionModule [ "hardware" "graphics" "enable" ] [ "hardware" "opengl" "enable" ]) + (lib.mkAliasOptionModule [ "hardware" "graphics" "extraPackages" ] [ "hardware" "opengl" "extraPackages" ]) + (lib.mkAliasOptionModule [ "hardware" "graphics" "extraPackages32" ] [ "hardware" "opengl" "extraPackages32" ]) + (lib.mkAliasOptionModule [ "hardware" "graphics" "enable32Bit" ] [ "hardware" "opengl" "driSupport32Bit" ]) + ]; }