From 9c0ce6e9826e80d3ab708c377b0a879ab8d5cd11 Mon Sep 17 00:00:00 2001 From: Youser Nayme <7685106-NeuralModder@users.noreply.gitlab.com> Date: Fri, 13 Nov 2026 12:40:36 +0000 Subject: [PATCH 1/3] intel-media-driver{,-free}: allow disabling unfree code, fix license As can be read in the upstream README (https://github.com/intel/media-driver#build-options), nonfree kernels are enabled by default. This makes it an option for the nix package, also enabled by default. We could also consider adding BUILD_KERNELS=ON to actually build these free kernels. (cherry picked from commit eee88faf27bf4621627ecfc77cc732649fa34372) --- pkgs/by-name/in/intel-media-driver/package.nix | 14 ++++++++++---- pkgs/top-level/all-packages.nix | 4 ++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/in/intel-media-driver/package.nix b/pkgs/by-name/in/intel-media-driver/package.nix index 9af214ca6476..c3ce1aabaa3f 100644 --- a/pkgs/by-name/in/intel-media-driver/package.nix +++ b/pkgs/by-name/in/intel-media-driver/package.nix @@ -9,6 +9,7 @@ libpciaccess, intel-gmmlib, libdrm, + enableUnfree ? true, enableX11 ? stdenv.hostPlatform.isLinux, libx11, nix-update-script, @@ -46,6 +47,7 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ "-DINSTALL_DRIVER_SYSCONF=OFF" "-DLIBVA_DRIVERS_PATH=${placeholder "out"}/lib/dri" + (lib.cmakeBool "ENABLE_NONFREE_KERNELS" enableUnfree) # Works only on hosts with suitable CPUs. "-DMEDIA_RUN_TEST_SUITE=OFF" "-DMEDIA_BUILD_FATAL_WARNINGS=OFF" @@ -93,10 +95,14 @@ stdenv.mkDerivation (finalAttrs: { ''; homepage = "https://github.com/intel/media-driver"; changelog = "https://github.com/intel/media-driver/releases/tag/intel-media-${finalAttrs.version}"; - license = with lib.licenses; [ - bsd3 - mit - ]; + license = + with lib.licenses; + [ + bsd3 + mit + ] + # See upstream README on unfree components; we use this license to keep things working + ++ lib.optionals enableUnfree [ unfreeRedistributableFirmware ]; platforms = lib.platforms.linux; maintainers = with lib.maintainers; [ SuperSandro2000 ]; }; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 20fb45424cf4..acdbc7fd4333 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5425,6 +5425,10 @@ with pkgs; callPackages ../development/libraries/science/astronomy/indilib/indi-3rdparty.nix { } ); + intel-media-driver-free = intel-media-driver.override { + enableUnfree = false; + }; + ios-cross-compile = callPackage ../development/compilers/ios-cross-compile/9.2.nix { }; iso-flags-png-320x240 = iso-flags.overrideAttrs (oldAttrs: { From 245e370ff0ec31684eebd5b8a53e852d41a19766 Mon Sep 17 00:00:00 2001 From: Youser Nayme <7685106-NeuralModder@users.noreply.gitlab.com> Date: Fri, 13 Nov 2026 13:24:08 +0000 Subject: [PATCH 2/3] intel-media-driver{,-free}: enable `strictDeps` and `__structuredAttrs` (cherry picked from commit a86518ea1f448dd3109577fbb6609a8a8ae662f2) --- pkgs/by-name/in/intel-media-driver/package.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/by-name/in/intel-media-driver/package.nix b/pkgs/by-name/in/intel-media-driver/package.nix index c3ce1aabaa3f..3b43f51b34c2 100644 --- a/pkgs/by-name/in/intel-media-driver/package.nix +++ b/pkgs/by-name/in/intel-media-driver/package.nix @@ -21,6 +21,9 @@ stdenv.mkDerivation (finalAttrs: { pname = "intel-media-driver"; version = "26.3.5"; + __structuredAttrs = true; + strictDeps = true; + outputs = [ "out" "dev" From 7db791c274a9ac088af0bd928445dc2b1b854cfe Mon Sep 17 00:00:00 2001 From: Youser Nayme <7685106-NeuralModder@users.noreply.gitlab.com> Date: Fri, 13 Nov 2026 20:46:10 +0000 Subject: [PATCH 3/3] nixos/doc: document `intel-media-driver-free` and its considerations (cherry picked from commit 0de1c21f454fdb556333ba1ba2cc49ae4cb84b2a) --- .../manual/configuration/gpu-accel.chapter.md | 14 ++++++++++++++ nixos/modules/hardware/graphics.nix | 18 ++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/nixos/doc/manual/configuration/gpu-accel.chapter.md b/nixos/doc/manual/configuration/gpu-accel.chapter.md index 0046337320a5..2298494bcc90 100644 --- a/nixos/doc/manual/configuration/gpu-accel.chapter.md +++ b/nixos/doc/manual/configuration/gpu-accel.chapter.md @@ -146,6 +146,20 @@ Modern Intel GPUs use the iHD driver, which can be installed with: { hardware.graphics.extraPackages = [ intel-media-driver ]; } ``` +Note that this package includes nonfree render kernels by default. If you +prefer, and you're willing to forgo any extra functionality provided by these +render kernels for your hardware, you can install the version with only free +software render kernels. Consult [the upstream +README](https://github.com/intel/media-driver#components-and-features) for +more information on which feature/hardware combinations require unfree render +kernels. + +The free version of the iHD driver can be installed with: + +```nix +{ hardware.graphics.extraPackages = [ intel-media-driver-free ]; } +``` + Older Intel GPUs use the i965 driver, which can be installed with: ```nix diff --git a/nixos/modules/hardware/graphics.nix b/nixos/modules/hardware/graphics.nix index 627cf19333bf..29437db0aff1 100644 --- a/nixos/modules/hardware/graphics.nix +++ b/nixos/modules/hardware/graphics.nix @@ -97,6 +97,15 @@ in ::: {.note} intel-media-driver supports hardware Broadwell (2014) or newer. Older hardware should use the mostly unmaintained intel-vaapi-driver driver. ::: + ::: {.note} + intel-media-driver includes nonfree render kernels by default. If you + prefer, and you're willing to forgo any extra functionality provided by these + render kernels for your hardware, you can install the version with only free + software render kernels, intel-media-driver-free. Consult [the upstream + README](https://github.com/intel/media-driver#components-and-features) for + more information on which feature/hardware combinations require unfree render + kernels. + ::: ''; type = lib.types.listOf lib.types.package; default = [ ]; @@ -111,6 +120,15 @@ in ::: {.note} intel-media-driver supports hardware Broadwell (2014) or newer. Older hardware should use the mostly unmaintained intel-vaapi-driver driver. ::: + ::: {.note} + intel-media-driver includes nonfree render kernels by default. If you + prefer, and you're willing to forgo any extra functionality provided by these + render kernels for your hardware, you can install the version with only free + software render kernels, intel-media-driver-free. Consult [the upstream + README](https://github.com/intel/media-driver#components-and-features) for + more information on which feature/hardware combinations require unfree render + kernels. + ::: ''; type = lib.types.listOf lib.types.package; default = [ ];