chore: format repo using treefmt-nix and nixfmt-rfc-style

This commit is contained in:
Andre 2025-06-04 12:11:03 -04:00
parent fc7c471412
commit 51e51e6014
266 changed files with 3721 additions and 2733 deletions

View file

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

View file

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

View file

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

View file

@ -1,4 +1,9 @@
{ lib, pkgs, config, ... }:
{
lib,
pkgs,
config,
...
}:
{
imports = [
../.

View file

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

View file

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

View file

@ -1,4 +1,5 @@
{lib, ...}: {
{ lib, ... }:
{
imports = [
../.
../../../../../common/cpu/intel/raptor-lake

View file

@ -1,4 +1,5 @@
{ lib, config, ... }: {
{ lib, config, ... }:
{
imports = [
../.
../../../common/cpu/intel/whiskey-lake

View file

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

View file

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

View file

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

View file

@ -1,4 +1,9 @@
{ lib, pkgs, config, ... }:
{
lib,
pkgs,
config,
...
}:
{
imports = [

View file

@ -1,4 +1,9 @@
{ lib, pkgs, config, ... }:
{
lib,
pkgs,
config,
...
}:
{
imports = [

View file

@ -28,7 +28,10 @@
"i915.i915_enable_rc6=1"
];
blacklistedKernelModules = [
"sierra_net" "cdc_mbim" "cdc_ncm" "btusb"
"sierra_net"
"cdc_mbim"
"cdc_ncm"
"btusb"
];
};
}

View file

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

View file

@ -1,4 +1,5 @@
{lib, ...}: {
{ lib, ... }:
{
imports = [
../../../common/cpu/intel
../../../common/pc/ssd

View file

@ -1,4 +1,5 @@
{ ... }: {
{ ... }:
{
# Reference to hardware: https://ubuntu.com/certified/202012-28574
imports = [
../.

View file

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

View file

@ -1,4 +1,4 @@
{lib, ...}:
{ lib, ... }:
{
imports = [

View file

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

View file

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

View file

@ -1,4 +1,5 @@
{ config, lib, ... }: {
{ config, lib, ... }:
{
imports = [
../.
../../yoga.nix

View file

@ -1,4 +1,5 @@
{ ... }: {
{ ... }:
{
imports = [
../common.nix
../../../../common/cpu/amd

View file

@ -1,4 +1,5 @@
{ ... }: {
{ ... }:
{
imports = [
../.
../../../common/pc/ssd

View file

@ -1,4 +1,5 @@
{ ... }: {
{ ... }:
{
# Reference to hardware: https://certification.ubuntu.com/hardware/202004-27844
imports = [
../common.nix

View file

@ -1,4 +1,5 @@
{ lib, ... }: {
{ lib, ... }:
{
imports = [
../.
];

View file

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

View file

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

View file

@ -9,4 +9,3 @@
services.throttled.enable = lib.mkDefault true;
}

View file

@ -1,4 +1,5 @@
{ lib, pkgs, ... }: {
{ lib, pkgs, ... }:
{
imports = [
../../../lenovo/thinkpad
../../../common/cpu/amd
@ -15,5 +16,7 @@
# kernel versions below 6.0 dont 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"
);
}

View file

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

View file

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