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
|
|
@ -1,19 +1,20 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
imports = [
|
||||
../../../common/cpu/intel
|
||||
../../../common/gpu/nvidia/fermi # Is it possible/advisable to pin this to the 390.xx driver family in case the user wants to use non-free drivers?
|
||||
../../../common/gpu/amd # The K330 could be bought with AMD GPUs but I don't have that configuration
|
||||
../../../common/pc
|
||||
];
|
||||
imports = [
|
||||
../../../common/cpu/intel
|
||||
../../../common/gpu/nvidia/fermi # Is it possible/advisable to pin this to the 390.xx driver family in case the user wants to use non-free drivers?
|
||||
../../../common/gpu/amd # The K330 could be bought with AMD GPUs but I don't have that configuration
|
||||
../../../common/pc
|
||||
];
|
||||
|
||||
# On my machine Wayland causes the desktop to freeze after a short time of operation
|
||||
services.displayManager.sddm.wayland.enable = false;
|
||||
# On my machine Wayland causes the desktop to freeze after a short time of operation
|
||||
services.displayManager.sddm.wayland.enable = false;
|
||||
|
||||
# Should this be a conditional default in case plasma is activated?
|
||||
# What if somebody installs both plasma AND another DE?
|
||||
# The goal is to prefer x11 over wayland due to compatibility issues with the old hardware
|
||||
# Should this be a conditional default in case plasma is activated?
|
||||
# What if somebody installs both plasma AND another DE?
|
||||
# The goal is to prefer x11 over wayland due to compatibility issues with the old hardware
|
||||
|
||||
|
||||
services.displayManager.defaultSession = lib.mkIf config.services.xserver.desktopManager.plasma6.enable (lib.mkDefault "plasmax11");
|
||||
services.displayManager.defaultSession = lib.mkIf config.services.xserver.desktopManager.plasma6.enable (
|
||||
lib.mkDefault "plasmax11"
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@
|
|||
../.
|
||||
];
|
||||
|
||||
boot.kernelParams = [ "i8042.nomux=1" "i8042.reset" ]; # Fix trackpoint and touchpad working only after reboot
|
||||
boot.kernelParams = [
|
||||
"i8042.nomux=1"
|
||||
"i8042.reset"
|
||||
]; # Fix trackpoint and touchpad working only after reboot
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{ lib, pkgs, ... }:
|
||||
{
|
||||
# This can be removed when the default kernel is at least version 5.11 due to sof module
|
||||
boot.kernelPackages = lib.mkIf
|
||||
(lib.versionOlder pkgs.linux.version "5.11")
|
||||
(lib.mkDefault pkgs.linuxPackages_latest);
|
||||
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.11") (
|
||||
lib.mkDefault pkgs.linuxPackages_latest
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
{ lib, pkgs, config, ... }:
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
../.
|
||||
|
|
@ -9,7 +14,9 @@
|
|||
|
||||
# amdgpu.backlight=0 makes the backlight work
|
||||
# acpi_backlight=none allows the backlight save/load systemd service to work on older kernel versions
|
||||
boot.kernelParams = [ "amdgpu.backlight=0" ] ++ lib.optional (lib.versionOlder config.boot.kernelPackages.kernel.version "6.1.6") "acpi_backlight=none";
|
||||
boot.kernelParams =
|
||||
[ "amdgpu.backlight=0" ]
|
||||
++ lib.optional (lib.versionOlder config.boot.kernelPackages.kernel.version "6.1.6") "acpi_backlight=none";
|
||||
|
||||
# For mainline support of rtw89 wireless networking
|
||||
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.16") pkgs.linuxPackages_latest;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
{ lib, pkgs, config, ... }:
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
../.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
# P14s is a rebadged T14 with slight internal differences.
|
||||
|
|
@ -14,7 +19,9 @@
|
|||
# "vendor" setting, in this case the thinkpad_acpi driver.
|
||||
# See https://hansdegoede.livejournal.com/27130.html
|
||||
# See https://lore.kernel.org/linux-acpi/20221105145258.12700-1-hdegoede@redhat.com/
|
||||
boot.kernelParams = lib.mkIf (lib.versionOlder config.boot.kernelPackages.kernel.version "6.2") [ "acpi_backlight=native" ];
|
||||
boot.kernelParams = lib.mkIf (lib.versionOlder config.boot.kernelPackages.kernel.version "6.2") [
|
||||
"acpi_backlight=native"
|
||||
];
|
||||
|
||||
# see https://github.com/NixOS/nixpkgs/issues/69289
|
||||
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.2") pkgs.linuxPackages_latest;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
];
|
||||
|
||||
hardware = {
|
||||
intelgpu.driver = "i915"; #xe driver may be used on newer kernels
|
||||
intelgpu.driver = "i915"; # xe driver may be used on newer kernels
|
||||
nvidia = {
|
||||
prime = {
|
||||
intelBusId = "PCI:0:2:0";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{lib, ...}: {
|
||||
{ lib, ... }:
|
||||
{
|
||||
imports = [
|
||||
../.
|
||||
../../../../../common/cpu/intel/raptor-lake
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{ lib, config, ... }: {
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
imports = [
|
||||
../.
|
||||
../../../common/cpu/intel/whiskey-lake
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{ lib, config, ... }: {
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
imports = [
|
||||
../../../common/gpu/nvidia/prime.nix
|
||||
../../../common/gpu/nvidia/maxwell
|
||||
|
|
@ -19,16 +20,14 @@
|
|||
hardware.enableAllFirmware = lib.mkDefault true;
|
||||
|
||||
# fix suspend/resume screen corruption in sync mode
|
||||
hardware.nvidia.powerManagement =
|
||||
lib.mkIf config.hardware.nvidia.prime.sync.enable {
|
||||
enable = lib.mkDefault true;
|
||||
};
|
||||
hardware.nvidia.powerManagement = lib.mkIf config.hardware.nvidia.prime.sync.enable {
|
||||
enable = lib.mkDefault true;
|
||||
};
|
||||
|
||||
# fix screen tearing in sync mode
|
||||
hardware.nvidia.modesetting =
|
||||
lib.mkIf config.hardware.nvidia.prime.sync.enable {
|
||||
enable = lib.mkDefault true;
|
||||
};
|
||||
hardware.nvidia.modesetting = lib.mkIf config.hardware.nvidia.prime.sync.enable {
|
||||
enable = lib.mkDefault true;
|
||||
};
|
||||
|
||||
# Make the DPI the same in sync mode as in offload mode (disabled because
|
||||
# these thinkpads come with many kinds of screens, but this is valid for the
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{ config, lib, ... }: {
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
imports = [
|
||||
../../../common/gpu/24.05-compat.nix
|
||||
../../../common/gpu/nvidia/prime.nix
|
||||
|
|
@ -25,16 +26,14 @@
|
|||
hardware.enableAllFirmware = lib.mkDefault true;
|
||||
|
||||
# fix suspend/resume screen corruption in sync mode
|
||||
hardware.nvidia.powerManagement =
|
||||
lib.mkIf config.hardware.nvidia.prime.sync.enable {
|
||||
enable = lib.mkDefault true;
|
||||
};
|
||||
hardware.nvidia.powerManagement = lib.mkIf config.hardware.nvidia.prime.sync.enable {
|
||||
enable = lib.mkDefault true;
|
||||
};
|
||||
|
||||
# fix screen tearing in sync mode
|
||||
hardware.nvidia.modesetting =
|
||||
lib.mkIf config.hardware.nvidia.prime.sync.enable {
|
||||
enable = lib.mkDefault true;
|
||||
};
|
||||
hardware.nvidia.modesetting = lib.mkIf config.hardware.nvidia.prime.sync.enable {
|
||||
enable = lib.mkDefault true;
|
||||
};
|
||||
|
||||
# Make the DPI the same in sync mode as in offload mode (disabled because
|
||||
# these thinkpads come with many kinds of screens, but this is valid for the
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{ lib, config, ... }: {
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
imports = [
|
||||
../../../common/gpu/24.05-compat.nix
|
||||
../../../common/gpu/nvidia/prime.nix
|
||||
|
|
@ -26,16 +27,14 @@
|
|||
hardware.enableAllFirmware = lib.mkDefault true;
|
||||
|
||||
# fix suspend/resume screen corruption in sync mode
|
||||
hardware.nvidia.powerManagement =
|
||||
lib.mkIf config.hardware.nvidia.prime.sync.enable {
|
||||
enable = lib.mkDefault true;
|
||||
};
|
||||
hardware.nvidia.powerManagement = lib.mkIf config.hardware.nvidia.prime.sync.enable {
|
||||
enable = lib.mkDefault true;
|
||||
};
|
||||
|
||||
# fix screen tearing in sync mode
|
||||
hardware.nvidia.modesetting =
|
||||
lib.mkIf config.hardware.nvidia.prime.sync.enable {
|
||||
enable = lib.mkDefault true;
|
||||
};
|
||||
hardware.nvidia.modesetting = lib.mkIf config.hardware.nvidia.prime.sync.enable {
|
||||
enable = lib.mkDefault true;
|
||||
};
|
||||
|
||||
# Make the DPI the same in sync mode as in offload mode (disabled because
|
||||
# these thinkpads come with many kinds of screens, but this is valid for the
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
{ lib, pkgs, config, ... }:
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
{ lib, pkgs, config, ... }:
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
|
|
|
|||
|
|
@ -28,7 +28,10 @@
|
|||
"i915.i915_enable_rc6=1"
|
||||
];
|
||||
blacklistedKernelModules = [
|
||||
"sierra_net" "cdc_mbim" "cdc_ncm" "btusb"
|
||||
"sierra_net"
|
||||
"cdc_mbim"
|
||||
"cdc_ncm"
|
||||
"btusb"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,18 +12,20 @@
|
|||
# This configures a profile set for pulseaudio which offers multiple sinks corresponding to the
|
||||
# speaker + 4 HDMI ports. This allows the user to play audio streams on the speaker and any of the 4 HDMI/USB-C
|
||||
# ports at the same time.
|
||||
udev.extraRules = let
|
||||
t490ProfileSet = ./t490-profile-set.conf;
|
||||
in ''
|
||||
SUBSYSTEM!="sound", GOTO="pulseaudio_end"
|
||||
ACTION!="change", GOTO="pulseaudio_end"
|
||||
KERNEL!="card*", GOTO="pulseaudio_end"
|
||||
udev.extraRules =
|
||||
let
|
||||
t490ProfileSet = ./t490-profile-set.conf;
|
||||
in
|
||||
''
|
||||
SUBSYSTEM!="sound", GOTO="pulseaudio_end"
|
||||
ACTION!="change", GOTO="pulseaudio_end"
|
||||
KERNEL!="card*", GOTO="pulseaudio_end"
|
||||
|
||||
# Lenovo T490
|
||||
ATTRS{vendor}=="0x8086" ATTRS{device}=="0x9dc8" ATTRS{subsystem_vendor}=="0x17aa", ATTRS{subsystem_device}=="0x2279", ENV{PULSE_PROFILE_SET}="${t490ProfileSet}"
|
||||
# Lenovo T490
|
||||
ATTRS{vendor}=="0x8086" ATTRS{device}=="0x9dc8" ATTRS{subsystem_vendor}=="0x17aa", ATTRS{subsystem_device}=="0x2279", ENV{PULSE_PROFILE_SET}="${t490ProfileSet}"
|
||||
|
||||
LABEL="pulseaudio_end"
|
||||
'';
|
||||
LABEL="pulseaudio_end"
|
||||
'';
|
||||
|
||||
throttled.enable = lib.mkDefault true;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{lib, ...}: {
|
||||
{ lib, ... }:
|
||||
{
|
||||
imports = [
|
||||
../../../common/cpu/intel
|
||||
../../../common/pc/ssd
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{ ... }: {
|
||||
{ ... }:
|
||||
{
|
||||
# Reference to hardware: https://ubuntu.com/certified/202012-28574
|
||||
imports = [
|
||||
../.
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
{ pkgs, ... }:
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [ ../. ];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
alsa-utils
|
||||
];
|
||||
environment.systemPackages = with pkgs; [
|
||||
alsa-utils
|
||||
];
|
||||
|
||||
systemd.services.x1-fix = {
|
||||
description = "Use alsa-utils to fix sound interference on Thinkpad x1 Nano";
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.alsa-tools}/bin/hda-verb /dev/snd/hwC0D0 0x1d SET_PIN_WIDGET_CONTROL 0x0";
|
||||
Restart = "on-failure";
|
||||
};
|
||||
wantedBy = [ "default.target" ];
|
||||
};
|
||||
systemd.services.x1-fix = {
|
||||
description = "Use alsa-utils to fix sound interference on Thinkpad x1 Nano";
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.alsa-tools}/bin/hda-verb /dev/snd/hwC0D0 0x1d SET_PIN_WIDGET_CONTROL 0x0";
|
||||
Restart = "on-failure";
|
||||
};
|
||||
wantedBy = [ "default.target" ];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{lib, ...}:
|
||||
{ lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
];
|
||||
|
||||
# This solves lagging noticeable on high-resolution screens.
|
||||
boot.kernelPackages = lib.mkIf
|
||||
(lib.versionOlder pkgs.linux.version "5.15")
|
||||
(lib.mkDefault pkgs.linuxPackages_latest);
|
||||
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.15") (
|
||||
lib.mkDefault pkgs.linuxPackages_latest
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
{ lib, pkgs, ... }: {
|
||||
{ lib, pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
../.
|
||||
../../../../../common/pc/ssd
|
||||
];
|
||||
|
||||
# At least kernel 5.19 is required for the system to work properly.
|
||||
boot.kernelPackages = lib.mkIf
|
||||
(lib.versionOlder pkgs.linux.version "5.19")
|
||||
(lib.mkDefault pkgs.linuxPackages_latest);
|
||||
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.19") (
|
||||
lib.mkDefault pkgs.linuxPackages_latest
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{ config, lib, ... }: {
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
imports = [
|
||||
../.
|
||||
../../yoga.nix
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{ ... }: {
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
../common.nix
|
||||
../../../../common/cpu/amd
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{ ... }: {
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
../.
|
||||
../../../common/pc/ssd
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{ ... }: {
|
||||
{ ... }:
|
||||
{
|
||||
# Reference to hardware: https://certification.ubuntu.com/hardware/202004-27844
|
||||
imports = [
|
||||
../common.nix
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{ lib, ... }: {
|
||||
{ lib, ... }:
|
||||
{
|
||||
imports = [
|
||||
../.
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
{ config, lib, ... }: {
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
imports = [
|
||||
../intel
|
||||
../../yoga.nix
|
||||
];
|
||||
|
||||
services.xserver.wacom.enable = lib.mkDefault config.services.xserver.enable;
|
||||
|
||||
|
||||
services.hardware.bolt.enable = lib.mkDefault true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (config.boot.kernelPackages) kernel;
|
||||
|
|
@ -8,8 +13,8 @@ let
|
|||
# Version the dtb based on the kernel
|
||||
dtbEfiPath = "dtbs/x13s-${kernel.version}.dtb";
|
||||
cfg = {
|
||||
wifiMac = "e4:65:38:52:22:a9";
|
||||
bluetoothMac = "E4:25:18:22:44:AA";
|
||||
wifiMac = "e4:65:38:52:22:a9";
|
||||
bluetoothMac = "E4:25:18:22:44:AA";
|
||||
};
|
||||
inherit (lib) mkDefault;
|
||||
in
|
||||
|
|
|
|||
|
|
@ -9,4 +9,3 @@
|
|||
|
||||
services.throttled.enable = lib.mkDefault true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{ lib, pkgs, ... }: {
|
||||
{ lib, pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
../../../lenovo/thinkpad
|
||||
../../../common/cpu/amd
|
||||
|
|
@ -15,5 +16,7 @@
|
|||
|
||||
# kernel versions below 6.0 don’t contain ACPI suspend2idle drivers for the Z-series’ AMD hardware
|
||||
# my Z13 froze after waking up from suspend/ hibernate
|
||||
services.logind.lidSwitch = lib.mkIf (lib.versionOlder pkgs.linux.version "6.00") (lib.mkDefault "lock");
|
||||
services.logind.lidSwitch = lib.mkIf (lib.versionOlder pkgs.linux.version "6.00") (
|
||||
lib.mkDefault "lock"
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
{ lib, pkgs, ... }: {
|
||||
{ lib, pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
../../../../lenovo/thinkpad/z
|
||||
];
|
||||
|
||||
# Kernel 5.18 is required for the Ryzen 6000 series
|
||||
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.18") (lib.mkDefault pkgs.linuxPackages_latest);
|
||||
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.18") (
|
||||
lib.mkDefault pkgs.linuxPackages_latest
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,9 @@
|
|||
];
|
||||
|
||||
# Kernel 6.4 is required for the Ryzen 7040 series
|
||||
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.4") (lib.mkDefault pkgs.linuxPackages_latest);
|
||||
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.4") (
|
||||
lib.mkDefault pkgs.linuxPackages_latest
|
||||
);
|
||||
|
||||
systemd.services = {
|
||||
# Modified from Arch Wiki
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@
|
|||
let
|
||||
inherit (lib) mkDefault;
|
||||
|
||||
in {
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
../shared.nix
|
||||
## "prime.nix" loads this, aleady:
|
||||
|
|
|
|||
|
|
@ -1,23 +1,23 @@
|
|||
/*
|
||||
* `lenovo-yoga-7-14IAH7-hybrid`:
|
||||
*
|
||||
* This is a hybrid profile that enables the NVIDIA
|
||||
* driver and PRIME offload mode for making use of both
|
||||
* integrated and dedicated graphics. Use this profile if
|
||||
* you want to use the NVIDIA GeForce RTX 3050 Mobile.
|
||||
* Read about PRIME offload mode here:
|
||||
* <https://wiki.nixos.org/wiki/NVIDIA#Offload_mode>
|
||||
*
|
||||
* The `lenovo-yoga-7-14IAH7-integrated` profile only
|
||||
* has the integrated Intel GPU enabled. The dedicated
|
||||
* NVIDIA GPU is disabled entirely. Use that profile
|
||||
* instead if you want to only use integrated graphics.
|
||||
*
|
||||
* `nouveau` wasn't added to any profiles since it
|
||||
* is known to cause freezes for this device.
|
||||
* `nouveau` is blacklisted by default when enabling this:
|
||||
* <https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/hardware/video/nvidia.nix>
|
||||
*/
|
||||
`lenovo-yoga-7-14IAH7-hybrid`:
|
||||
|
||||
This is a hybrid profile that enables the NVIDIA
|
||||
driver and PRIME offload mode for making use of both
|
||||
integrated and dedicated graphics. Use this profile if
|
||||
you want to use the NVIDIA GeForce RTX 3050 Mobile.
|
||||
Read about PRIME offload mode here:
|
||||
<https://wiki.nixos.org/wiki/NVIDIA#Offload_mode>
|
||||
|
||||
The `lenovo-yoga-7-14IAH7-integrated` profile only
|
||||
has the integrated Intel GPU enabled. The dedicated
|
||||
NVIDIA GPU is disabled entirely. Use that profile
|
||||
instead if you want to only use integrated graphics.
|
||||
|
||||
`nouveau` wasn't added to any profiles since it
|
||||
is known to cause freezes for this device.
|
||||
`nouveau` is blacklisted by default when enabling this:
|
||||
<https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/hardware/video/nvidia.nix>
|
||||
*/
|
||||
{ lib, ... }:
|
||||
{
|
||||
imports = [
|
||||
|
|
|
|||
|
|
@ -1,25 +1,25 @@
|
|||
/*
|
||||
* `lenovo-yoga-7-14IAH7-integrated`:
|
||||
*
|
||||
* This profile only has the integrated Intel GPU
|
||||
* enabled. The dedicated NVIDIA GPU is disabled
|
||||
* entirely. Use this profile if you want to only
|
||||
* use the integrated GPU.
|
||||
*
|
||||
* It is recommended to use this profile to disable
|
||||
* dedicated graphics, rather than doing it through
|
||||
* the BIOS, since that method causes issues with
|
||||
* the integrated graphics drivers. Doing it
|
||||
* through blacklisting achieves the same result
|
||||
* with no side-effects.
|
||||
*
|
||||
* The `lenovo-yoga-7-14IAH7-hybrid` hybrid profile
|
||||
* enables the NVIDIA driver and PRIME offload mode
|
||||
* for making use of both GPUs. Use that profile
|
||||
* instead if you want to use the NVIDIA GPU.
|
||||
* Read about PRIME offload mode here:
|
||||
* <https://wiki.nixos.org/wiki/NVIDIA#Offload_mode>
|
||||
*/
|
||||
`lenovo-yoga-7-14IAH7-integrated`:
|
||||
|
||||
This profile only has the integrated Intel GPU
|
||||
enabled. The dedicated NVIDIA GPU is disabled
|
||||
entirely. Use this profile if you want to only
|
||||
use the integrated GPU.
|
||||
|
||||
It is recommended to use this profile to disable
|
||||
dedicated graphics, rather than doing it through
|
||||
the BIOS, since that method causes issues with
|
||||
the integrated graphics drivers. Doing it
|
||||
through blacklisting achieves the same result
|
||||
with no side-effects.
|
||||
|
||||
The `lenovo-yoga-7-14IAH7-hybrid` hybrid profile
|
||||
enables the NVIDIA driver and PRIME offload mode
|
||||
for making use of both GPUs. Use that profile
|
||||
instead if you want to use the NVIDIA GPU.
|
||||
Read about PRIME offload mode here:
|
||||
<https://wiki.nixos.org/wiki/NVIDIA#Offload_mode>
|
||||
*/
|
||||
{
|
||||
imports = [
|
||||
../shared.nix
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
* Here are configurations for the
|
||||
* Intel Core i7-12700H CPU, along
|
||||
* with a few others.
|
||||
*/
|
||||
Here are configurations for the
|
||||
Intel Core i7-12700H CPU, along
|
||||
with a few others.
|
||||
*/
|
||||
{
|
||||
imports = [
|
||||
../../../../common/cpu/intel/alder-lake
|
||||
|
|
|
|||
|
|
@ -1,20 +1,25 @@
|
|||
{ pkgs, lib, ... }: {
|
||||
{ pkgs, lib, ... }:
|
||||
{
|
||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
|
||||
# https://gitlab.freedesktop.org/drm/amd/-/issues/2812#note_2190544
|
||||
boot.kernelParams = ["mem_sleep_default=deep" "rtc_cmos.use_acpi_alarm=1"];
|
||||
# https://gitlab.freedesktop.org/drm/amd/-/issues/2812#note_2190544
|
||||
boot.kernelParams = [
|
||||
"mem_sleep_default=deep"
|
||||
"rtc_cmos.use_acpi_alarm=1"
|
||||
];
|
||||
|
||||
# suspend needs kernel 6.7 or later
|
||||
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.7") pkgs.linuxPackages_latest;
|
||||
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.7") pkgs.linuxPackages_latest;
|
||||
|
||||
# https://gitlab.freedesktop.org/drm/amd/-/issues/2812#note_2190544
|
||||
# https://gitlab.freedesktop.org/drm/amd/-/issues/2812#note_2190544
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
hardware.cpu.amd.updateMicrocode = true;
|
||||
boot.initrd.prepend = lib.mkOrder 0 [ "${pkgs.fetchurl {
|
||||
url = "https://gitlab.freedesktop.org/drm/amd/uploads/9fe228c7aa403b78c61fb1e29b3b35e3/slim7-ssdt";
|
||||
sha256 = "sha256-Ef4QTxdjt33OJEPLAPEChvvSIXx3Wd/10RGvLfG5JUs=";
|
||||
name = "slim7-ssdt";
|
||||
}}" ];
|
||||
boot.initrd.prepend = lib.mkOrder 0 [
|
||||
"${pkgs.fetchurl {
|
||||
url = "https://gitlab.freedesktop.org/drm/amd/uploads/9fe228c7aa403b78c61fb1e29b3b35e3/slim7-ssdt";
|
||||
sha256 = "sha256-Ef4QTxdjt33OJEPLAPEChvvSIXx3Wd/10RGvLfG5JUs=";
|
||||
name = "slim7-ssdt";
|
||||
}}"
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue