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] 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(