mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2025-11-08 11:36:10 +01:00
chore: format repo using treefmt-nix and nixfmt-rfc-style
This commit is contained in:
parent
fc7c471412
commit
51e51e6014
266 changed files with 3721 additions and 2733 deletions
|
|
@ -10,10 +10,12 @@
|
|||
# remove all packages for amd igpu. I only removed amdgpu from
|
||||
# services.xserver.videoDrivers by overriding. This is because the specialization
|
||||
# of nix cannot implement such an operation as canceling an import.
|
||||
hardware = {
|
||||
nvidia.prime.offload.enable = false;
|
||||
} // lib.optionalAttrs (options ? amdgpu.opencl.enable) {
|
||||
# introduced in https://github.com/NixOS/nixpkgs/pull/319865
|
||||
amdgpu.opencl.enable = lib.mkDefault false;
|
||||
};
|
||||
hardware =
|
||||
{
|
||||
nvidia.prime.offload.enable = false;
|
||||
}
|
||||
// lib.optionalAttrs (options ? amdgpu.opencl.enable) {
|
||||
# introduced in https://github.com/NixOS/nixpkgs/pull/319865
|
||||
amdgpu.opencl.enable = lib.mkDefault false;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,10 +10,12 @@
|
|||
# remove all packages for amd igpu. I only removed amdgpu from
|
||||
# services.xserver.videoDrivers by overriding. This is because the specialization
|
||||
# of nix cannot implement such an operation as canceling an import.
|
||||
hardware = {
|
||||
nvidia.prime.offload.enable = false;
|
||||
} // lib.optionalAttrs (options ? amdgpu.opencl.enable) {
|
||||
# introduced in https://github.com/NixOS/nixpkgs/pull/319865
|
||||
amdgpu.opencl.enable = lib.mkDefault false;
|
||||
};
|
||||
hardware =
|
||||
{
|
||||
nvidia.prime.offload.enable = false;
|
||||
}
|
||||
// lib.optionalAttrs (options ? amdgpu.opencl.enable) {
|
||||
# introduced in https://github.com/NixOS/nixpkgs/pull/319865
|
||||
amdgpu.opencl.enable = lib.mkDefault false;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,12 @@
|
|||
{
|
||||
imports = [ ../hybrid ];
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
hardware = {
|
||||
nvidia.prime.offload.enable = false;
|
||||
} // lib.optionalAttrs (options ? amdgpu.opencl.enable) {
|
||||
# introduced in https://github.com/NixOS/nixpkgs/pull/319865
|
||||
amdgpu.opencl.enable = lib.mkDefault false;
|
||||
};
|
||||
hardware =
|
||||
{
|
||||
nvidia.prime.offload.enable = false;
|
||||
}
|
||||
// lib.optionalAttrs (options ? amdgpu.opencl.enable) {
|
||||
# introduced in https://github.com/NixOS/nixpkgs/pull/319865
|
||||
amdgpu.opencl.enable = lib.mkDefault false;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,20 +14,20 @@
|
|||
boot = lib.mkMerge [
|
||||
(lib.mkIf (lib.versionOlder pkgs.linux.version "6.6") {
|
||||
kernelPackages = pkgs.linuxPackages_latest;
|
||||
kernelParams = ["amdgpu.sg_display=0"];
|
||||
kernelParams = [ "amdgpu.sg_display=0" ];
|
||||
})
|
||||
];
|
||||
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = lib.mkDefault true;
|
||||
powerManagement.enable = lib.mkDefault false;
|
||||
powerManagement.finegrained = lib.mkDefault false;
|
||||
open = lib.mkDefault false;
|
||||
prime = {
|
||||
sync.enable = lib.mkDefault true;
|
||||
amdgpuBusId = "PCI:5:0:0";
|
||||
nvidiaBusId = "PCI:1:0:0";
|
||||
};
|
||||
modesetting.enable = lib.mkDefault true;
|
||||
powerManagement.enable = lib.mkDefault false;
|
||||
powerManagement.finegrained = lib.mkDefault false;
|
||||
open = lib.mkDefault false;
|
||||
prime = {
|
||||
sync.enable = lib.mkDefault true;
|
||||
amdgpuBusId = "PCI:5:0:0";
|
||||
nvidiaBusId = "PCI:1:0:0";
|
||||
};
|
||||
};
|
||||
|
||||
# Avoid issues with modesetting causing blank screen
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
../../../../common/cpu/amd
|
||||
../../../../common/cpu/amd/pstate.nix
|
||||
|
|
@ -12,8 +13,8 @@
|
|||
../../../../common/pc/ssd
|
||||
];
|
||||
|
||||
boot.kernelModules = ["amdgpu"];
|
||||
services.xserver.videoDrivers = ["nvidia"];
|
||||
boot.kernelModules = [ "amdgpu" ];
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
|
||||
hardware = {
|
||||
amdgpu.initrd.enable = false;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
# This will enable only the integrated AMD GPU, while disabling the dedicated Nvidia GPU
|
||||
{...}: {
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
../../../../common/cpu/amd
|
||||
../../../../common/cpu/amd/pstate.nix
|
||||
|
|
|
|||
|
|
@ -1,9 +1,18 @@
|
|||
# Patch sourced from https://github.com/christian-bendiksen/kernel-6.8.0-63.16ARHA7.fc40
|
||||
{ pkgs, lib, kernel ? pkgs.linuxPackages_latest.kernel }:
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
kernel ? pkgs.linuxPackages_latest.kernel,
|
||||
}:
|
||||
|
||||
pkgs.stdenv.mkDerivation {
|
||||
pname = "lenovo-16ARHA7-speaker-fix-module";
|
||||
inherit (kernel) src version postPatch nativeBuildInputs;
|
||||
inherit (kernel)
|
||||
src
|
||||
version
|
||||
postPatch
|
||||
nativeBuildInputs
|
||||
;
|
||||
|
||||
kernel_dev = kernel.dev;
|
||||
kernelVersion = kernel.modDirVersion;
|
||||
|
|
@ -29,10 +38,10 @@ pkgs.stdenv.mkDerivation {
|
|||
modules_install
|
||||
'';
|
||||
|
||||
patches = [ ./lenovo_16ARHA7_sound_fix.patch ];
|
||||
patches = [ ./lenovo_16ARHA7_sound_fix.patch ];
|
||||
|
||||
meta = {
|
||||
description = "Patch to get the speakers working for Lenovo Legion Slim 7 Gen 7 AMD (16ARHA7)";
|
||||
license = lib.licenses.gpl3;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
lenovo-speaker-fix = pkgs.callPackage ./audio/lenovo-16ARHA7_speaker-fix.nix {
|
||||
|
|
@ -15,7 +20,9 @@ in
|
|||
];
|
||||
|
||||
# Kernel 6.10 includes the speaker fix, so only install this on systems with older kernels.
|
||||
boot.extraModulePackages = lib.mkIf (lib.versionOlder config.boot.kernelPackages.kernel.version "6.10") [ lenovo-speaker-fix ];
|
||||
boot.extraModulePackages =
|
||||
lib.mkIf (lib.versionOlder config.boot.kernelPackages.kernel.version "6.10")
|
||||
[ lenovo-speaker-fix ];
|
||||
|
||||
# √(2560² + 1600²) px / 16 in ≃ 189 dpi
|
||||
services.xserver.dpi = 189;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
../../../common/cpu/intel
|
||||
../../../common/gpu/nvidia/prime.nix
|
||||
|
|
@ -12,8 +13,11 @@
|
|||
../../../common/hidpi.nix
|
||||
];
|
||||
|
||||
boot.initrd.kernelModules = ["nvidia"];
|
||||
boot.extraModulePackages = [config.boot.kernelPackages.lenovo-legion-module config.boot.kernelPackages.nvidia_x11];
|
||||
boot.initrd.kernelModules = [ "nvidia" ];
|
||||
boot.extraModulePackages = [
|
||||
config.boot.kernelPackages.lenovo-legion-module
|
||||
config.boot.kernelPackages.nvidia_x11
|
||||
];
|
||||
|
||||
hardware = {
|
||||
nvidia = {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
../../../common/cpu/intel
|
||||
../../../common/gpu/nvidia/prime.nix
|
||||
|
|
@ -12,7 +13,7 @@
|
|||
../../../common/hidpi.nix
|
||||
];
|
||||
|
||||
boot.extraModulePackages = [config.boot.kernelPackages.lenovo-legion-module];
|
||||
boot.extraModulePackages = [ config.boot.kernelPackages.lenovo-legion-module ];
|
||||
|
||||
hardware = {
|
||||
nvidia = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue