1
0
Fork 0
mirror of https://github.com/NixOS/nixos-hardware synced 2024-11-30 06:49:43 +01:00

Merge branch 'NixOS:master' into iptsd

This commit is contained in:
Flameopathic 2024-06-22 13:03:32 -04:00 committed by GitHub
commit 5159ef2fa0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 113 additions and 88 deletions

View file

@ -7,11 +7,14 @@ on:
jobs: jobs:
tests: tests:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
matrix:
channel: [ nixos-unstable, nixos-24.05 ]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: cachix/install-nix-action@V27 - uses: cachix/install-nix-action@V27
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:${{ matrix.channel }}
- name: Show nixpkgs version - name: Show nixpkgs version
run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version' run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
- run: ./tests/run.py - run: ./tests/run.py

View file

@ -19,9 +19,6 @@
]; ];
}; };
# TODO: reverse compat
hardware.opengl.driSupport = false;
# TODO: reverse compat # TODO: reverse compat
services.xserver = { services.xserver = {
defaultDepth = lib.mkDefault 24; defaultDepth = lib.mkDefault 24;

View file

@ -1,11 +1,14 @@
{ lib, ... }:
{ {
imports = [ imports = [
../. ../.
../../../common/pc/laptop/ssd ../../../common/pc/laptop/ssd
../../../common/gpu/24.05-compat.nix
]; ];
# TODO: reverse compat # TODO: reverse compat
hardware.opengl.driSupport32Bit = true; hardware.graphics.enable32Bit = lib.mkDefault true;
services.xserver = { services.xserver = {
# TODO: we should not enable unfree drivers # TODO: we should not enable unfree drivers

View file

@ -8,21 +8,23 @@ in
{ {
imports = [ imports = [
../. ../.
../../../common/gpu/24.05-compat.nix
]; ];
services.xserver.videoDrivers = mkDefault [ "nvidiaLegacy340" ]; services.xserver.videoDrivers = mkDefault [ "nvidiaLegacy340" ];
hardware.opengl = { hardware = {
graphics = {
enable = mkDefault true; enable = mkDefault true;
driSupport = mkDefault true; enable32Bit = mkDefault true;
driSupport32Bit = mkDefault true;
}; };
hardware.nvidia = { nvidia = {
modesetting.enable = mkDefault true; modesetting.enable = mkDefault true;
powerManagement.enable = mkDefault false; powerManagement.enable = mkDefault false;
powerManagement.finegrained = mkDefault false; powerManagement.finegrained = mkDefault false;
open = mkDefault false; open = mkDefault false;
nvidiaSettings = mkDefault true; nvidiaSettings = mkDefault true;
}; };
};
} }

View file

@ -5,11 +5,11 @@ let
patchRepo = fetchFromGitHub { patchRepo = fetchFromGitHub {
owner = "t2linux"; owner = "t2linux";
repo = "linux-t2-patches"; repo = "linux-t2-patches";
rev = "33d5a01c41f140a416a7f840cc06e7f30dc58d8d"; rev = "0ad2b3913f5484ba8e86b6965f5d88903464261d";
hash = "sha256-wx5jkOQ8l/4XRGLV9KFrxXuqunwcFA9RB1yhrtseP2A="; hash = "sha256-mwT4cuIBrz3tz8+fAxVKmnRtkPRp3lWmNbocuXCsm44=";
}; };
version = "6.9.3"; version = "6.9.4";
majorVersion = with lib; (elemAt (take 1 (splitVersion version)) 0); majorVersion = with lib; (elemAt (take 1 (splitVersion version)) 0);
in in
buildLinux (args // { buildLinux (args // {
@ -22,7 +22,7 @@ buildLinux (args // {
src = runCommand "patched-source" {} '' src = runCommand "patched-source" {} ''
cp -r ${fetchzip { cp -r ${fetchzip {
url = "mirror://kernel/linux/kernel/v${majorVersion}.x/linux-${version}.tar.xz"; url = "mirror://kernel/linux/kernel/v${majorVersion}.x/linux-${version}.tar.xz";
hash = "sha256-7262WHO2veIn+9cd4m9io1ov93LsfpgRKfmvBx0DCBA="; hash = "sha256-8jC5DpPi6poig1gmJPIIZ2HMwQQt1kTK4PcvyYm+Hsg=";
}} $out }} $out
chmod -R u+w $out chmod -R u+w $out
cd $out cd $out

View file

@ -11,6 +11,7 @@ let
in { in {
imports = [ imports = [
../shared.nix ../shared.nix
../../../../common/gpu/24.05-compat.nix
]; ];
options.hardware.asus.zephyrus.ga402x.amdgpu = { options.hardware.asus.zephyrus.ga402x.amdgpu = {
@ -26,7 +27,7 @@ in {
hardware = { hardware = {
amdgpu.loadInInitrd = true; amdgpu.loadInInitrd = true;
opengl.extraPackages = with pkgs; [ graphics.extraPackages = with pkgs; [
vaapiVdpau vaapiVdpau
libvdpau-va-gl libvdpau-va-gl
]; ];

View file

@ -26,7 +26,7 @@ in {
hardware = { hardware = {
## Enable the Nvidia card, as well as Prime and Offload: ## Enable the Nvidia card, as well as Prime and Offload:
amdgpu.loadInInitrd = true; amdgpu.loadInInitrd = true;
opengl.extraPackages = with pkgs; [ graphics.extraPackages = with pkgs; [
# Also in nvidia/default.nix # Also in nvidia/default.nix
vaapiVdpau vaapiVdpau
libvdpau-va-gl libvdpau-va-gl

View file

@ -0,0 +1,13 @@
{
lib,
...
}:
{
# Backward-compat for 24.05, can be removed after we drop 24.05 support
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" ])
];
}

View file

@ -7,13 +7,14 @@
default = true; default = true;
}; };
imports = [ ../24.05-compat.nix ];
config = lib.mkMerge [ config = lib.mkMerge [
{ {
services.xserver.videoDrivers = lib.mkDefault [ "modesetting" ]; services.xserver.videoDrivers = lib.mkDefault [ "modesetting" ];
hardware.opengl = { hardware.graphics = {
driSupport = lib.mkDefault true; enable = lib.mkDefault true;
driSupport32Bit = lib.mkDefault true; enable32Bit = lib.mkDefault true;
}; };
} }
(lib.mkIf config.hardware.amdgpu.loadInInitrd { (lib.mkIf config.hardware.amdgpu.loadInInitrd {

View file

@ -5,6 +5,7 @@
... ...
}: }:
{ {
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 [
@ -26,10 +27,10 @@
boot.initrd.kernelModules = [ config.hardware.intelgpu.driver ]; boot.initrd.kernelModules = [ config.hardware.intelgpu.driver ];
environment.variables = { 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 if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then
vaapiIntel vaapiIntel
@ -40,7 +41,7 @@
intel-media-driver 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 if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then
vaapiIntel vaapiIntel

View file

@ -1,8 +1,9 @@
{ lib, pkgs, ... }: { lib, pkgs, ... }:
{ {
imports = [ ../24.05-compat.nix ];
services.xserver.videoDrivers = lib.mkDefault [ "nvidia" ]; services.xserver.videoDrivers = lib.mkDefault [ "nvidia" ];
hardware.opengl.extraPackages = with pkgs; [ hardware.graphics.extraPackages = with pkgs; [
vaapiVdpau vaapiVdpau
]; ];
} }

View file

@ -1,8 +1,6 @@
{ {
config, config,
lib, lib,
pkgs,
inputs,
... ...
}: { }: {
imports = [ imports = [
@ -21,7 +19,12 @@
}; };
boot.kernelParams = ["i915.modeset=1"]; boot.kernelParams = ["i915.modeset=1"];
hardware.nvidia = { hardware = {
graphics = {
enable = lib.mkDefault true;
enable32Bit = lib.mkDefault true;
};
nvidia = {
package = config.boot.kernelPackages.nvidiaPackages.legacy_390; package = config.boot.kernelPackages.nvidiaPackages.legacy_390;
nvidiaSettings = lib.mkDefault true; nvidiaSettings = lib.mkDefault true;
modesetting.enable = lib.mkDefault true; modesetting.enable = lib.mkDefault true;
@ -31,15 +34,11 @@
nvidiaBusId = "PCI:1:0: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 # Override the intel gpu driver setting imported above
environment.variables = { 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; services.thermald.enable = lib.mkDefault true;

View file

@ -5,6 +5,11 @@
services.switcherooControl.enable = lib.mkDefault true; services.switcherooControl.enable = lib.mkDefault true;
hardware = { hardware = {
graphics = {
enable = lib.mkDefault true;
enable32Bit = lib.mkDefault true;
extraPackages = with pkgs; [ intel-media-driver intel-compute-runtime ];
};
nvidia = { nvidia = {
prime = { prime = {
# Bus ID of the Intel GPU. # Bus ID of the Intel GPU.
@ -20,10 +25,5 @@
finegrained = lib.mkDefault true; finegrained = lib.mkDefault true;
}; };
}; };
opengl = {
enable = lib.mkDefault true;
driSupport32Bit = lib.mkDefault true;
extraPackages = with pkgs; [ intel-media-driver intel-compute-runtime ];
};
}; };
} }

View file

@ -18,10 +18,9 @@
boot.blacklistedKernelModules = [ "i2c_nvidia_gpu" ]; boot.blacklistedKernelModules = [ "i2c_nvidia_gpu" ];
hardware.nvidia.modesetting.enable = lib.mkDefault true; hardware.nvidia.modesetting.enable = lib.mkDefault true;
hardware.opengl = { hardware.graphics = {
enable = lib.mkDefault true; enable = lib.mkDefault true;
driSupport = lib.mkDefault true; enable32Bit = lib.mkDefault true;
driSupport32Bit = lib.mkDefault true;
}; };
hardware.nvidia.prime = { hardware.nvidia.prime = {

View file

@ -6,6 +6,7 @@ in
../../common/pc/laptop ../../common/pc/laptop
../../common/pc/laptop/ssd ../../common/pc/laptop/ssd
../../common/hidpi.nix ../../common/hidpi.nix
../../common/gpu/24.05-compat.nix
]; ];
# Necessary kernel modules # Necessary kernel modules
@ -14,7 +15,7 @@ in
# GPU is an Intel Iris Xe, on a “TigerLake” mobile CPU # 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 boot.initrd.kernelModules = [ "i915" ]; # Early loading so the passphrase prompt appears on external displays
services.xserver.videoDrivers = [ "intel" ]; services.xserver.videoDrivers = [ "intel" ];
hardware.opengl.extraPackages = with pkgs; [ hardware.graphics.extraPackages = with pkgs; [
intel-media-driver intel-media-driver
(if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then vaapiIntel else intel-vaapi-driver) (if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then vaapiIntel else intel-vaapi-driver)
]; ];

View file

@ -1,13 +1,21 @@
{ lib, ... }: { lib, ... }:
{ {
hardware.nvidia.modesetting.enable = true; imports = [
hardware.opengl.driSupport32Bit = true; ../../../../common/gpu/24.05-compat.nix
hardware.opengl.enable = true; ];
hardware = {
hardware.nvidia.prime = { graphics = {
enable = lib.mkDefault true;
enable32Bit = lib.mkDefault true;
};
nvidia = {
modesetting.enable = lib.mkDefault true;
prime = {
# Bus ID of the Intel GPU. # Bus ID of the Intel GPU.
intelBusId = lib.mkDefault "PCI:0:2:0"; intelBusId = lib.mkDefault "PCI:0:2:0";
# Bus ID of the NVIDIA GPU. # Bus ID of the NVIDIA GPU.
nvidiaBusId = lib.mkDefault "PCI:1:0:0"; nvidiaBusId = lib.mkDefault "PCI:1:0:0";
}; };
};
};
} }

View file

@ -13,12 +13,6 @@
nvidiaBusId = lib.mkDefault "PCI:1:0: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 # required to make wireless work

View file

@ -1,5 +1,6 @@
{ config, lib, ... }: { { config, lib, ... }: {
imports = [ imports = [
../../../common/gpu/24.05-compat.nix
../../../common/gpu/nvidia/prime.nix ../../../common/gpu/nvidia/prime.nix
../../../common/cpu/intel ../../../common/cpu/intel
../../../common/cpu/intel/kaby-lake ../../../common/cpu/intel/kaby-lake
@ -8,18 +9,17 @@
]; ];
hardware = { hardware = {
graphics = {
enable = lib.mkDefault true;
enable32Bit = lib.mkDefault true;
};
nvidia = { nvidia = {
prime = { prime = {
intelBusId = lib.mkDefault "PCI:0:2:0"; intelBusId = lib.mkDefault "PCI:0:2:0";
nvidiaBusId = lib.mkDefault "PCI:1:0: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 # required to make wireless work

View file

@ -1,5 +1,6 @@
{ lib, config, ... }: { { lib, config, ... }: {
imports = [ imports = [
../../../common/gpu/24.05-compat.nix
../../../common/gpu/nvidia/prime.nix ../../../common/gpu/nvidia/prime.nix
../../../common/cpu/intel ../../../common/cpu/intel
../../../common/pc/laptop/acpi_call.nix ../../../common/pc/laptop/acpi_call.nix
@ -7,18 +8,18 @@
]; ];
hardware = { hardware = {
# is this too much? It's convenient for Steam.
graphics = {
enable = lib.mkDefault true;
enable32Bit = lib.mkDefault true;
};
nvidia = { nvidia = {
prime = { prime = {
intelBusId = lib.mkDefault "PCI:0:2:0"; intelBusId = lib.mkDefault "PCI:0:2:0";
nvidiaBusId = lib.mkDefault "PCI:1:0: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 # required to make wireless work

View file

@ -4,10 +4,11 @@
imports = [ imports = [
../../../thinkpad/yoga.nix ../../../thinkpad/yoga.nix
../../../../common/gpu/amd/default.nix ../../../../common/gpu/amd/default.nix
../../../../common/gpu/24.05-compat.nix
]; ];
boot.initrd.kernelModules = [ "ideapad_laptop" ]; boot.initrd.kernelModules = [ "ideapad_laptop" ];
hardware.opengl.extraPackages = with pkgs; [ hardware.graphics.extraPackages = with pkgs; [
vaapiVdpau vaapiVdpau
libvdpau-va-gl libvdpau-va-gl
]; ];

View file

@ -8,6 +8,7 @@ let
in { in {
imports = [ imports = [
../shared.nix ../shared.nix
../../../../../common/gpu/24.05-compat.nix
]; ];
# AMD RX680 # AMD RX680
@ -15,7 +16,7 @@ in {
hardware = { hardware = {
amdgpu.loadInInitrd = true; amdgpu.loadInInitrd = true;
opengl.extraPackages = with pkgs; [ graphics.extraPackages = with pkgs; [
vaapiVdpau vaapiVdpau
libvdpau-va-gl libvdpau-va-gl
]; ];

View file

@ -19,7 +19,7 @@ in {
hardware = { hardware = {
## Enable the Nvidia card, as well as Prime and Offload: ## Enable the Nvidia card, as well as Prime and Offload:
amdgpu.loadInInitrd = true; amdgpu.loadInInitrd = true;
opengl.extraPackages = with pkgs; [ graphics.extraPackages = with pkgs; [
vaapiVdpau vaapiVdpau
libvdpau-va-gl libvdpau-va-gl
]; ];

View file

@ -7,10 +7,9 @@
boot.initrd.kernelModules = [ "nvidia" ]; boot.initrd.kernelModules = [ "nvidia" ];
hardware.opengl = { hardware.graphics = {
enable = lib.mkDefault true; enable = lib.mkDefault true;
# adds ~100MB of 32-bit mesa drivers. enable32Bit = lib.mkDefault true;
driSupport32Bit = lib.mkDefault true;
}; };
hardware.nvidia = { hardware.nvidia = {

View file

@ -81,7 +81,7 @@ def write_eval_test(f: IO[str], profiles: list[str]) -> None:
continue continue
system = "x86_64-linux" 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" system = "aarch64-linux"
f.write( f.write(