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] 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" ]) + ]; }