1
0
Fork 0
mirror of https://github.com/NixOS/nixos-hardware synced 2024-11-26 21:09:42 +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:
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 <nixpkgs> {}).lib.version'
- run: ./tests/run.py

View file

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

View file

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

View file

@ -8,21 +8,23 @@ in
{
imports = [
../.
../../../common/gpu/24.05-compat.nix
];
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;
};
};
}

View file

@ -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

View file

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

View file

@ -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

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;
};
imports = [ ../24.05-compat.nix ];
config = lib.mkMerge [
{
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 {

View file

@ -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 [
@ -26,10 +27,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 +41,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

View file

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

View file

@ -1,8 +1,6 @@
{
config,
lib,
pkgs,
inputs,
...
}: {
imports = [
@ -21,25 +19,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;

View file

@ -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 ];
};
};
}

View file

@ -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 = {

View file

@ -6,6 +6,7 @@ in
../../common/pc/laptop
../../common/pc/laptop/ssd
../../common/hidpi.nix
../../common/gpu/24.05-compat.nix
];
# Necessary kernel modules
@ -14,7 +15,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)
];

View file

@ -1,13 +1,21 @@
{ 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";
imports = [
../../../../common/gpu/24.05-compat.nix
];
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";
};
};
};
}

View file

@ -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

View file

@ -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
@ -8,18 +9,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

View file

@ -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
@ -7,18 +8,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

View file

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

View file

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

View file

@ -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
];

View file

@ -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 = {

View file

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