From d2483459e8113004955d34a025d500c21a683883 Mon Sep 17 00:00:00 2001 From: matthiasdotsh Date: Sat, 22 Feb 2025 11:39:23 +0100 Subject: [PATCH 001/134] surface: linux 6.12.14 -> 6.12.16 --- microsoft/surface/common/kernel/linux-surface/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/microsoft/surface/common/kernel/linux-surface/default.nix b/microsoft/surface/common/kernel/linux-surface/default.nix index 17260c9d..0a784528 100644 --- a/microsoft/surface/common/kernel/linux-surface/default.nix +++ b/microsoft/surface/common/kernel/linux-surface/default.nix @@ -7,14 +7,14 @@ let cfg = config.microsoft-surface; - version = "6.12.14"; + version = "6.12.16"; kernelPatches = surfacePatches { inherit version; patchFn = ./patches.nix; }; kernelPackages = linuxPackage { inherit version kernelPatches; - sha256 = "sha256-lCP0v7TYdUF+OcsLAXtUmf6kfaVhGfDNKKIBc12JjxQ="; + sha256 = "sha256-X4E2KmlPUVIL/5+uy3PxzJvHvs5v3RDVwn40jfOdfcQ="; ignoreConfigErrors=true; }; From f75203cc311b092a4c11f909bacd2534a7078c37 Mon Sep 17 00:00:00 2001 From: Manuel Transfeld Date: Mon, 24 Feb 2025 08:48:14 +0100 Subject: [PATCH 002/134] common/gpu/nvidia: remove a default value (#1373) https://github.com/NixOS/nixpkgs/pull/326369 has been merged. --- common/gpu/nvidia/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/common/gpu/nvidia/default.nix b/common/gpu/nvidia/default.nix index df28c06a..281e33f7 100644 --- a/common/gpu/nvidia/default.nix +++ b/common/gpu/nvidia/default.nix @@ -3,6 +3,4 @@ { imports = [ ../24.05-compat.nix ]; services.xserver.videoDrivers = lib.mkDefault [ "nvidia" ]; - # TODO: this will be a default after https://github.com/NixOS/nixpkgs/pull/326369 - hardware.nvidia.modesetting.enable = lib.mkDefault true; } From 9b49e201401825b581167c9467ff3791420644cc Mon Sep 17 00:00:00 2001 From: Nicky Mouha Date: Mon, 24 Feb 2025 02:54:44 -0500 Subject: [PATCH 003/134] framework/13-inch/intel-core-ultra-series1: add check for hardware.enableRedistributableFirmware (#1367) --- framework/13-inch/intel-core-ultra-series1/default.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/framework/13-inch/intel-core-ultra-series1/default.nix b/framework/13-inch/intel-core-ultra-series1/default.nix index 2efb3f77..7ac20d6e 100644 --- a/framework/13-inch/intel-core-ultra-series1/default.nix +++ b/framework/13-inch/intel-core-ultra-series1/default.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, ... }: +{ config, lib, pkgs, ... }: { imports = [ @@ -12,7 +12,7 @@ # Intel NPU Driver # https://discourse.nixos.org/t/new-installation-on-asus-zenbook-ux5406-intel-vpu-firmware-error-2/58732/2 - hardware.firmware = [ + hardware.firmware = lib.optionals (config.hardware.enableRedistributableFirmware) [ ( let model = "37xx"; @@ -29,4 +29,9 @@ '' ) ]; + + warnings = lib.mkIf (!config.hardware.enableRedistributableFirmware) [ + ''For Intel NPU support, set the option: hardware.enableRedistributableFirmware = true;'' + ]; + } From 04be27ce4950145d6ac19e246720fdd8951d4c6c Mon Sep 17 00:00:00 2001 From: Cassie Cheung Date: Thu, 13 Feb 2025 15:40:17 +0800 Subject: [PATCH 004/134] apple/t2: update docs to remove old option The option was removed in a previous PR but the README was not updated. Reduce confusion by removing references to the deleted option. --- apple/t2/README.md | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/apple/t2/README.md b/apple/t2/README.md index 44423955..351c6092 100644 --- a/apple/t2/README.md +++ b/apple/t2/README.md @@ -8,29 +8,5 @@ Following [this guide](https://wiki.t2linux.org/distributions/nixos/installation You can consult the [wiki](https://wiki.t2linux.org/) for information specific to T2 Macs. -## Unlocking Internal iGPU - -The `apple-set-os-loader-installer` module serves as an installer for the [`apple-set-os-loader`](https://github.com/Redecorating/apple_set_os-loader). This tool is designed to unlock the internal integrated GPU (iGPU) on certain MacBooks. See https://wiki.t2linux.org/guides/hybrid-graphics/ for more details. - -### What it Does: - -Upon activation, this module performs the following: - -- Renames the existing `BOOTX64.EFI` file to `bootx64_original.efi`. -- Installs the `apple-set-os-loader` hook in its place as `bootx64.efi`. -- Before the system boots the hook unlocks the iGPU and subsequently calls the original `bootx64_original.efi`. -- Enables the iGPU by default. - -### How to Implement: - -1. Add this into your `configuration.nix`: -``` -hardware.apple-t2.enableAppleSetOsLoader = true; -``` - -2. **Rebuild your system**: -``` -sudo nixos-rebuild switch -``` - -> **Note**: Always ensure compatibility and make backups of your data before making any system changes. +> [!warning] +> Always ensure compatibility and make backups of your data before making any system changes. From d098b095003946adf5714cc8edee501d8cf08e74 Mon Sep 17 00:00:00 2001 From: Cassie Cheung Date: Thu, 13 Feb 2025 15:31:24 +0800 Subject: [PATCH 005/134] apple/t2: refactor kernel package, add stable kernel Refactors the kernel package to a generic one and adds support for the lts kernel. Since nixpkgs' kernel packages provide the `kernelPatches` override, utilizing that ensures that kernel updates are not delayed too much due to having to PR them to nixos-hardware separately. This comes at the expense of possible breakage when upstream updates something that breaks the patches. Because the T2 Linux project has a lot of patches which changes periodically, including them in the repository directly is a maintenance burden. Instead, this patch comes with an update script and JSON files containing all of the patches to be downloaded (by fetchurl) and applied. The NixOS option to enable changing release versions will be added in the next commit. --- apple/t2/default.nix | 4 +- apple/t2/pkgs/linux-t2.nix | 56 ----------- apple/t2/pkgs/linux-t2/default.nix | 6 ++ apple/t2/pkgs/linux-t2/generic.nix | 59 ++++++++++++ apple/t2/pkgs/linux-t2/latest.json | 117 +++++++++++++++++++++++ apple/t2/pkgs/linux-t2/latest.nix | 6 ++ apple/t2/pkgs/linux-t2/stable.json | 113 ++++++++++++++++++++++ apple/t2/pkgs/linux-t2/update-patches.py | 93 ++++++++++++++++++ 8 files changed, 396 insertions(+), 58 deletions(-) delete mode 100644 apple/t2/pkgs/linux-t2.nix create mode 100644 apple/t2/pkgs/linux-t2/default.nix create mode 100644 apple/t2/pkgs/linux-t2/generic.nix create mode 100644 apple/t2/pkgs/linux-t2/latest.json create mode 100644 apple/t2/pkgs/linux-t2/latest.nix create mode 100644 apple/t2/pkgs/linux-t2/stable.json create mode 100755 apple/t2/pkgs/linux-t2/update-patches.py diff --git a/apple/t2/default.nix b/apple/t2/default.nix index 9eb8ff3c..10793762 100644 --- a/apple/t2/default.nix +++ b/apple/t2/default.nix @@ -47,8 +47,8 @@ in config = lib.mkMerge [ { - # For keyboard and touchbar - boot.kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./pkgs/linux-t2.nix { }); + # For keyboard, touchpad, touchbar and audio. + boot.kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./pkgs/linux-t2 { }); boot.initrd.kernelModules = [ "apple-bce" ]; services.udev.packages = [ audioFilesUdevRules ]; diff --git a/apple/t2/pkgs/linux-t2.nix b/apple/t2/pkgs/linux-t2.nix deleted file mode 100644 index 6b0696f3..00000000 --- a/apple/t2/pkgs/linux-t2.nix +++ /dev/null @@ -1,56 +0,0 @@ -{ lib, buildLinux, fetchFromGitHub, fetchzip, runCommand -, ... } @ args: - -let - version = "6.13"; - majorVersion = lib.elemAt (lib.take 1 (lib.splitVersion version)) 0; - - patchRepo = fetchFromGitHub { - owner = "t2linux"; - repo = "linux-t2-patches"; - rev = "07cba1a25b43834f24f8be302bd025f2f89493c5"; - hash = "sha256-kRSzqOApTmTTv3rfNmP9/RQ7zV4jptlEOLWixtgwTLk="; - }; - - kernel = fetchzip { - url = "mirror://kernel/linux/kernel/v${majorVersion}.x/linux-${version}.tar.xz"; - hash = "sha256-FD22KmTFrIhED5X3rcjPTot1UOq1ir1zouEpRWZkRC0="; - }; -in -buildLinux (args // { - inherit version; - - pname = "linux-t2"; - # Snippet from nixpkgs - modDirVersion = "${lib.concatStringsSep "." (lib.take 3 (lib.splitVersion "${version}.0"))}"; - - src = runCommand "patched-source" {} '' - cp -r ${kernel} $out - chmod -R u+w $out - cd $out - while read -r patch; do - echo "Applying patch $patch"; - patch -p1 < $patch; - done < <(find ${patchRepo} -type f -name "*.patch" | sort) - ''; - - structuredExtraConfig = with lib.kernel; { - APPLE_BCE = module; - APPLE_GMUX = module; - APFS_FS = module; - BRCMFMAC = module; - BT_BCM = module; - BT_HCIBCM4377 = module; - BT_HCIUART_BCM = yes; - BT_HCIUART = module; - HID_APPLETB_BL = module; - HID_APPLETB_KBD = module; - HID_APPLE = module; - DRM_APPLETBDRM = module; - HID_SENSOR_ALS = module; - SND_PCM = module; - STAGING = yes; - }; - - kernelPatches = []; -} // (args.argsOverride or {})) diff --git a/apple/t2/pkgs/linux-t2/default.nix b/apple/t2/pkgs/linux-t2/default.nix new file mode 100644 index 00000000..76247b8b --- /dev/null +++ b/apple/t2/pkgs/linux-t2/default.nix @@ -0,0 +1,6 @@ +{ callPackage, linux_6_12, ... }@args: + +callPackage ./generic.nix args { + kernel = linux_6_12; + patchesFile = ./stable.json; +} diff --git a/apple/t2/pkgs/linux-t2/generic.nix b/apple/t2/pkgs/linux-t2/generic.nix new file mode 100644 index 00000000..297433c3 --- /dev/null +++ b/apple/t2/pkgs/linux-t2/generic.nix @@ -0,0 +1,59 @@ +{ + lib, + fetchurl, # fetchpatch does unnecessary normalization + ... +}@args: + +{ + kernel, + patchesFile, +}: +let + inherit (builtins) readFile fromJSON; + + patchset = fromJSON (readFile patchesFile); + t2-patches = map ( + { name, hash }: + { + inherit name; + patch = fetchurl { + inherit name hash; + url = patchset.base_url + name; + }; + } + ) patchset.patches; +in +kernel.override ( + args + // { + pname = "linux-t2"; + + structuredExtraConfig = with lib.kernel; { + APPLE_BCE = module; + APPLE_GMUX = module; + APFS_FS = module; + BRCMFMAC = module; + BT_BCM = module; + BT_HCIBCM4377 = module; + BT_HCIUART_BCM = yes; + BT_HCIUART = module; + HID_APPLETB_BL = module; + HID_APPLETB_KBD = module; + HID_APPLE = module; + DRM_APPLETBDRM = module; + HID_SENSOR_ALS = module; + SND_PCM = module; + STAGING = yes; + }; + + kernelPatches = t2-patches ++ (args.kernelPatches or [ ]); + + argsOverride.extraMeta = { + description = "The Linux kernel (with patches from the T2 Linux project)"; + + # take responsibility for the downstream kernel + maintainers = with lib.maintainers; [ soopyc ]; + }; + } + // (args.argsOverride or { }) +) diff --git a/apple/t2/pkgs/linux-t2/latest.json b/apple/t2/pkgs/linux-t2/latest.json new file mode 100644 index 00000000..03c9714b --- /dev/null +++ b/apple/t2/pkgs/linux-t2/latest.json @@ -0,0 +1,117 @@ +{ + "base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/8f138bc16772fdeb0fc68b631fb6f66ddae1a0a1/", + "patches": [ + { + "name": "1001-Add-apple-bce-driver.patch", + "hash": "sha256-e3RPvWPj2QASGOS4kieO8YFekrXsBCJtfF82OPlOn2E=" + }, + { + "name": "1002-Put-apple-bce-in-drivers-staging.patch", + "hash": "sha256-wkveNo1qwAwXWDGTFed4ZDbuBnJbwKgWLmTHK9qq0oM=" + }, + { + "name": "1005-HID-hid-appletb-bl-add-driver-for-the-backlight-of-A.patch", + "hash": "sha256-kEscS1FAyDxLZPOPInYTXFEf4fouBEa4zGctX14hSu8=" + }, + { + "name": "1006-HID-hid-appletb-kbd-add-driver-for-the-keyboard-mode.patch", + "hash": "sha256-eVEuvnoRItaDjwWu41nn9bTkgHgY+1SL/hFAvUR2IlY=" + }, + { + "name": "1007-HID-multitouch-support-getting-the-contact-ID-from.patch", + "hash": "sha256-A4tExJafroVAv/Hbdt7farJM6RYl/DU5KwSbzqcdEVY=" + }, + { + "name": "1008-HID-multitouch-support-getting-the-tip-state-from-HI.patch", + "hash": "sha256-GwK+d87p3UMy66037dzq6/Zearj8gnRHhqSdZczRadY=" + }, + { + "name": "1009-HID-multitouch-take-cls-maxcontacts-into-account-for.patch", + "hash": "sha256-fywzHnCQ657UFye1ckiufral3pBwBGtKdxWqWqaFHM0=" + }, + { + "name": "1010-HID-multitouch-allow-specifying-if-a-device-is-direc.patch", + "hash": "sha256-87SOnLgeG60Svu2Z9QUyP9P6cZ1Gznt6ZYLFImfx+vY=" + }, + { + "name": "1011-HID-multitouch-add-device-ID-for-Apple-Touch-Bars.patch", + "hash": "sha256-TJjXAlQ4WEROnq/xd6/4JHTuEJjqT7dLLcE4etKdzc0=" + }, + { + "name": "1012-lib-vsprintf-Add-support-for-generic-FOURCCs-by-exte.patch", + "hash": "sha256-cMl4WJcT/nM/z12LEsnLxssQgnRqKE+d/P2uMr5PUDQ=" + }, + { + "name": "1014-drm-format-helper-add-helper-for-BGR888-to-XRGB8888-.patch", + "hash": "sha256-iBM2z+/jZb/3+c9wHjC7W359oRl+DzFDZ1KL5eUc3qo=" + }, + { + "name": "1015-drm-tiny-add-driver-for-Apple-Touch-Bars-in-x86-Macs.patch", + "hash": "sha256-sTb+ruY6W18wz9XRJzZKlfl4a8fGo1nrtCoOYNaPAjI=" + }, + { + "name": "2008-i915-4-lane-quirk-for-mbp15-1.patch", + "hash": "sha256-f/PTDwRGEyVkGHFyypTKi+gIni3R4TmcsOneGc7Ay5A=" + }, + { + "name": "2009-apple-gmux-allow-switching-to-igpu-at-probe.patch", + "hash": "sha256-XKwlyJZjJLQz39mc0/S7sPnRnwrqMsq9OKy+QCO+oho=" + }, + { + "name": "3001-applesmc-convert-static-structures-to-drvdata.patch", + "hash": "sha256-7KGC0pCos351wKNhwJI/Qoc7w+orOPpiTkdCN50G8nI=" + }, + { + "name": "3002-applesmc-make-io-port-base-addr-dynamic.patch", + "hash": "sha256-1fnmMP/3WSy2JqjdCvxu8tWoshCPr8eiG6ttYK/N9WA=" + }, + { + "name": "3003-applesmc-switch-to-acpi_device-from-platform.patch", + "hash": "sha256-3S6BzyoPLoirfyAu4yDyE9aYjUYr/7etmAvN3uKSDLE=" + }, + { + "name": "3004-applesmc-key-interface-wrappers.patch", + "hash": "sha256-9Bq28WcqiOnef0br6bATOudr1ViSpajQs7fv7o8Tg0I=" + }, + { + "name": "3005-applesmc-basic-mmio-interface-implementation.patch", + "hash": "sha256-Hh9DymQ+Y74oSs1zv9F0lTU3jfAenKTM+cmFH9tmN9Q=" + }, + { + "name": "3006-applesmc-fan-support-on-T2-Macs.patch", + "hash": "sha256-D5IQHE8QFo49mnUawSau7xUsMFkHKayyhnHW4hi+fWE=" + }, + { + "name": "3007-applesmc-Add-iMacPro-to-applesmc_whitelist.patch", + "hash": "sha256-rLDuyQYzAaWuu/u6nRRVvGdwyfpLvkGPu1OoD8KS0os=" + }, + { + "name": "3008-applesmc-make-applesmc_remove-void.patch", + "hash": "sha256-j2Rj1PW/bFEYh9IkGkkG9b+G27IAPCInyd828z4WE1s=" + }, + { + "name": "3009-applesmc-battery-charge-limiter.patch", + "hash": "sha256-skYKmLsJ6O42/wINLccZWoKS0XhVlC1Nfxi1Ekloxns=" + }, + { + "name": "4001-Input-bcm5974-Add-support-for-the-T2-Macs.patch", + "hash": "sha256-CaviinY3rYqQh+/DGyeBTzLL/ZfIvguOQlWCs3KN4zc=" + }, + { + "name": "5001-wifi-brcmfmac-use-random-seed-flag-for-BCM4355-and-B.patch", + "hash": "sha256-tlKhUNmDfsKat6O8eK1h84qikUj1Kiv9bbBQaZuDQK4=" + }, + { + "name": "7001-drm-i915-fbdev-Discard-BIOS-framebuffers-exceeding-h.patch", + "hash": "sha256-O6RHFxmKZn7aCq1D+r5z2T3jLt0r5+01EABD9rs0E5M=" + }, + { + "name": "8001-Add-APFS-driver.patch", + "hash": "sha256-40Gl8eR9RB6qEoU+vY7+sVWms8e566OUmAb9LZWZK3w=" + }, + { + "name": "8002-Necessary-modifications-to-build-APFS-with-the-kerne.patch", + "hash": "sha256-n1SH5vC//LRJdWOavH9/BHqBTjkUj5f+dFGitSeHksw=" + } + ] +} diff --git a/apple/t2/pkgs/linux-t2/latest.nix b/apple/t2/pkgs/linux-t2/latest.nix new file mode 100644 index 00000000..7ab2e41b --- /dev/null +++ b/apple/t2/pkgs/linux-t2/latest.nix @@ -0,0 +1,6 @@ +{ callPackage, linux_6_13, ... }@args: + +callPackage ./generic.nix args { + kernel = linux_6_13; + patchesFile = ./latest.json; +} diff --git a/apple/t2/pkgs/linux-t2/stable.json b/apple/t2/pkgs/linux-t2/stable.json new file mode 100644 index 00000000..ce38004c --- /dev/null +++ b/apple/t2/pkgs/linux-t2/stable.json @@ -0,0 +1,113 @@ +{ + "base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/19c29ff4bbda9f512b7b69d63d249de269dc66ab/", + "patches": [ + { + "name": "1001-Add-apple-bce-driver.patch", + "hash": "sha256-e3RPvWPj2QASGOS4kieO8YFekrXsBCJtfF82OPlOn2E=" + }, + { + "name": "1002-Put-apple-bce-in-drivers-staging.patch", + "hash": "sha256-DXj4CmE7TKMGrAhQDOR5RVw9YHmyQMiXZsmxYfkKAEA=" + }, + { + "name": "1005-HID-hid-appletb-bl-add-driver-for-the-backlight-of-A.patch", + "hash": "sha256-kEscS1FAyDxLZPOPInYTXFEf4fouBEa4zGctX14hSu8=" + }, + { + "name": "1006-HID-hid-appletb-kbd-add-driver-for-the-keyboard-mode.patch", + "hash": "sha256-eVEuvnoRItaDjwWu41nn9bTkgHgY+1SL/hFAvUR2IlY=" + }, + { + "name": "1007-HID-multitouch-support-getting-the-contact-ID-from.patch", + "hash": "sha256-A4tExJafroVAv/Hbdt7farJM6RYl/DU5KwSbzqcdEVY=" + }, + { + "name": "1008-HID-multitouch-support-getting-the-tip-state-from-HI.patch", + "hash": "sha256-GwK+d87p3UMy66037dzq6/Zearj8gnRHhqSdZczRadY=" + }, + { + "name": "1009-HID-multitouch-take-cls-maxcontacts-into-account-for.patch", + "hash": "sha256-fywzHnCQ657UFye1ckiufral3pBwBGtKdxWqWqaFHM0=" + }, + { + "name": "1010-HID-multitouch-allow-specifying-if-a-device-is-direc.patch", + "hash": "sha256-87SOnLgeG60Svu2Z9QUyP9P6cZ1Gznt6ZYLFImfx+vY=" + }, + { + "name": "1011-HID-multitouch-add-device-ID-for-Apple-Touch-Bars.patch", + "hash": "sha256-TJjXAlQ4WEROnq/xd6/4JHTuEJjqT7dLLcE4etKdzc0=" + }, + { + "name": "1012-lib-vsprintf-Add-support-for-generic-FOURCCs-by-exte.patch", + "hash": "sha256-cMl4WJcT/nM/z12LEsnLxssQgnRqKE+d/P2uMr5PUDQ=" + }, + { + "name": "1014-drm-format-helper-add-helper-for-BGR888-to-XRGB8888-.patch", + "hash": "sha256-iBM2z+/jZb/3+c9wHjC7W359oRl+DzFDZ1KL5eUc3qo=" + }, + { + "name": "1015-drm-tiny-add-driver-for-Apple-Touch-Bars-in-x86-Macs.patch", + "hash": "sha256-sTb+ruY6W18wz9XRJzZKlfl4a8fGo1nrtCoOYNaPAjI=" + }, + { + "name": "2008-i915-4-lane-quirk-for-mbp15-1.patch", + "hash": "sha256-lZ7MWXZubmAlJCqBmuzueg7agENJbikxP1SE46SmwNw=" + }, + { + "name": "2009-apple-gmux-allow-switching-to-igpu-at-probe.patch", + "hash": "sha256-XKwlyJZjJLQz39mc0/S7sPnRnwrqMsq9OKy+QCO+oho=" + }, + { + "name": "3001-applesmc-convert-static-structures-to-drvdata.patch", + "hash": "sha256-7KGC0pCos351wKNhwJI/Qoc7w+orOPpiTkdCN50G8nI=" + }, + { + "name": "3002-applesmc-make-io-port-base-addr-dynamic.patch", + "hash": "sha256-1fnmMP/3WSy2JqjdCvxu8tWoshCPr8eiG6ttYK/N9WA=" + }, + { + "name": "3003-applesmc-switch-to-acpi_device-from-platform.patch", + "hash": "sha256-3S6BzyoPLoirfyAu4yDyE9aYjUYr/7etmAvN3uKSDLE=" + }, + { + "name": "3004-applesmc-key-interface-wrappers.patch", + "hash": "sha256-9Bq28WcqiOnef0br6bATOudr1ViSpajQs7fv7o8Tg0I=" + }, + { + "name": "3005-applesmc-basic-mmio-interface-implementation.patch", + "hash": "sha256-Hh9DymQ+Y74oSs1zv9F0lTU3jfAenKTM+cmFH9tmN9Q=" + }, + { + "name": "3006-applesmc-fan-support-on-T2-Macs.patch", + "hash": "sha256-D5IQHE8QFo49mnUawSau7xUsMFkHKayyhnHW4hi+fWE=" + }, + { + "name": "3007-applesmc-Add-iMacPro-to-applesmc_whitelist.patch", + "hash": "sha256-rLDuyQYzAaWuu/u6nRRVvGdwyfpLvkGPu1OoD8KS0os=" + }, + { + "name": "3008-applesmc-make-applesmc_remove-void.patch", + "hash": "sha256-j2Rj1PW/bFEYh9IkGkkG9b+G27IAPCInyd828z4WE1s=" + }, + { + "name": "3009-applesmc-battery-charge-limiter.patch", + "hash": "sha256-skYKmLsJ6O42/wINLccZWoKS0XhVlC1Nfxi1Ekloxns=" + }, + { + "name": "4001-Input-bcm5974-Add-support-for-the-T2-Macs.patch", + "hash": "sha256-CaviinY3rYqQh+/DGyeBTzLL/ZfIvguOQlWCs3KN4zc=" + }, + { + "name": "7001-drm-i915-fbdev-Discard-BIOS-framebuffers-exceeding-h.patch", + "hash": "sha256-O6RHFxmKZn7aCq1D+r5z2T3jLt0r5+01EABD9rs0E5M=" + }, + { + "name": "8001-Add-APFS-driver.patch", + "hash": "sha256-RjEhzCqGvwRSGFjMgg1Z1kFwbxB9VT3SkVKoOdtDvP0=" + }, + { + "name": "8002-Necessary-modifications-to-build-APFS-with-the-kerne.patch", + "hash": "sha256-n1SH5vC//LRJdWOavH9/BHqBTjkUj5f+dFGitSeHksw=" + } + ] +} diff --git a/apple/t2/pkgs/linux-t2/update-patches.py b/apple/t2/pkgs/linux-t2/update-patches.py new file mode 100755 index 00000000..28d46b13 --- /dev/null +++ b/apple/t2/pkgs/linux-t2/update-patches.py @@ -0,0 +1,93 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i python -p nix -p "python3.withPackages (p: [p.requests])" + +import argparse +import json +import re +import subprocess +import sys +from tempfile import NamedTemporaryFile + +import requests + +API_BASE = "https://api.github.com" +PATCH_PATTERN = re.compile(r"^\d{4}-.*\.patch$") + +parser = argparse.ArgumentParser( + description="Update linux-t2 patches from a GitHub repository." +) +parser.add_argument("filename", help="the output filename") +parser.add_argument( + "--repository", + help="the source github repository", + default="t2linux/linux-t2-patches", + nargs="?", +) +ref_group = parser.add_mutually_exclusive_group() +ref_group.add_argument( + "--reference", help="the git reference for the patches", default=None, nargs="?" +) +ref_group.add_argument( + "--branch", help="the git branch to fetch", default=None, nargs="?" +) + + +def get_api(endpoint, *args, **kwargs): + kwargs["headers"] = {"X-GitHub-Api-Version": "2022-11-28"} + response = requests.get(API_BASE + endpoint, *args, **kwargs) + response.raise_for_status() + return response.json() + + +def get_sri_hash(data: bytes): + with NamedTemporaryFile() as tmpfile: + tmpfile.write(data) + tmpfile.flush() + proc = subprocess.run( + ["nix-hash", "--sri", "--flat", "--type", "sha256", tmpfile.name], + check=True, + capture_output=True, + ) + return proc.stdout.decode("utf8").strip() + + +def main(): + args = parser.parse_args() + reference = args.reference + branch = args.branch + + if reference is None: + if branch is None: + print("Branch and reference not provided, fetching default branch") + branch = get_api(f"/repos/{args.repository}")["default_branch"] + + print(f"Reference not provided, fetching from branch {branch}") + branch_data = get_api(f"/repos/{args.repository}/branches/{branch}") + reference = branch_data["commit"]["sha"] + + print(f"Repository: {args.repository}") + print(f" Reference: {reference}") + + base_url = f"https://raw.githubusercontent.com/{args.repository}/{reference}/" + contents = get_api(f"/repos/{args.repository}/contents", {"ref": reference}) + patches = filter(lambda e: PATCH_PATTERN.match(e.get("name")), contents) + + patches_with_hash = [] + for patch in patches: + patch_content = requests.get(patch["download_url"]) + patch_hash = get_sri_hash(patch_content.content) + print(f"{patch['name']}: {patch_hash}") + patches_with_hash.append({"name": patch["name"], "hash": patch_hash}) + + result = {"base_url": base_url, "patches": patches_with_hash} + + with open(args.filename, "w+") as f: + json.dump(result, f, indent=2) + f.write("\n") # write final newline + print(f"Wrote to {args.filename}") + + return 0 + + +if __name__ == "__main__": + sys.exit(main()) From a0252d668cacd7df728c099e691aa3482ba664c3 Mon Sep 17 00:00:00 2001 From: Cassie Cheung Date: Wed, 19 Feb 2025 14:38:11 +0800 Subject: [PATCH 006/134] apple/t2: add option to select kernel release --- apple/t2/default.nix | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/apple/t2/default.nix b/apple/t2/default.nix index 10793762..d1057caf 100644 --- a/apple/t2/default.nix +++ b/apple/t2/default.nix @@ -1,6 +1,7 @@ { config, lib, pkgs, ... }: let + inherit (lib) types; audioFiles = pkgs.fetchFromGitHub { owner = "kekrby"; repo = "t2-better-audio"; @@ -43,12 +44,25 @@ in ]; options.hardware.apple-t2 = { enableIGPU = lib.mkEnableOption "the usage of the iGPU on specific Apple devices with an AMD dGPU"; + kernelChannel = lib.mkOption { + type = types.enum [ + "stable" + "latest" + ]; + default = "stable"; + example = "latest"; + description = "The kernel release stream to use."; + }; }; config = lib.mkMerge [ { - # For keyboard, touchpad, touchbar and audio. - boot.kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./pkgs/linux-t2 { }); + # Specialized kernel for keyboard, touchpad, touchbar and audio. + boot.kernelPackages = pkgs.linuxPackagesFor ( + pkgs.callPackage ( + if t2Cfg.kernelChannel == "stable" then ./pkgs/linux-t2 else ./pkgs/linux-t2/latest.nix + ) { } + ); boot.initrd.kernelModules = [ "apple-bce" ]; services.udev.packages = [ audioFilesUdevRules ]; From cda83120608d10c0f122b2ac472a9c0c3e592b91 Mon Sep 17 00:00:00 2001 From: Cassie Cheung Date: Wed, 19 Feb 2025 14:40:09 +0800 Subject: [PATCH 007/134] apple/t2: format with nixfmt --- apple/t2/default.nix | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/apple/t2/default.nix b/apple/t2/default.nix index d1057caf..2201211a 100644 --- a/apple/t2/default.nix +++ b/apple/t2/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let inherit (lib) types; @@ -9,19 +14,22 @@ let hash = "sha256-x7K0qa++P1e1vuCGxnsFxL1d9+nwMtZUJ6Kd9e27TFs="; }; - audioFilesUdevRules = pkgs.runCommand "audio-files-udev-rules" {} '' + audioFilesUdevRules = pkgs.runCommand "audio-files-udev-rules" { } '' mkdir -p $out/lib/udev/rules.d cp ${audioFiles}/files/*.rules $out/lib/udev/rules.d substituteInPlace $out/lib/udev/rules.d/*.rules --replace "/usr/bin/sed" "${pkgs.gnused}/bin/sed" ''; - overrideAudioFiles = package: pluginsPath: - package.overrideAttrs (new: old: { - preConfigurePhases = old.preConfigurePhases or [ ] ++ [ "postPatchPhase" ]; - postPatchPhase = '' - cp -r ${audioFiles}/files/{profile-sets,paths} ${pluginsPath}/alsa/mixer/ - ''; - }); + overrideAudioFiles = + package: pluginsPath: + package.overrideAttrs ( + new: old: { + preConfigurePhases = old.preConfigurePhases or [ ] ++ [ "postPatchPhase" ]; + postPatchPhase = '' + cp -r ${audioFiles}/files/{profile-sets,paths} ${pluginsPath}/alsa/mixer/ + ''; + } + ); pipewirePackage = overrideAudioFiles pkgs.pipewire "spa/plugins/"; @@ -30,12 +38,12 @@ let in { imports = [ - (lib.mkRemovedOptionModule ["hardware" "apple-t2" "enableTinyDfr"] '' + (lib.mkRemovedOptionModule [ "hardware" "apple-t2" "enableTinyDfr" ] '' The hardware.apple-t2.enableTinyDfr option was deprecated and removed since upstream Nixpkgs now has an identical module. Please migrate to hardware.apple.touchBar. '') - (lib.mkRemovedOptionModule ["hardware" "apple-t2" "enableAppleSetOsLoader"] '' + (lib.mkRemovedOptionModule [ "hardware" "apple-t2" "enableAppleSetOsLoader" ] '' The hardware.apple-t2.enableAppleSetOsLoader option was removed as the apple_set_os functionality was integrated into the kernel. Please uninstall the loader by replacing /esp/EFI/BOOTX64.EFI with /esp/EFI/BOOTX64_original.EFI, where esp is the EFI partition mount point. @@ -68,7 +76,11 @@ in services.udev.packages = [ audioFilesUdevRules ]; # For audio - boot.kernelParams = [ "pcie_ports=compat" "intel_iommu=on" "iommu=pt" ]; + boot.kernelParams = [ + "pcie_ports=compat" + "intel_iommu=on" + "iommu=pt" + ]; hardware.pulseaudio.package = overrideAudioFiles pkgs.pulseaudio "src/modules/"; From fb12c8270abf8933256c5b0ac522776c18bd1dac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laure=CE=B7t?= Date: Wed, 12 Feb 2025 19:27:37 +0100 Subject: [PATCH 008/134] dell/xps/13-9315: fix screen flickering --- dell/xps/13-9315/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dell/xps/13-9315/default.nix b/dell/xps/13-9315/default.nix index 03e16533..92ec28ce 100644 --- a/dell/xps/13-9315/default.nix +++ b/dell/xps/13-9315/default.nix @@ -27,4 +27,7 @@ # enable cooling management, see NixOS/nixos-hardware#127 services.thermald.enable = lib.mkDefault true; + + # fix laptop's screen flickering, see https://wiki.archlinux.org/title/Intel_graphics#Screen_flickering + boot.kernelParams = ["i915.enable_psr=0"]; } From 8f44cbb48c2f4a54e35d991a903a8528178ce1a8 Mon Sep 17 00:00:00 2001 From: Karolis Stasaitis Date: Fri, 7 Feb 2025 18:13:30 +0100 Subject: [PATCH 009/134] raspberry-pi-4: poe-hat: add PWM polarity value --- raspberry-pi/4/poe-hat.nix | 4 ++-- raspberry-pi/4/poe-plus-hat.nix | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/raspberry-pi/4/poe-hat.nix b/raspberry-pi/4/poe-hat.nix index 5d6cf8d0..07bc4e46 100644 --- a/raspberry-pi/4/poe-hat.nix +++ b/raspberry-pi/4/poe-hat.nix @@ -18,7 +18,7 @@ in { hardware.deviceTree = { overlays = [ - # Equivalent to: https://github.com/raspberrypi/linux/blob/rpi-6.1.y/arch/arm/boot/dts/overlays/rpi-poe-overlay.dts + # Equivalent to: https://github.com/raspberrypi/linux/blob/rpi-6.6.y/arch/arm/boot/dts/overlays/rpi-poe-overlay.dts { name = "rpi-poe-overlay"; dtsText = '' @@ -38,7 +38,7 @@ in { compatible = "pwm-fan"; cooling-levels = <0 1 10 100 255>; #cooling-cells = <2>; - pwms = <&fwpwm 0 80000>; + pwms = <&fwpwm 0 80000 0>; }; }; }; diff --git a/raspberry-pi/4/poe-plus-hat.nix b/raspberry-pi/4/poe-plus-hat.nix index bd7c28ec..96f50e40 100644 --- a/raspberry-pi/4/poe-plus-hat.nix +++ b/raspberry-pi/4/poe-plus-hat.nix @@ -19,8 +19,8 @@ in { hardware.deviceTree = { overlays = [ # Combined equivalent to: - # * https://github.com/raspberrypi/linux/blob/rpi-6.1.y/arch/arm/boot/dts/overlays/rpi-poe-overlay.dts - # * https://github.com/raspberrypi/linux/blob/rpi-6.1.y/arch/arm/boot/dts/overlays/rpi-poe-plus-overlay.dts + # * https://github.com/raspberrypi/linux/blob/rpi-6.6.y/arch/arm/boot/dts/overlays/rpi-poe-overlay.dts + # * https://github.com/raspberrypi/linux/blob/rpi-6.6.y/arch/arm/boot/dts/overlays/rpi-poe-plus-overlay.dts { name = "rpi-poe-plus-overlay"; dtsText = '' @@ -40,7 +40,7 @@ in { compatible = "pwm-fan"; cooling-levels = <0 1 10 100 255>; #cooling-cells = <2>; - pwms = <&fwpwm 0 80000>; + pwms = <&fwpwm 0 80000 0>; }; }; }; From 71cca26f33cdef1fb6490b69bbf20f3ca08b1558 Mon Sep 17 00:00:00 2001 From: Louis Opter Date: Thu, 6 Feb 2025 08:11:07 +0000 Subject: [PATCH 010/134] Set Alder Lake support for the Aoostar R1 N100 In order to get micro-code updates, and select the right driver for hardware transcoding on the integrated GPU. --- README.md | 1 + aoostar/r1/n100/default.nix | 12 ++++++++++++ flake.nix | 1 + 3 files changed, 14 insertions(+) create mode 100644 aoostar/r1/n100/default.nix diff --git a/README.md b/README.md index 0b109c34..412d80e6 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,7 @@ See code for all available configurations. | [Apple MacBook Pro 14,1](apple/macbook-pro/14-1) | `` | | [Apple MacMini (2010, Intel, Nvidia)](apple/macmini/4) | `` | | [Apple Macs with a T2 Chip](apple/t2) | `` | +| [Aoostar R1 N100](aoostar/r1/n100) | `` | | [Asus Pro WS X570-ACE](asus/pro-ws-x570-ace) | `` | | [Asus ROG Ally RC71L (2023)](asus/ally/rc71l) | `` | | [Asus ROG Flow X13 GV302X\* (2023)](asus/flow/gv302x/amdgpu) | `` | diff --git a/aoostar/r1/n100/default.nix b/aoostar/r1/n100/default.nix new file mode 100644 index 00000000..b80e0654 --- /dev/null +++ b/aoostar/r1/n100/default.nix @@ -0,0 +1,12 @@ +{ + imports = [ + ../../../common/cpu/intel/alder-lake + ]; + + # lopter@(2025-02-06): according to sensors-detect this comes with an ITE + # IT8613E super io chip, which is not officialy supported yet. See also: + # + # - unofficial driver: https://github.com/frankcrawford/it87 + # - reddit thread on with useful information to configure pwm from the bios: + # https://www.reddit.com/r/MiniPCs/comments/1bnkg1u/aoostar_r1r7_question_does_the_fan_header_support/ +} diff --git a/flake.nix b/flake.nix index 17a36e63..8ef4e52e 100644 --- a/flake.nix +++ b/flake.nix @@ -12,6 +12,7 @@ { acer-aspire-4810t = import ./acer/aspire/4810t; airis-n990 = import ./airis/n990; + aoostar-r1-n100 = import ./aoostar/r1/n100; apple-imac-14-2 = import ./apple/imac/14-2; apple-imac-18-2 = import ./apple/imac/18-2; apple-macbook-air-3 = import ./apple/macbook-air/3; From 099d38a69ed75b6f549aa0daadc08c075d44a4d7 Mon Sep 17 00:00:00 2001 From: Andrew Kvalheim Date: Sat, 8 Feb 2025 09:00:22 -0800 Subject: [PATCH 011/134] lenovo/thinkpad/p16s/amd/gen2: init MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Notes: - Tested on a model 21K9CTR1WW configured with: - AMD Ryzen 7 PRO 7840U with Radeon 780M Graphics - 64 GB soldered RAM - WQUXGA (3840×2400) OLED display - Qualcomm NFA765 wireless network adapter - BIOS version R2FET38W (1.18) - The user guide is shared by: - ThinkPad P14s Gen 4 - ThinkPad P16s Gen 2 - ThinkPad T14 Gen 4 - ThinkPad T16 Gen 2 --- README.md | 1 + flake.nix | 1 + lenovo/thinkpad/p16s/amd/default.nix | 7 +++++++ lenovo/thinkpad/p16s/amd/gen2/default.nix | 5 +++++ lenovo/thinkpad/p16s/default.nix | 6 ++++++ 5 files changed, 20 insertions(+) create mode 100644 lenovo/thinkpad/p16s/amd/default.nix create mode 100644 lenovo/thinkpad/p16s/amd/gen2/default.nix create mode 100644 lenovo/thinkpad/p16s/default.nix diff --git a/README.md b/README.md index 412d80e6..26e7dcbe 100644 --- a/README.md +++ b/README.md @@ -243,6 +243,7 @@ See code for all available configurations. | [Lenovo ThinkPad P14s AMD Gen 4](lenovo/thinkpad/p14s/amd/gen4) | `` | | [Lenovo ThinkPad P14s Intel Gen 3](lenovo/thinkpad/p14s/intel/gen3) | `` | | [Lenovo ThinkPad P16s AMD Gen 1](lenovo/thinkpad/p16s/amd/gen1) | `` | +| [Lenovo ThinkPad P16s AMD Gen 2](lenovo/thinkpad/p16s/amd/gen2) | `` | | [Lenovo ThinkPad P1](lenovo/thinkpad/p1) | `` | | [Lenovo ThinkPad P50](lenovo/thinkpad/p50) | `` | | [Lenovo ThinkPad P51](lenovo/thinkpad/p51) | `` | diff --git a/flake.nix b/flake.nix index 8ef4e52e..b1b88f0b 100644 --- a/flake.nix +++ b/flake.nix @@ -184,6 +184,7 @@ lenovo-thinkpad-p14s-amd-gen4 = import ./lenovo/thinkpad/p14s/amd/gen4; lenovo-thinkpad-p14s-intel-gen3 = import ./lenovo/thinkpad/p14s/intel/gen3; lenovo-thinkpad-p16s-amd-gen1 = import ./lenovo/thinkpad/p16s/amd/gen1; + lenovo-thinkpad-p16s-amd-gen2 = import ./lenovo/thinkpad/p16s/amd/gen2; lenovo-thinkpad-p50 = import ./lenovo/thinkpad/p50; lenovo-thinkpad-p51 = import ./lenovo/thinkpad/p51; lenovo-thinkpad-p52 = import ./lenovo/thinkpad/p52; diff --git a/lenovo/thinkpad/p16s/amd/default.nix b/lenovo/thinkpad/p16s/amd/default.nix new file mode 100644 index 00000000..4dd23b34 --- /dev/null +++ b/lenovo/thinkpad/p16s/amd/default.nix @@ -0,0 +1,7 @@ +{ + imports = [ + ../. + ../../../../common/cpu/amd + ../../../../common/gpu/amd + ]; +} diff --git a/lenovo/thinkpad/p16s/amd/gen2/default.nix b/lenovo/thinkpad/p16s/amd/gen2/default.nix new file mode 100644 index 00000000..665d3d41 --- /dev/null +++ b/lenovo/thinkpad/p16s/amd/gen2/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ../. + ]; +} diff --git a/lenovo/thinkpad/p16s/default.nix b/lenovo/thinkpad/p16s/default.nix new file mode 100644 index 00000000..53a9fdf5 --- /dev/null +++ b/lenovo/thinkpad/p16s/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ../. + ../../../common/pc/laptop/ssd + ]; +} From 80340dcf8634d6a8e0920c5696cad5293fc8b64b Mon Sep 17 00:00:00 2001 From: ZHANG Yuntian Date: Thu, 6 Feb 2025 19:13:51 +0800 Subject: [PATCH 012/134] rockchip/rk3399: reverse dependency order This order works better when we have more SoCs. --- radxa/rock-4c-plus/default.nix | 2 +- rockchip/default.nix | 4 ++++ rockchip/rk3399/default.nix | 6 +----- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/radxa/rock-4c-plus/default.nix b/radxa/rock-4c-plus/default.nix index 5fb9d5d3..5f1b0278 100644 --- a/radxa/rock-4c-plus/default.nix +++ b/radxa/rock-4c-plus/default.nix @@ -9,7 +9,7 @@ let in { imports = [ ../. - ../../rockchip/rk3399 + ../../rockchip ]; options.hardware.radxa.rock-4c-plus = { diff --git a/rockchip/default.nix b/rockchip/default.nix index 461baedd..d8d26720 100644 --- a/rockchip/default.nix +++ b/rockchip/default.nix @@ -6,6 +6,10 @@ let cfg = config.hardware.rockchip; in { + imports = [ + ./rk3399 + ]; + options.hardware.rockchip = { enable = lib.mkEnableOption "Rockchip SoC support"; diskoImageName = lib.mkOption { diff --git a/rockchip/rk3399/default.nix b/rockchip/rk3399/default.nix index 3aea18fd..5748c33e 100644 --- a/rockchip/rk3399/default.nix +++ b/rockchip/rk3399/default.nix @@ -6,12 +6,8 @@ let cfg = config.hardware.rockchip.rk3399; in { - imports = [ - ../. - ]; - options.hardware.rockchip.rk3399 = { - enable = lib.mkEnableOption "Rockchip RK3399 support"; + enable = lib.mkEnableOption "Rockchip RK3399 support"; }; config = lib.mkIf cfg.enable { From 79bc209be8dbb9fd68f1d6612fe0305ea0534099 Mon Sep 17 00:00:00 2001 From: ZHANG Yuntian Date: Thu, 6 Feb 2025 18:46:31 +0800 Subject: [PATCH 013/134] radxa/rock-pi-4: init --- README.md | 1 + flake.nix | 1 + radxa/rock-pi-4/default.nix | 31 +++++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 radxa/rock-pi-4/default.nix diff --git a/README.md b/README.md index 26e7dcbe..134c3d3f 100644 --- a/README.md +++ b/README.md @@ -348,6 +348,7 @@ See code for all available configurations. | [Purism Librem 15v3](purism/librem/13v3) | `` | | [Purism Librem 5r4](purism/librem/5r4) | `` | | [Radxa ROCK 4C+](radxa/rock-4c-plus) | `` | +| [Radxa ROCK Pi 4](radxa/rock-pi-4) | `` | | [Raspberry Pi 2](raspberry-pi/2) | `` | | [Raspberry Pi 3](raspberry-pi/3) | `` | | [Raspberry Pi 4](raspberry-pi/4) | `` | diff --git a/flake.nix b/flake.nix index b1b88f0b..8a1dc042 100644 --- a/flake.nix +++ b/flake.nix @@ -300,6 +300,7 @@ raspberry-pi-4 = import ./raspberry-pi/4; raspberry-pi-5 = import ./raspberry-pi/5; rock-4c-plus = import ./radxa/rock-4c-plus; + rock-pi-4 = import ./radxa/rock-pi-4; kobol-helios4 = import ./kobol/helios4; samsung-np900x3c = import ./samsung/np900x3c; slimbook-hero-rpl-rtx = import ./slimbook/hero/rpl-rtx; diff --git a/radxa/rock-pi-4/default.nix b/radxa/rock-pi-4/default.nix new file mode 100644 index 00000000..3cf2c6a4 --- /dev/null +++ b/radxa/rock-pi-4/default.nix @@ -0,0 +1,31 @@ +{ lib +, pkgs +, config +, ... +}: +let + cfg = config.hardware.radxa.rock-pi-4; + rkCfg = config.hardware.rockchip; +in { + imports = [ + ../. + ../../rockchip + ]; + + options.hardware.radxa.rock-pi-4 = { + platformFirmware = lib.mkPackageOption pkgs "ubootRockPi4" { }; + }; + + config = { + hardware = { + radxa.enable = true; + rockchip = { + rk3399.enable = true; + diskoExtraPostVM = '' + dd conv=notrunc,fsync if=${cfg.platformFirmware}/idbloader.img of=$out/${rkCfg.diskoImageName} bs=512 seek=64 + dd conv=notrunc,fsync if=${cfg.platformFirmware}/u-boot.itb of=$out/${rkCfg.diskoImageName} bs=512 seek=16384 + ''; + }; + }; + }; +} From 28f2a7454f6278ce51c8ce70b2fe8f6452789200 Mon Sep 17 00:00:00 2001 From: ZHANG Yuntian Date: Thu, 6 Feb 2025 18:50:15 +0800 Subject: [PATCH 014/134] rockchip/rk3588: init --- rockchip/default.nix | 1 + rockchip/rk3588/default.nix | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 rockchip/rk3588/default.nix diff --git a/rockchip/default.nix b/rockchip/default.nix index d8d26720..38a451fd 100644 --- a/rockchip/default.nix +++ b/rockchip/default.nix @@ -8,6 +8,7 @@ let in { imports = [ ./rk3399 + ./rk3588 ]; options.hardware.rockchip = { diff --git a/rockchip/rk3588/default.nix b/rockchip/rk3588/default.nix new file mode 100644 index 00000000..cabc04b2 --- /dev/null +++ b/rockchip/rk3588/default.nix @@ -0,0 +1,16 @@ +{ lib +, pkgs +, config +, ... +}: +let + cfg = config.hardware.rockchip.rk3588; +in { + options.hardware.rockchip.rk3588 = { + enable = lib.mkEnableOption "Rockchip RK3588 support"; + }; + + config = lib.mkIf cfg.enable { + hardware.rockchip.enable = true; + }; +} From ab84bd93a3988fcbb2380df6563e575634f4c06f Mon Sep 17 00:00:00 2001 From: ZHANG Yuntian Date: Thu, 6 Feb 2025 18:53:08 +0800 Subject: [PATCH 015/134] radxa/rock-5b: init --- README.md | 1 + flake.nix | 1 + radxa/rock-5b/default.nix | 31 +++++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 radxa/rock-5b/default.nix diff --git a/README.md b/README.md index 134c3d3f..4cad0390 100644 --- a/README.md +++ b/README.md @@ -348,6 +348,7 @@ See code for all available configurations. | [Purism Librem 15v3](purism/librem/13v3) | `` | | [Purism Librem 5r4](purism/librem/5r4) | `` | | [Radxa ROCK 4C+](radxa/rock-4c-plus) | `` | +| [Radxa ROCK 5 Model B](radxa/rock-5b) | `` | | [Radxa ROCK Pi 4](radxa/rock-pi-4) | `` | | [Raspberry Pi 2](raspberry-pi/2) | `` | | [Raspberry Pi 3](raspberry-pi/3) | `` | diff --git a/flake.nix b/flake.nix index 8a1dc042..0051c92b 100644 --- a/flake.nix +++ b/flake.nix @@ -300,6 +300,7 @@ raspberry-pi-4 = import ./raspberry-pi/4; raspberry-pi-5 = import ./raspberry-pi/5; rock-4c-plus = import ./radxa/rock-4c-plus; + rock-5b = import ./radxa/rock-5b; rock-pi-4 = import ./radxa/rock-pi-4; kobol-helios4 = import ./kobol/helios4; samsung-np900x3c = import ./samsung/np900x3c; diff --git a/radxa/rock-5b/default.nix b/radxa/rock-5b/default.nix new file mode 100644 index 00000000..992b5ca2 --- /dev/null +++ b/radxa/rock-5b/default.nix @@ -0,0 +1,31 @@ +{ lib +, pkgs +, config +, ... +}: +let + cfg = config.hardware.radxa.rock-5b; + rkCfg = config.hardware.rockchip; +in { + imports = [ + ../. + ../../rockchip + ]; + + options.hardware.radxa.rock-5b = { + platformFirmware = lib.mkPackageOption pkgs "ubootRock5ModelB" { }; + }; + + config = { + hardware = { + radxa.enable = true; + rockchip = { + rk3588.enable = true; + diskoExtraPostVM = '' + dd conv=notrunc,fsync if=${cfg.platformFirmware}/idbloader.img of=$out/${rkCfg.diskoImageName} bs=512 seek=64 + dd conv=notrunc,fsync if=${cfg.platformFirmware}/u-boot.itb of=$out/${rkCfg.diskoImageName} bs=512 seek=16384 + ''; + }; + }; + }; +} From 0b2e2fe9b312d973d347ec71ec9323685dd17e5b Mon Sep 17 00:00:00 2001 From: ZHANG Yuntian Date: Fri, 7 Feb 2025 14:28:18 +0800 Subject: [PATCH 016/134] rockchip: support generic firmware installation --- radxa/README.md | 4 ++-- radxa/rock-4c-plus/default.nix | 15 ++------------- radxa/rock-5b/default.nix | 15 ++------------- radxa/rock-pi-4/default.nix | 15 ++------------- rockchip/default.nix | 18 ++++++++++++++++-- 5 files changed, 24 insertions(+), 43 deletions(-) diff --git a/radxa/README.md b/radxa/README.md index b17e6b67..b4ec2a97 100644 --- a/radxa/README.md +++ b/radxa/README.md @@ -74,8 +74,8 @@ Below is an annoated flake example to create the initial boot image. # Override the default bootloader with a cross built one. # Use this if you do not have binfmt configured on your system. # For NixOS, please add `boot.binfmt.emulatedSystems = [ "aarch64-linux" ];` to your system configuration. - # Update the system and the firmware package according to your device. - # hardware.radxa.rock-4c-plus.platformFirmware = nixpkgs-unfree.legacyPackages.x86_64-linux.pkgsCross.aarch64-multiplatform.ubootRock4CPlus; + # Read the device module to see how it was configured. + # hardware.rockchip.platformFirmware = nixpkgs-unfree.legacyPackages.x86_64-linux.pkgsCross.aarch64-multiplatform.ubootRock4CPlus; users.users.radxa = { isNormalUser = true; diff --git a/radxa/rock-4c-plus/default.nix b/radxa/rock-4c-plus/default.nix index 5f1b0278..7550483d 100644 --- a/radxa/rock-4c-plus/default.nix +++ b/radxa/rock-4c-plus/default.nix @@ -2,29 +2,18 @@ , pkgs , config , ... -}: -let - cfg = config.hardware.radxa.rock-4c-plus; - rkCfg = config.hardware.rockchip; -in { +}: { imports = [ ../. ../../rockchip ]; - options.hardware.radxa.rock-4c-plus = { - platformFirmware = lib.mkPackageOption pkgs "ubootRock4CPlus" { }; - }; - config = { hardware = { radxa.enable = true; rockchip = { rk3399.enable = true; - diskoExtraPostVM = '' - dd conv=notrunc,fsync if=${cfg.platformFirmware}/idbloader.img of=$out/${rkCfg.diskoImageName} bs=512 seek=64 - dd conv=notrunc,fsync if=${cfg.platformFirmware}/u-boot.itb of=$out/${rkCfg.diskoImageName} bs=512 seek=16384 - ''; + platformFirmware = pkgs.ubootRock4CPlus; }; }; }; diff --git a/radxa/rock-5b/default.nix b/radxa/rock-5b/default.nix index 992b5ca2..aff9a81b 100644 --- a/radxa/rock-5b/default.nix +++ b/radxa/rock-5b/default.nix @@ -2,29 +2,18 @@ , pkgs , config , ... -}: -let - cfg = config.hardware.radxa.rock-5b; - rkCfg = config.hardware.rockchip; -in { +}: { imports = [ ../. ../../rockchip ]; - options.hardware.radxa.rock-5b = { - platformFirmware = lib.mkPackageOption pkgs "ubootRock5ModelB" { }; - }; - config = { hardware = { radxa.enable = true; rockchip = { rk3588.enable = true; - diskoExtraPostVM = '' - dd conv=notrunc,fsync if=${cfg.platformFirmware}/idbloader.img of=$out/${rkCfg.diskoImageName} bs=512 seek=64 - dd conv=notrunc,fsync if=${cfg.platformFirmware}/u-boot.itb of=$out/${rkCfg.diskoImageName} bs=512 seek=16384 - ''; + platformFirmware = pkgs.ubootRock5ModelB; }; }; }; diff --git a/radxa/rock-pi-4/default.nix b/radxa/rock-pi-4/default.nix index 3cf2c6a4..74b97dd9 100644 --- a/radxa/rock-pi-4/default.nix +++ b/radxa/rock-pi-4/default.nix @@ -2,29 +2,18 @@ , pkgs , config , ... -}: -let - cfg = config.hardware.radxa.rock-pi-4; - rkCfg = config.hardware.rockchip; -in { +}: { imports = [ ../. ../../rockchip ]; - options.hardware.radxa.rock-pi-4 = { - platformFirmware = lib.mkPackageOption pkgs "ubootRockPi4" { }; - }; - config = { hardware = { radxa.enable = true; rockchip = { rk3399.enable = true; - diskoExtraPostVM = '' - dd conv=notrunc,fsync if=${cfg.platformFirmware}/idbloader.img of=$out/${rkCfg.diskoImageName} bs=512 seek=64 - dd conv=notrunc,fsync if=${cfg.platformFirmware}/u-boot.itb of=$out/${rkCfg.diskoImageName} bs=512 seek=16384 - ''; + platformFirmware = pkgs.ubootRockPi4; }; }; }; diff --git a/rockchip/default.nix b/rockchip/default.nix index 38a451fd..2d4715d3 100644 --- a/rockchip/default.nix +++ b/rockchip/default.nix @@ -17,12 +17,26 @@ in { type = lib.types.str; default = "main.raw"; description = '' - The output image name for Disko. - Can be used by diskoExtraPostVM. + The output image name of Disko. + You need to match this value with the real image name. Setting it alone + won't change the output image name, as it is controlled by Disko module. + + Can be used in diskoExtraPostVM. ''; }; + platformFirmware = lib.mkPackageOption pkgs "platform firmware" { + default = null; + }; diskoExtraPostVM = lib.mkOption { type = lib.types.str; + default = '' + ${lib.getExe' pkgs.coreutils "dd"} conv=notrunc,fsync if=${config.hardware.rockchip.platformFirmware}/idbloader.img of=$out/${config.hardware.rockchip.diskoImageName} bs=512 seek=64 + ${lib.getExe' pkgs.coreutils "dd"} conv=notrunc,fsync if=${config.hardware.rockchip.platformFirmware}/u-boot.itb of=$out/${config.hardware.rockchip.diskoImageName} bs=512 seek=16384 + ''; + defaultText = lib.literalExpression '' + ${lib.getExe' pkgs.coreutils "dd"} conv=notrunc,fsync if=${config.hardware.rockchip.platformFirmware}/idbloader.img of=$out/${config.hardware.rockchip.diskoImageName} bs=512 seek=64 + ${lib.getExe' pkgs.coreutils "dd"} conv=notrunc,fsync if=${config.hardware.rockchip.platformFirmware}/u-boot.itb of=$out/${config.hardware.rockchip.diskoImageName} bs=512 seek=16384 + ''; description = '' The post VM hook for Disko's Image Builder. Can be used to install platform firmware like U-Boot. From 9d5dedae845305c219e18c5d5d32b3afe42e0f62 Mon Sep 17 00:00:00 2001 From: ZHANG Yuntian Date: Fri, 7 Feb 2025 14:45:09 +0800 Subject: [PATCH 017/134] radxa: clarify that the interface may subject to more changes We might refactor some parts again when we add Amlogic and Allwinner supports. --- radxa/README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/radxa/README.md b/radxa/README.md index b4ec2a97..e5940973 100644 --- a/radxa/README.md +++ b/radxa/README.md @@ -58,7 +58,7 @@ Below is an annoated flake example to create the initial boot image. modules = [ nixos-hardware.nixosModules.rock-4c-plus # Update the system according to your device. disko.nixosModules.disko # disko usage is optional in the running system, but we need it to generate the initial boot image. - "${nixos-hardware}/radxa/disko.nix" # Common Radxa Disko profile. it is system-agnostic. + "${nixos-hardware}/radxa/disko.nix" # Common Radxa Disko profile. It is system-agnostic. { disko = { imageBuilder = { @@ -92,3 +92,13 @@ Below is an annoated flake example to create the initial boot image. }; } ``` + +For most of the supported products, you only need to change the device module ( +i.e. `nixos-hardware.nixosModules.rock-4c-plus`) to match the one you are using. + +## Known issues + +* Currently, the `hardware.radxa` module and Radxa-maintained SoC vendor modules +(eg. `hardware.rockchip`) are tightly coupled and not intended for end-user to +use. Those options are currently used internally for hardware enablement, and +end-user should not need to modify them. Consider those interfaces **unstable**. From 76a98e3958980a4f59bf75bf615347b39f5576c6 Mon Sep 17 00:00:00 2001 From: ZHANG Yuntian Date: Fri, 7 Feb 2025 15:29:06 +0800 Subject: [PATCH 018/134] rockchip/rk3328: init --- rockchip/default.nix | 1 + rockchip/rk3328/default.nix | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 rockchip/rk3328/default.nix diff --git a/rockchip/default.nix b/rockchip/default.nix index 2d4715d3..68bbb83f 100644 --- a/rockchip/default.nix +++ b/rockchip/default.nix @@ -7,6 +7,7 @@ let cfg = config.hardware.rockchip; in { imports = [ + ./rk3328 ./rk3399 ./rk3588 ]; diff --git a/rockchip/rk3328/default.nix b/rockchip/rk3328/default.nix new file mode 100644 index 00000000..f2d53910 --- /dev/null +++ b/rockchip/rk3328/default.nix @@ -0,0 +1,16 @@ +{ lib +, pkgs +, config +, ... +}: +let + cfg = config.hardware.rockchip.rk3328; +in { + options.hardware.rockchip.rk3328 = { + enable = lib.mkEnableOption "Rockchip RK3328 support"; + }; + + config = lib.mkIf cfg.enable { + hardware.rockchip.enable = true; + }; +} From 9430c63e02d72eeb4d42b8df144f833a29d47f2e Mon Sep 17 00:00:00 2001 From: ZHANG Yuntian Date: Fri, 7 Feb 2025 15:33:49 +0800 Subject: [PATCH 019/134] radxa/rock-pi-e: init --- README.md | 1 + flake.nix | 1 + radxa/README.md | 8 ++++++++ radxa/rock-pi-e/default.nix | 20 ++++++++++++++++++++ 4 files changed, 30 insertions(+) create mode 100644 radxa/rock-pi-e/default.nix diff --git a/README.md b/README.md index 4cad0390..adc83e15 100644 --- a/README.md +++ b/README.md @@ -350,6 +350,7 @@ See code for all available configurations. | [Radxa ROCK 4C+](radxa/rock-4c-plus) | `` | | [Radxa ROCK 5 Model B](radxa/rock-5b) | `` | | [Radxa ROCK Pi 4](radxa/rock-pi-4) | `` | +| [Radxa ROCK Pi E](radxa/rock-pi-e) | `` | | [Raspberry Pi 2](raspberry-pi/2) | `` | | [Raspberry Pi 3](raspberry-pi/3) | `` | | [Raspberry Pi 4](raspberry-pi/4) | `` | diff --git a/flake.nix b/flake.nix index 0051c92b..08936002 100644 --- a/flake.nix +++ b/flake.nix @@ -302,6 +302,7 @@ rock-4c-plus = import ./radxa/rock-4c-plus; rock-5b = import ./radxa/rock-5b; rock-pi-4 = import ./radxa/rock-pi-4; + rock-pi-e = import ./radxa/rock-pi-e; kobol-helios4 = import ./kobol/helios4; samsung-np900x3c = import ./samsung/np900x3c; slimbook-hero-rpl-rtx = import ./slimbook/hero/rpl-rtx; diff --git a/radxa/README.md b/radxa/README.md index e5940973..484f2b3f 100644 --- a/radxa/README.md +++ b/radxa/README.md @@ -57,6 +57,14 @@ Below is an annoated flake example to create the initial boot image. system = "aarch64-linux"; modules = [ nixos-hardware.nixosModules.rock-4c-plus # Update the system according to your device. + + # Or, if the default platform firmware is not available in the NixOS version you are using: + # (import nixos-hardware.nixosModules.rock-pi-e { + # lib = nixpkgs-unfree.lib; + # config = nixpkgs-unfree.config; + # pkgs = nixpkgs-unfree.legacyPackages.aarch64-linux; + # }) + disko.nixosModules.disko # disko usage is optional in the running system, but we need it to generate the initial boot image. "${nixos-hardware}/radxa/disko.nix" # Common Radxa Disko profile. It is system-agnostic. { diff --git a/radxa/rock-pi-e/default.nix b/radxa/rock-pi-e/default.nix new file mode 100644 index 00000000..4328ca7b --- /dev/null +++ b/radxa/rock-pi-e/default.nix @@ -0,0 +1,20 @@ +{ lib +, pkgs +, config +, ... +}: { + imports = [ + ../. + ../../rockchip + ]; + + config = { + hardware = { + radxa.enable = true; + rockchip = { + rk3328.enable = true; + platformFirmware = pkgs.ubootRockPiE; + }; + }; + }; +} From bbf25ca940de16f74bf2264935bd748d6793228d Mon Sep 17 00:00:00 2001 From: ZHANG Yuntian Date: Fri, 7 Feb 2025 16:14:39 +0800 Subject: [PATCH 020/134] radxa: allow platformFirmware to be overridable Previously, it was a product-level option with a default value. --- radxa/rock-4c-plus/default.nix | 2 +- radxa/rock-5b/default.nix | 2 +- radxa/rock-pi-4/default.nix | 2 +- radxa/rock-pi-e/default.nix | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/radxa/rock-4c-plus/default.nix b/radxa/rock-4c-plus/default.nix index 7550483d..e432dd74 100644 --- a/radxa/rock-4c-plus/default.nix +++ b/radxa/rock-4c-plus/default.nix @@ -13,7 +13,7 @@ radxa.enable = true; rockchip = { rk3399.enable = true; - platformFirmware = pkgs.ubootRock4CPlus; + platformFirmware = lib.mkDefault pkgs.ubootRock4CPlus; }; }; }; diff --git a/radxa/rock-5b/default.nix b/radxa/rock-5b/default.nix index aff9a81b..c8a899dd 100644 --- a/radxa/rock-5b/default.nix +++ b/radxa/rock-5b/default.nix @@ -13,7 +13,7 @@ radxa.enable = true; rockchip = { rk3588.enable = true; - platformFirmware = pkgs.ubootRock5ModelB; + platformFirmware = lib.mkDefault pkgs.ubootRock5ModelB; }; }; }; diff --git a/radxa/rock-pi-4/default.nix b/radxa/rock-pi-4/default.nix index 74b97dd9..e205a46e 100644 --- a/radxa/rock-pi-4/default.nix +++ b/radxa/rock-pi-4/default.nix @@ -13,7 +13,7 @@ radxa.enable = true; rockchip = { rk3399.enable = true; - platformFirmware = pkgs.ubootRockPi4; + platformFirmware = lib.mkDefault pkgs.ubootRockPi4; }; }; }; diff --git a/radxa/rock-pi-e/default.nix b/radxa/rock-pi-e/default.nix index 4328ca7b..0eec4e9a 100644 --- a/radxa/rock-pi-e/default.nix +++ b/radxa/rock-pi-e/default.nix @@ -13,7 +13,7 @@ radxa.enable = true; rockchip = { rk3328.enable = true; - platformFirmware = pkgs.ubootRockPiE; + platformFirmware = lib.mkDefault pkgs.ubootRockPiE; }; }; }; From 55e9685ec6291cb010d57198dafc2e60bf294b13 Mon Sep 17 00:00:00 2001 From: shouya <526598+shouya@users.noreply.github.com> Date: Mon, 24 Feb 2025 17:29:57 +0900 Subject: [PATCH 021/134] Fix Gigabyte B650 suspend issue (#1385) --- README.md | 1 + flake.nix | 1 + gigabyte/b650/README.md | 5 ----- gigabyte/b650/b650-fix-suspend.nix | 6 ++++++ gigabyte/b650/default.nix | 5 +++++ 5 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 gigabyte/b650/b650-fix-suspend.nix create mode 100644 gigabyte/b650/default.nix diff --git a/README.md b/README.md index adc83e15..05f80eb4 100644 --- a/README.md +++ b/README.md @@ -184,6 +184,7 @@ See code for all available configurations. | [FriendlyARM NanoPi R5s](friendlyarm/nanopi-r5s) | `` | | [Focus M2 Gen 1](focus/m2/gen1) | `` | | [Gigabyte B550](gigabyte/b550) | `` | +| [Gigabyte B650](gigabyte/b650) | `` | | [GPD MicroPC](gpd/micropc) | `` | | [GPD P2 Max](gpd/p2-max) | `` | | [GPD Pocket 3](gpd/pocket-3) | `` | diff --git a/flake.nix b/flake.nix index 08936002..b0ff9508 100644 --- a/flake.nix +++ b/flake.nix @@ -123,6 +123,7 @@ friendlyarm-nanopi-r5s = import ./friendlyarm/nanopi-r5s; focus-m2-gen1 = import ./focus/m2/gen1; gigabyte-b550 = import ./gigabyte/b550; + gigabyte-b650 = import ./gigabyte/b650; google-pixelbook = import ./google/pixelbook; gpd-micropc = import ./gpd/micropc; gpd-p2-max = import ./gpd/p2-max; diff --git a/gigabyte/b650/README.md b/gigabyte/b650/README.md index aeb23cd9..94d20c3c 100644 --- a/gigabyte/b650/README.md +++ b/gigabyte/b650/README.md @@ -6,8 +6,3 @@ bug where the PC will wakeup immediately after going into suspend. ## Affects at least - Gigabyte B650M Aorus Elite AX (Rev. 1.3) (BIOS Version F32b) - - Can not be fixed by modifying enabled entries in /proc/acpi/wakeup. - Computer wakes up even if all enabled entries are disabled. Therefore, no - fix exist currently. - - diff --git a/gigabyte/b650/b650-fix-suspend.nix b/gigabyte/b650/b650-fix-suspend.nix new file mode 100644 index 00000000..b82bd33c --- /dev/null +++ b/gigabyte/b650/b650-fix-suspend.nix @@ -0,0 +1,6 @@ +{ + # see https://bbs.archlinux.org/viewtopic.php?pid=2227023 + boot.kernelParams = [ + "acpi_osi=\"!Windows 2015\"" + ]; +} diff --git a/gigabyte/b650/default.nix b/gigabyte/b650/default.nix new file mode 100644 index 00000000..4b0a77af --- /dev/null +++ b/gigabyte/b650/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./b650-fix-suspend.nix + ]; +} From d58f642ddb23320965b27beb0beba7236e9117b5 Mon Sep 17 00:00:00 2001 From: Nicky Mouha Date: Mon, 20 Jan 2025 01:23:09 -0500 Subject: [PATCH 022/134] Rename dell/e7240 to dell/latitude/e7240 --- README.md | 2 +- dell/e7240/default.nix | 11 +++++++++-- dell/{ => latitude}/e7240/README.md | 0 dell/latitude/e7240/default.nix | 6 ++++++ flake.nix | 5 ++++- 5 files changed, 20 insertions(+), 4 deletions(-) rename dell/{ => latitude}/e7240/README.md (100%) create mode 100644 dell/latitude/e7240/default.nix diff --git a/README.md b/README.md index 05f80eb4..236c0714 100644 --- a/README.md +++ b/README.md @@ -136,6 +136,7 @@ See code for all available configurations. | [Dell Latitude 7430](dell/latitude/7430) | `` | | [Dell Latitude 7490](dell/latitude/7490) | `` | | [Dell Latitude 9430](dell/latitude/9430) | `` | +| [Dell Latitude E7240](dell/latitude/e7240) | `` | | [Dell Optiplex 3050](dell/optiplex/3050) | `` | | [Dell Poweredge R7515](dell/poweredge/r7515) | `` | | [Dell Precision 3541](dell/precision/3541) | `` | @@ -173,7 +174,6 @@ See code for all available configurations. | [Dell XPS 17 9700, intel](dell/xps/17-9700/intel) | `` | | [Dell XPS 17 9710, intel only](dell/xps/17-9710/intel) | `` | -| [Dell XPS E7240](dell/e7240) | `` | | [Framework 11th Gen Intel Core](framework/13-inch/11th-gen-intel) | `` | | [Framework 12th Gen Intel Core](framework/13-inch/12th-gen-intel) | `` | | [Framework 13th Gen Intel Core](framework/13-inch/13th-gen-intel) | `` | diff --git a/dell/e7240/default.nix b/dell/e7240/default.nix index 102da6bb..5b819abf 100644 --- a/dell/e7240/default.nix +++ b/dell/e7240/default.nix @@ -1,6 +1,13 @@ { imports = [ - ../../common/cpu/intel - ../../common/pc/laptop + ../latitude/e7240/default.nix + ]; + + warnings = [ + '' + DEPRECATED: Importing dell/e7240 is deprecated. Use dell/latitude/e7240 instead. + + This module will be removed in a future release. + '' ]; } diff --git a/dell/e7240/README.md b/dell/latitude/e7240/README.md similarity index 100% rename from dell/e7240/README.md rename to dell/latitude/e7240/README.md diff --git a/dell/latitude/e7240/default.nix b/dell/latitude/e7240/default.nix new file mode 100644 index 00000000..14701f94 --- /dev/null +++ b/dell/latitude/e7240/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ../../../common/cpu/intel + ../../../common/pc/laptop + ]; +} diff --git a/flake.nix b/flake.nix index b0ff9508..3a4efd77 100644 --- a/flake.nix +++ b/flake.nix @@ -56,7 +56,9 @@ beagleboard-pocketbeagle = import ./beagleboard/pocketbeagle; chuwi-minibook-x = import ./chuwi/minibook-x; deciso-dec = import ./deciso/dec; - dell-e7240 = import ./dell/e7240; + dell-e7240 = + deprecated "1326" "dell-e7240" + (import ./dell/e7240); dell-g3-3779 = import ./dell/g3/3779; dell-g3-3579 = import ./dell/g3/3579; dell-inspiron-14-5420 = import ./dell/inspiron/14-5420; @@ -74,6 +76,7 @@ dell-latitude-7430 = import ./dell/latitude/7430; dell-latitude-7490 = import ./dell/latitude/7490; dell-latitude-9430 = import ./dell/latitude/9430; + dell-latitude-e7240 = import ./dell/latitude/e7240; dell-optiplex-3050 = import ./dell/optiplex/3050; dell-poweredge-r7515 = import ./dell/poweredge/r7515; dell-precision-3541 = import ./dell/precision/3541; From 009b764ac98a3602d41fc68072eeec5d24fc0e49 Mon Sep 17 00:00:00 2001 From: Cassie Cheung Date: Tue, 25 Feb 2025 08:39:05 +0800 Subject: [PATCH 023/134] apple/t2: update patches for the latest kernel --- apple/t2/pkgs/linux-t2/latest.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/apple/t2/pkgs/linux-t2/latest.json b/apple/t2/pkgs/linux-t2/latest.json index 03c9714b..d5b63805 100644 --- a/apple/t2/pkgs/linux-t2/latest.json +++ b/apple/t2/pkgs/linux-t2/latest.json @@ -1,5 +1,5 @@ { - "base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/8f138bc16772fdeb0fc68b631fb6f66ddae1a0a1/", + "base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/73bbcb413e8c9294c27ec9b53f84d8b19ecd3f05/", "patches": [ { "name": "1001-Add-apple-bce-driver.patch", @@ -97,10 +97,6 @@ "name": "4001-Input-bcm5974-Add-support-for-the-T2-Macs.patch", "hash": "sha256-CaviinY3rYqQh+/DGyeBTzLL/ZfIvguOQlWCs3KN4zc=" }, - { - "name": "5001-wifi-brcmfmac-use-random-seed-flag-for-BCM4355-and-B.patch", - "hash": "sha256-tlKhUNmDfsKat6O8eK1h84qikUj1Kiv9bbBQaZuDQK4=" - }, { "name": "7001-drm-i915-fbdev-Discard-BIOS-framebuffers-exceeding-h.patch", "hash": "sha256-O6RHFxmKZn7aCq1D+r5z2T3jLt0r5+01EABD9rs0E5M=" From d23a3bc3c600a064c72c7fb02862edfab11a46cf Mon Sep 17 00:00:00 2001 From: matthiasdotsh Date: Fri, 28 Feb 2025 10:17:05 +0100 Subject: [PATCH 024/134] surface: linux 6.12.16 -> 6.12.17 --- microsoft/surface/common/kernel/linux-surface/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/microsoft/surface/common/kernel/linux-surface/default.nix b/microsoft/surface/common/kernel/linux-surface/default.nix index 0a784528..f78aad86 100644 --- a/microsoft/surface/common/kernel/linux-surface/default.nix +++ b/microsoft/surface/common/kernel/linux-surface/default.nix @@ -7,14 +7,14 @@ let cfg = config.microsoft-surface; - version = "6.12.16"; + version = "6.12.17"; kernelPatches = surfacePatches { inherit version; patchFn = ./patches.nix; }; kernelPackages = linuxPackage { inherit version kernelPatches; - sha256 = "sha256-X4E2KmlPUVIL/5+uy3PxzJvHvs5v3RDVwn40jfOdfcQ="; + sha256 = "sha256-XCBc00+Al05Jc+MhywCPX2iVqKqMJXfwapRIzXfeY7M="; ignoreConfigErrors=true; }; From 52cfc084ef508ec25ea960afc2995032b679b45e Mon Sep 17 00:00:00 2001 From: ccritter <19559103+ccritter@users.noreply.github.com> Date: Mon, 24 Feb 2025 17:28:38 -0800 Subject: [PATCH 025/134] dell/inspiron/7559: add + corresponding Skylake architecture configuration. --- README.md | 3 +- common/cpu/intel/skylake/cpu-only.nix | 5 +++ common/cpu/intel/skylake/default.nix | 6 +++ common/gpu/intel/skylake/default.nix | 18 +++++++++ dell/inspiron/7559/README.md | 58 +++++++++++++++++++++++++++ dell/inspiron/7559/default.nix | 24 +++++++++++ flake.nix | 1 + 7 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 common/cpu/intel/skylake/cpu-only.nix create mode 100644 common/cpu/intel/skylake/default.nix create mode 100644 common/gpu/intel/skylake/default.nix create mode 100644 dell/inspiron/7559/README.md create mode 100644 dell/inspiron/7559/default.nix diff --git a/README.md b/README.md index 236c0714..3b8a0b50 100644 --- a/README.md +++ b/README.md @@ -120,12 +120,13 @@ See code for all available configurations. | [Deciso DEC series](deciso/dec) | `` | | [Dell G3 3779](dell/g3/3779) | `` | | [Dell G3 3579](dell/g3/3579) | `` | -| [Dell Inspiron 3442](dell/inspiron/3442) | `` | +| [Dell Inspiron 3442](dell/inspiron/3442) | `` | | [Dell Inspiron 14 5420](dell/inspiron/14-5420) | `` | | [Dell Inspiron 5509](dell/inspiron/5509) | `` | | [Dell Inspiron 5515](dell/inspiron/5515) | `` | | [Dell Inspiron 7405](dell/inspiron/7405) | `` | | [Dell Inspiron 7460](dell/inspiron/7460) | `` | +| [Dell Inspiron 7559](dell/inspiron/7559) | `` | | [Dell Latitude 3340](dell/latitude/3340) | `` | | [Dell Latitude 3480](dell/latitude/3480) | `` | | [Dell Latitude 5490](dell/latitude/5490) | `` | diff --git a/common/cpu/intel/skylake/cpu-only.nix b/common/cpu/intel/skylake/cpu-only.nix new file mode 100644 index 00000000..82892615 --- /dev/null +++ b/common/cpu/intel/skylake/cpu-only.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ../cpu-only.nix + ]; +} diff --git a/common/cpu/intel/skylake/default.nix b/common/cpu/intel/skylake/default.nix new file mode 100644 index 00000000..80deef3f --- /dev/null +++ b/common/cpu/intel/skylake/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./cpu-only.nix + ../../../gpu/intel/skylake + ]; +} diff --git a/common/gpu/intel/skylake/default.nix b/common/gpu/intel/skylake/default.nix new file mode 100644 index 00000000..e9c24279 --- /dev/null +++ b/common/gpu/intel/skylake/default.nix @@ -0,0 +1,18 @@ +{ pkgs, ... }: + +{ + imports = [ ../. ]; + + boot.kernelParams = [ + "i915.enable_guc=2" + ]; + + # VP9 decoding not supported when using intel-media-driver + # https://github.com/intel/media-driver/issues/1024 + # NixOS Wiki recommends using the legacy intel-vaapi-driver with the hybrid codec over that one for Skylake. + # https://wiki.nixos.org/wiki/Accelerated_Video_Playback + hardware.intelgpu = { + vaapiDriver = "intel-vaapi-driver"; + enableHybridCodec = true; + }; +} diff --git a/dell/inspiron/7559/README.md b/dell/inspiron/7559/README.md new file mode 100644 index 00000000..a1bb0427 --- /dev/null +++ b/dell/inspiron/7559/README.md @@ -0,0 +1,58 @@ +## Dell Inspiron 7559 + +### Tested Hardware + +```shellsession +$ lspci -nn +00:00.0 Host bridge [0600]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers [8086:1910] (rev 07) +00:01.0 PCI bridge [0604]: Intel Corporation 6th-10th Gen Core Processor PCIe Controller (x16) [8086:1901] (rev 07) +00:01.1 PCI bridge [0604]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x8) [8086:1905] (rev 07) +00:02.0 VGA compatible controller [0300]: Intel Corporation HD Graphics 530 [8086:191b] (rev 06) +00:04.0 Signal processing controller [1180]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem [8086:1903] (rev 07) +00:14.0 USB controller [0c03]: Intel Corporation 100 Series/C230 Series Chipset Family USB 3.0 xHCI Controller [8086:a12f] (rev 31) +00:14.2 Signal processing controller [1180]: Intel Corporation 100 Series/C230 Series Chipset Family Thermal Subsystem [8086:a131] (rev 31) +00:15.0 Signal processing controller [1180]: Intel Corporation 100 Series/C230 Series Chipset Family Serial IO I2C Controller #0 [8086:a160] (rev 31) +00:16.0 Communication controller [0780]: Intel Corporation 100 Series/C230 Series Chipset Family MEI Controller #1 [8086:a13a] (rev 31) +00:17.0 SATA controller [0106]: Intel Corporation HM170/QM170 Chipset SATA Controller [AHCI Mode] [8086:a103] (rev 31) +00:1c.0 PCI bridge [0604]: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #1 [8086:a110] (rev f1) +00:1c.4 PCI bridge [0604]: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #5 [8086:a114] (rev f1) +00:1c.5 PCI bridge [0604]: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #6 [8086:a115] (rev f1) +00:1c.6 PCI bridge [0604]: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #7 [8086:a116] (rev f1) +00:1f.0 ISA bridge [0601]: Intel Corporation HM170 Chipset LPC/eSPI Controller [8086:a14e] (rev 31) +00:1f.2 Memory controller [0580]: Intel Corporation 100 Series/C230 Series Chipset Family Power Management Controller [8086:a121] (rev 31) +00:1f.3 Audio device [0403]: Intel Corporation 100 Series/C230 Series Chipset Family HD Audio Controller [8086:a170] (rev 31) +00:1f.4 SMBus [0c05]: Intel Corporation 100 Series/C230 Series Chipset Family SMBus [8086:a123] (rev 31) +02:00.0 3D controller [0302]: NVIDIA Corporation GM107M [GeForce GTX 960M] [10de:139b] (rev a2) +04:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 10) +05:00.0 Network controller [0280]: Intel Corporation Wireless 3165 [8086:3165] (rev 79) +06:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS522A PCI Express Card Reader [10ec:522a] (rev 01) + +``` + +### Extra Configuration + +#### Bluetooth + +To enable bluetooth support, set `hardware.bluetooth.enable = true;`. + +#### Prime Offloading + +This configuration uses Nvidia Prime offloading, which allows use of the `nvidia-offload` script for running commands on the dGPU. For example, you can instruct Steam to launch a game offloaded to the GPU by setting the launch options for that game to `nvidia-offload %command%`. + +#### SSD + +This laptop has an optional M.2 SSD slot, which isn't accounted for here. If you are using the SSD, you could look into implementing the options in [ssd](common/pc/laptop/ssd) manually. Some sources also say you should ensure your SATA Mode is set to AHCI in your BIOS for it to be detected, however I think this is a prerequisite to installing Linux on this laptop in the first place so you probably already have that set. + +#### Subwoofer + +Tested with the default PipeWire configuration on Plasma, the subwoofer appears to work depending on the device Profile in sound settings ("Analog Stereo Duplex" works best for me). I have had issues with it in the past on other distros, so if it's not working on your system you could try the solution in [this thread](https://bbs.archlinux.org/viewtopic.php?id=207222). + +#### Other issues + +There are plenty of documented bugs and threads around issues on Dell laptops like this. Some of them stem from using the nouveau drivers, but we're using the proprietary Nvidia drivers here. Some things to look into if you're experiencing issues: + +* I/O is slow: `nouveau` could be added as a kernel blocklist item: searching this repo shows other laptops with this configuration +* Power drain while sleeping: add the following as boot.kernelParams: `"mem_sleep_default=deep"` +* Issues coming back from suspend (particularly if the previous kernelParam is applied): add the following as boot.kernelParams: `"acpi_rev_override=1"` `"acpi_osi=Linux"` + * I also spotted [one person recommending](https://connorkuehl.github.io/dell-inspiron-7559-linux-guide/) setting just `"acpi_osi="`. This article is quite old though and I haven't tested the difference. +* Brightness function keys don't work: add the following as boot.kernelParams: `"acpi_backlight=vendor"` or `"acpi_backlight=native"` diff --git a/dell/inspiron/7559/default.nix b/dell/inspiron/7559/default.nix new file mode 100644 index 00000000..da837ba2 --- /dev/null +++ b/dell/inspiron/7559/default.nix @@ -0,0 +1,24 @@ +{ lib, ... }: + +{ + imports = [ + ../../../common/pc/laptop + ../../../common/pc/laptop/hdd + ../../../common/cpu/intel/skylake + ../../../common/gpu/nvidia/maxwell + ../../../common/gpu/nvidia/prime.nix + ]; + + hardware = { + nvidia.prime = { + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:2:0:0"; + }; + + enableRedistributableFirmware = lib.mkDefault true; + }; + + services = { + thermald.enable = lib.mkDefault true; + }; +} diff --git a/flake.nix b/flake.nix index 3a4efd77..96ee8c39 100644 --- a/flake.nix +++ b/flake.nix @@ -66,6 +66,7 @@ dell-inspiron-5515 = import ./dell/inspiron/5515; dell-inspiron-7405 = import ./dell/inspiron/7405; dell-inspiron-7460 = import ./dell/inspiron/7460; + dell-inspiron-7559 = import ./dell/inspiron/7559; dell-latitude-3340 = import ./dell/latitude/3340; dell-latitude-3480 = import ./dell/latitude/3480; dell-latitude-5490 = import ./dell/latitude/5490; From 5335d4303bb020eb43acdcd16a872468091aa649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 7 Mar 2025 05:04:17 +0100 Subject: [PATCH 026/134] README: fix typos in the examples and make formatting more consistent --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3b8a0b50..d52bc426 100644 --- a/README.md +++ b/README.md @@ -120,8 +120,8 @@ See code for all available configurations. | [Deciso DEC series](deciso/dec) | `` | | [Dell G3 3779](dell/g3/3779) | `` | | [Dell G3 3579](dell/g3/3579) | `` | -| [Dell Inspiron 3442](dell/inspiron/3442) | `` | -| [Dell Inspiron 14 5420](dell/inspiron/14-5420) | `` | +| [Dell Inspiron 3442](dell/inspiron/3442) | `` | +| [Dell Inspiron 14 5420](dell/inspiron/14-5420) | `` | | [Dell Inspiron 5509](dell/inspiron/5509) | `` | | [Dell Inspiron 5515](dell/inspiron/5515) | `` | | [Dell Inspiron 7405](dell/inspiron/7405) | `` | @@ -310,8 +310,8 @@ See code for all available configurations. | [LENOVO Yoga 6 13ALC6 82ND](lenovo/yoga/6/13ALC6) | `` | | [LENOVO Yoga Slim 7 Pro-X 14ARH7 82ND](lenovo/yoga/7/14ARH7/amdgpu) | `` | | [LENOVO Yoga Slim 7 Pro-X 14ARH7 82ND](lenovo/yoga/7/14ARH7/nvidia) | `` | -| [Lenovo Yoga Slim 7i Pro X 14IAH7 (Integrated)](lenovo/yoga/7/14IAH7/integrated) |`` | -| [Lenovo Yoga Slim 7i Pro X 14IAH7 (Hybrid)](lenovo/yoga/7/14IAH7/hybrid) |`` | +| [Lenovo Yoga Slim 7i Pro X 14IAH7 (Integrated)](lenovo/yoga/7/14IAH7/integrated) | `` | +| [Lenovo Yoga Slim 7i Pro X 14IAH7 (Hybrid)](lenovo/yoga/7/14IAH7/hybrid) | `` | | [LENOVO Yoga 7 Slim Gen8](lenovo/yoga/7/slim/gen8) | `` | | [MSI B550-A PRO](msi/b550-a-pro) | `` | | [MSI B350 TOMAHAWK](msi/b350-tomahawk) | `` | From 71ab5581a0f646e30482a3c39d7bd23f21425f12 Mon Sep 17 00:00:00 2001 From: Cassie Cheung Date: Tue, 4 Mar 2025 00:43:48 +0800 Subject: [PATCH 027/134] apple/t2: update patches --- apple/t2/pkgs/linux-t2/latest.json | 14 +++++--------- apple/t2/pkgs/linux-t2/stable.json | 14 +++++--------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/apple/t2/pkgs/linux-t2/latest.json b/apple/t2/pkgs/linux-t2/latest.json index d5b63805..5a1dfdcc 100644 --- a/apple/t2/pkgs/linux-t2/latest.json +++ b/apple/t2/pkgs/linux-t2/latest.json @@ -1,5 +1,5 @@ { - "base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/73bbcb413e8c9294c27ec9b53f84d8b19ecd3f05/", + "base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/2f093ab779b24997c3cbd9c2abb2e114bc34addb/", "patches": [ { "name": "1001-Add-apple-bce-driver.patch", @@ -38,16 +38,12 @@ "hash": "sha256-TJjXAlQ4WEROnq/xd6/4JHTuEJjqT7dLLcE4etKdzc0=" }, { - "name": "1012-lib-vsprintf-Add-support-for-generic-FOURCCs-by-exte.patch", - "hash": "sha256-cMl4WJcT/nM/z12LEsnLxssQgnRqKE+d/P2uMr5PUDQ=" - }, - { - "name": "1014-drm-format-helper-add-helper-for-BGR888-to-XRGB8888-.patch", - "hash": "sha256-iBM2z+/jZb/3+c9wHjC7W359oRl+DzFDZ1KL5eUc3qo=" + "name": "1014-drm-format-helper-Add-conversion-from-XRGB8888-to-BG.patch", + "hash": "sha256-Ky19+cCiYDaHBh2o5IhZO8J1ExDT7o8K9cgPz+AL8Cg=" }, { "name": "1015-drm-tiny-add-driver-for-Apple-Touch-Bars-in-x86-Macs.patch", - "hash": "sha256-sTb+ruY6W18wz9XRJzZKlfl4a8fGo1nrtCoOYNaPAjI=" + "hash": "sha256-wlMVeoDQtSRtGuquHKtAHvrGUzZOLxiwkmHj12ZQ8o0=" }, { "name": "2008-i915-4-lane-quirk-for-mbp15-1.patch", @@ -103,7 +99,7 @@ }, { "name": "8001-Add-APFS-driver.patch", - "hash": "sha256-40Gl8eR9RB6qEoU+vY7+sVWms8e566OUmAb9LZWZK3w=" + "hash": "sha256-qwLxBY0wDEPBqP32IcGS1Jd/5BlgMFxXu1z2N7+Ti50=" }, { "name": "8002-Necessary-modifications-to-build-APFS-with-the-kerne.patch", diff --git a/apple/t2/pkgs/linux-t2/stable.json b/apple/t2/pkgs/linux-t2/stable.json index ce38004c..5e672ec3 100644 --- a/apple/t2/pkgs/linux-t2/stable.json +++ b/apple/t2/pkgs/linux-t2/stable.json @@ -1,5 +1,5 @@ { - "base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/19c29ff4bbda9f512b7b69d63d249de269dc66ab/", + "base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/361d2cef87bb76ba14a24d30ed1479393d92be6f/", "patches": [ { "name": "1001-Add-apple-bce-driver.patch", @@ -38,16 +38,12 @@ "hash": "sha256-TJjXAlQ4WEROnq/xd6/4JHTuEJjqT7dLLcE4etKdzc0=" }, { - "name": "1012-lib-vsprintf-Add-support-for-generic-FOURCCs-by-exte.patch", - "hash": "sha256-cMl4WJcT/nM/z12LEsnLxssQgnRqKE+d/P2uMr5PUDQ=" - }, - { - "name": "1014-drm-format-helper-add-helper-for-BGR888-to-XRGB8888-.patch", - "hash": "sha256-iBM2z+/jZb/3+c9wHjC7W359oRl+DzFDZ1KL5eUc3qo=" + "name": "1014-drm-format-helper-Add-conversion-from-XRGB8888-to-BG.patch", + "hash": "sha256-Ky19+cCiYDaHBh2o5IhZO8J1ExDT7o8K9cgPz+AL8Cg=" }, { "name": "1015-drm-tiny-add-driver-for-Apple-Touch-Bars-in-x86-Macs.patch", - "hash": "sha256-sTb+ruY6W18wz9XRJzZKlfl4a8fGo1nrtCoOYNaPAjI=" + "hash": "sha256-wlMVeoDQtSRtGuquHKtAHvrGUzZOLxiwkmHj12ZQ8o0=" }, { "name": "2008-i915-4-lane-quirk-for-mbp15-1.patch", @@ -103,7 +99,7 @@ }, { "name": "8001-Add-APFS-driver.patch", - "hash": "sha256-RjEhzCqGvwRSGFjMgg1Z1kFwbxB9VT3SkVKoOdtDvP0=" + "hash": "sha256-oyk6K8smAWkNS2aFauCugP+9R5hJRaIhNBa9oEreIBU=" }, { "name": "8002-Necessary-modifications-to-build-APFS-with-the-kerne.patch", From ae546d018a7f23e3ca35fdcaf31be4ff8d148d80 Mon Sep 17 00:00:00 2001 From: Johannes Karl Arnold Date: Sun, 23 Feb 2025 10:56:31 +0100 Subject: [PATCH 028/134] Add support for TUXEDO InfinityBook Pro Intel Gen9 --- README.md | 1 + flake.nix | 1 + tuxedo/infinitybook/default.nix | 12 ++++++++++++ tuxedo/infinitybook/pro14/gen7/default.nix | 3 +-- tuxedo/infinitybook/pro14/gen9-intel/README.md | 1 + tuxedo/infinitybook/pro14/gen9-intel/default.nix | 6 ++++++ 6 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 tuxedo/infinitybook/default.nix create mode 100644 tuxedo/infinitybook/pro14/gen9-intel/README.md create mode 100644 tuxedo/infinitybook/pro14/gen9-intel/default.nix diff --git a/README.md b/README.md index d52bc426..342f8b56 100644 --- a/README.md +++ b/README.md @@ -374,6 +374,7 @@ See code for all available configurations. | [Tuxedo InfinityBook v4](tuxedo/infinitybook/v4) | `` | | [TUXEDO Aura 15 - Gen1](tuxedo/aura/15/gen1) | `` | | [TUXEDO InfinityBook Pro 14 - Gen7](tuxedo/infinitybook/pro14/gen7) | `` | +| [TUXEDO InfinityBook Pro 14 - Gen9 - INTEL](tuxedo/infinitybook/pro14/gen9-intel) | `` | | [TUXEDO Pulse 14 - Gen3](tuxedo/pulse/14/gen3) | `` | | [TUXEDO Pulse 15 - Gen2](tuxedo/pulse/15/gen2) | `` | | [Xiaomi Redmibook 16 Pro 2024](xiaomi/redmibook/16-pro-2024) | `` | diff --git a/flake.nix b/flake.nix index 96ee8c39..0a0f505f 100644 --- a/flake.nix +++ b/flake.nix @@ -327,6 +327,7 @@ tuxedo-aura-15-gen1 = import ./tuxedo/aura/15/gen1; tuxedo-infinitybook-v4 = import ./tuxedo/infinitybook/v4; tuxedo-infinitybook-pro14-gen7 = import ./tuxedo/infinitybook/pro14/gen7; + tuxedo-infinitybook-pro14-gen9-intel = import ./tuxedo/infinitybook/pro14/gen9-intel; tuxedo-pulse-14-gen3 = import ./tuxedo/pulse/14/gen3; tuxedo-pulse-15-gen2 = import ./tuxedo/pulse/15/gen2; xiaomi-redmibook-16-pro-2024 = import ./xiaomi/redmibook/16-pro-2024; diff --git a/tuxedo/infinitybook/default.nix b/tuxedo/infinitybook/default.nix new file mode 100644 index 00000000..99f53fcd --- /dev/null +++ b/tuxedo/infinitybook/default.nix @@ -0,0 +1,12 @@ +{ lib, options, ... }: +{ + imports = [ + ../../common/pc/laptop + ../../common/pc/ssd + ]; + + # Enable TUXEDO's kernel drivers if they are available + hardware = lib.optionalAttrs (options.hardware ? tuxedo-drivers) { + tuxedo-drivers.enable = lib.mkDefault true; + }; +} diff --git a/tuxedo/infinitybook/pro14/gen7/default.nix b/tuxedo/infinitybook/pro14/gen7/default.nix index 9971b7bc..271302b2 100644 --- a/tuxedo/infinitybook/pro14/gen7/default.nix +++ b/tuxedo/infinitybook/pro14/gen7/default.nix @@ -2,9 +2,8 @@ { imports = [ + ../../. ../../../../common/cpu/intel - ../../../../common/pc/laptop - ../../../../common/pc/ssd ]; # Cooling management diff --git a/tuxedo/infinitybook/pro14/gen9-intel/README.md b/tuxedo/infinitybook/pro14/gen9-intel/README.md new file mode 100644 index 00000000..d91a3e68 --- /dev/null +++ b/tuxedo/infinitybook/pro14/gen9-intel/README.md @@ -0,0 +1 @@ +# [TUXEDO InfinityBook Pro 14 - Gen9 - INTEL](https://www.tuxedocomputers.com/en/TUXEDO-InfinityBook-Pro-14-Gen9-INTEL) diff --git a/tuxedo/infinitybook/pro14/gen9-intel/default.nix b/tuxedo/infinitybook/pro14/gen9-intel/default.nix new file mode 100644 index 00000000..4b6ee893 --- /dev/null +++ b/tuxedo/infinitybook/pro14/gen9-intel/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ../../. + ../../../../common/cpu/intel + ]; +} From b48cc4dab0f9711af296fc367b6108cf7b8ccb16 Mon Sep 17 00:00:00 2001 From: Erik Alonso Date: Mon, 24 Feb 2025 12:34:38 +0000 Subject: [PATCH 029/134] pine64/rockpro64: HDMI output and Network in initrd --- pine64/rockpro64/README.md | 8 ++++++++ pine64/rockpro64/console.nix | 17 +++++++++++++++++ pine64/rockpro64/default.nix | 7 +++++++ 3 files changed, 32 insertions(+) create mode 100644 pine64/rockpro64/console.nix diff --git a/pine64/rockpro64/README.md b/pine64/rockpro64/README.md index e4695a47..5eced1c6 100644 --- a/pine64/rockpro64/README.md +++ b/pine64/rockpro64/README.md @@ -12,3 +12,11 @@ firmware. Alternatively, starting from the _Tow-Boot_ disk image on eMMC is easier to deal with and understand than having to deal with _U-Boot_ manually. + +## Console + +To configure default console I/O to use serial instead of HDMI (default): + +```nix +hardware.rockpro64.console = "serial"; +``` diff --git a/pine64/rockpro64/console.nix b/pine64/rockpro64/console.nix new file mode 100644 index 00000000..d8a213dc --- /dev/null +++ b/pine64/rockpro64/console.nix @@ -0,0 +1,17 @@ +{ config, lib, ... }: +{ + options.hardware.rockpro64.console = lib.mkOption { + default = "hdmi"; + description = "Default console to use at boot."; + type = lib.types.enum [ + "hdmi" + "serial" + ]; + }; + config = lib.mkIf (config.hardware.rockpro64.console == "hdmi") { + boot.kernelParams = [ + "console=ttyS0" + "console=tty0" + ]; + }; +} diff --git a/pine64/rockpro64/default.nix b/pine64/rockpro64/default.nix index 9ac08e83..22f82195 100644 --- a/pine64/rockpro64/default.nix +++ b/pine64/rockpro64/default.nix @@ -1,10 +1,17 @@ { lib, ... }: { + imports = [ + ./console.nix + ]; boot.initrd.kernelModules = [ # PCIe/NVMe "nvme" "pcie_rockchip_host" "phy_rockchip_pcie" + # Network + "dwmac_rk" + # HDMI + "rockchipdrm" ]; # control the fan on the rockpro64 (like the one in the NAS case) hardware.fancontrol = { From d25dac1bd5eed6fbf67eb79d1f15d624e5a2c032 Mon Sep 17 00:00:00 2001 From: Ryan Horiguchi Date: Wed, 12 Mar 2025 15:25:55 +0100 Subject: [PATCH 030/134] dell/xps/13-9350: use lunar-lake cpu config --- dell/xps/13-9350/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dell/xps/13-9350/default.nix b/dell/xps/13-9350/default.nix index 38c27865..8ee58b2c 100644 --- a/dell/xps/13-9350/default.nix +++ b/dell/xps/13-9350/default.nix @@ -2,7 +2,7 @@ { imports = [ - ../../../common/cpu/intel + ../../../common/cpu/intel/lunar-lake ../../../common/pc/laptop ../../../common/pc/laptop/ssd ]; From 14f45c1a639118ec3e08ebd18285895fb5dc8ad9 Mon Sep 17 00:00:00 2001 From: Cryolitia PukNgae Date: Tue, 11 Mar 2025 03:40:48 +0800 Subject: [PATCH 031/134] gpd-win-max-2-2023/bmi260: 1.0.0 -> 1.1.0 fix: https://github.com/NixOS/nixos-hardware/issues/1352 --- gpd/win-max-2/2023/bmi260/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gpd/win-max-2/2023/bmi260/package.nix b/gpd/win-max-2/2023/bmi260/package.nix index a1e2db4f..78464736 100644 --- a/gpd/win-max-2/2023/bmi260/package.nix +++ b/gpd/win-max-2/2023/bmi260/package.nix @@ -7,13 +7,13 @@ stdenv.mkDerivation (finalAttr: { pname = "bmi260"; - version = "1.0.0"; + version = "1.1.0"; src = fetchFromGitHub { owner = "hhd-dev"; repo = finalAttr.pname; rev = "v${finalAttr.version}"; - hash = "sha256-EFous0pPpCuVoCsFz6/4NryQRSH9Jw9Qng+RY1hiX1c="; + hash = "sha256-So8rWDTXYsMUgLBU9WrJp47txA8dI98tcxXNy92AYgg="; }; hardeningDisable = [ "pic" ]; @@ -38,6 +38,6 @@ stdenv.mkDerivation (finalAttr: { gpl2Only ]; maintainers = with maintainers; [ Cryolitia ]; - platforms = platforms.linux; + platforms = [ "x86_64-linux" ]; }; }) From 59314eb9f5f542af1866ae8706ac9816542fc104 Mon Sep 17 00:00:00 2001 From: matthiasdotsh Date: Sun, 9 Mar 2025 12:13:13 +0100 Subject: [PATCH 032/134] surface: linux 6.12.17 -> 6.12.18 --- microsoft/surface/common/kernel/linux-surface/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/microsoft/surface/common/kernel/linux-surface/default.nix b/microsoft/surface/common/kernel/linux-surface/default.nix index f78aad86..ada42185 100644 --- a/microsoft/surface/common/kernel/linux-surface/default.nix +++ b/microsoft/surface/common/kernel/linux-surface/default.nix @@ -7,14 +7,14 @@ let cfg = config.microsoft-surface; - version = "6.12.17"; + version = "6.12.18"; kernelPatches = surfacePatches { inherit version; patchFn = ./patches.nix; }; kernelPackages = linuxPackage { inherit version kernelPatches; - sha256 = "sha256-XCBc00+Al05Jc+MhywCPX2iVqKqMJXfwapRIzXfeY7M="; + sha256 = "sha256-vrkCpfadnldxARIgPbOBEdrW0wVW6ozjiShMgHf+lE0="; ignoreConfigErrors=true; }; From b416c1d56f33bf902625b2cd0ee43dbc59fc64dd Mon Sep 17 00:00:00 2001 From: Marien Zwart Date: Mon, 24 Feb 2025 21:23:15 +1100 Subject: [PATCH 033/134] Simplify implementation of B550 suspend fix Instead of using systemd oneshot services that have to be careful to not toggle wakeups back on, use a udev rule to disable wakeups by device ID. On a B550 Vision D, these do almost the same thing: ```` $ lspci -n | grep 1022:1483 00:01.1 0604: 1022:1483 00:01.2 0604: 1022:1483 00:03.1 0604: 1022:1483 $ cat /proc/acpi/wakeup Device S-state Status Sysfs node ... GPP0 S4 *disabled pci:0000:00:01.1 GPP8 S4 *disabled pci:0000:00:03.1 ```` Two of the three devices with the PCI vendor/device ID specified by the udev rule correspond to devices previously disabled via ACPI (if I understand correctly disabling these via either /proc/acpi/wakeup or udev device attribute has the same effect). The third device is (like the other two) using the "pcieport" driver. Using a device connected via that port as a wakeup device still works. --- gigabyte/b550/b550-fix-suspend.nix | 44 ++++++++---------------------- 1 file changed, 11 insertions(+), 33 deletions(-) diff --git a/gigabyte/b550/b550-fix-suspend.nix b/gigabyte/b550/b550-fix-suspend.nix index 49868093..abc04a2d 100644 --- a/gigabyte/b550/b550-fix-suspend.nix +++ b/gigabyte/b550/b550-fix-suspend.nix @@ -1,35 +1,13 @@ -{ pkgs, lib, ... } : - { - systemd.services.bugfixSuspend-GPP0 = { - enable = lib.mkDefault true; - description = "Fix crash on wakeup from suspend/hibernate (b550 bugfix)"; - unitConfig = { - Type = "oneshot"; - }; - serviceConfig = { - User = "root"; # root may not be necessary - # check for gppN, disable if enabled - # lifted from https://www.reddit.com/r/gigabyte/comments/p5ewjn/comment/ksbm0mb/ /u/Demotay - ExecStart = "-${pkgs.bash}/bin/bash -c 'if grep 'GPP0' /proc/acpi/wakeup | grep -q 'enabled'; then echo 'GPP0' > /proc/acpi/wakeup; fi'"; - RemainAfterExit = "yes"; # required to not toggle when `nixos-rebuild switch` is ran - - }; - wantedBy = ["multi-user.target"]; - }; - - systemd.services.bugfixSuspend-GPP8 = { - enable = lib.mkDefault true; - description = "Fix crash on wakeup from suspend/hibernate (b550 bugfix)"; - unitConfig = { - Type = "oneshot"; - }; - serviceConfig = { - User = "root"; - ExecStart = "-${pkgs.bash}/bin/bash -c 'if grep 'GPP8' /proc/acpi/wakeup | grep -q 'enabled'; then echo 'GPP8' > /proc/acpi/wakeup; fi'"; - RemainAfterExit = "yes"; - }; - wantedBy = ["multi-user.target"]; - }; - + # Work around an issue causing the system to unsuspend immediately after suspend + # and/or hang after suspend. + # + # See https://www.reddit.com/r/gigabyte/comments/p5ewjn/comment/ksbm0mb/ /u/Demotay + # + # Most suggestions elsewhere are to disable GPP0 and/or GPP8 using /proc/acpi/wakeup, but that is + # inconvenient because it toggles. This does essentially the same thing using udev, which can set + # the wakeup attribute to a specific value. + services.udev.extraRules = '' + ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x1022", ATTR{device}=="0x1483", ATTR{power/wakeup}="disabled" + ''; } From de70a293ae40aebe74545017d1dd76c3c81353a3 Mon Sep 17 00:00:00 2001 From: Marien Zwart Date: Sat, 8 Mar 2025 14:09:11 +1100 Subject: [PATCH 034/134] Adjust README after suspend fix reimplementation The README still referenced the systemd service we no longer need. --- gigabyte/b550/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gigabyte/b550/README.md b/gigabyte/b550/README.md index e8ccf531..9a900a37 100644 --- a/gigabyte/b550/README.md +++ b/gigabyte/b550/README.md @@ -9,9 +9,10 @@ Symptoms: - It goes into suspend, then seems to boot and hang. Sometimes it suspends successfully, but waking it from suspend puts it in the "zombie" state. - By playing chicken with volatile storage and flicking the power switch on the back of power supply, you can sometimes get it to wake from suspend as the card un-powers before volatile storage does. -Fix: disable GPP0 and GPP8 (And, for some cards, potentially PTXH, I can't test) in /proc/acpi/wakeup - - To do this permanently, a systemd service is provided +This can be fixed by disabling GPP0 and GPP8 (And, for some cards, potentially PTXH, I can't test) in /proc/acpi/wakeup. +But because /proc/acpi/wakeup only supports toggling (not disabling) wakeups, we use a udev rule to disable wakeups for +the same device by PCI device ID instead. ## This affects at least: - Gigabyte b550m-d3sh (my machine) From 1b1acdc3e7e4b2e4b5f07430392939e19a90fb8a Mon Sep 17 00:00:00 2001 From: emergentmind <7410928+emergentmind@users.noreply.github.com> Date: Mon, 24 Feb 2025 19:53:51 -0700 Subject: [PATCH 035/134] init --- README.md | 1 + lenovo/thinkpad/e15/README.md | 45 +++++++++++++++++++++++++++ lenovo/thinkpad/e15/default.nix | 14 +++++++++ lenovo/thinkpad/e15/intel/default.nix | 10 ++++++ 4 files changed, 70 insertions(+) create mode 100644 lenovo/thinkpad/e15/README.md create mode 100644 lenovo/thinkpad/e15/default.nix create mode 100644 lenovo/thinkpad/e15/intel/default.nix diff --git a/README.md b/README.md index 342f8b56..72a4d281 100644 --- a/README.md +++ b/README.md @@ -231,6 +231,7 @@ See code for all available configurations. | [Lenovo ThinkPad A475](lenovo/thinkpad/a475) | `` | | [Lenovo ThinkPad E14 (AMD)](lenovo/thinkpad/e14/amd) | `` | | [Lenovo ThinkPad E14 (Intel)](lenovo/thinkpad/e14/intel) | `` | +| [Lenovo ThinkPad E15 (Intel)](lenovo/thinkpad/e15/intel) | `` | | [Lenovo ThinkPad E470](lenovo/thinkpad/e470) | `` | | [Lenovo ThinkPad E495](lenovo/thinkpad/e495) | `` | | [Lenovo ThinkPad L13 Yoga](lenovo/thinkpad/l13/yoga) | `` | diff --git a/lenovo/thinkpad/e15/README.md b/lenovo/thinkpad/e15/README.md new file mode 100644 index 00000000..879bfa9f --- /dev/null +++ b/lenovo/thinkpad/e15/README.md @@ -0,0 +1,45 @@ +# Lenovo Thinkpad E15 + +This is tested on an [E15 Gen4](https://psref.lenovo.com/WDProduct/ThinkPad/ThinkPad_E15_Gen_4_Intel). + +## Tested Hardware + +```bash +lspci -nn +00:00.0 Host bridge [0600]: Intel Corporation Alder Lake-U15 Host and DRAM Controller [8086:4601] (rev 04) +00:02.0 VGA compatible controller [0300]: Intel Corporation Alder Lake-UP3 GT2 [Iris Xe Graphics] [8086:46a8] (rev 0c) +00:04.0 Signal processing controller [1180]: Intel Corporation Alder Lake Innovation Platform Framework Processor Participant [8086:461d] (rev 04) +00:06.0 PCI bridge [0604]: Intel Corporation 12th Gen Core Processor PCI Express x4 Controller #0 [8086:464d] (rev 04) +00:07.0 PCI bridge [0604]: Intel Corporation Alder Lake-P Thunderbolt 4 PCI Express Root Port #0 [8086:466e] (rev 04) +00:08.0 System peripheral [0880]: Intel Corporation 12th Gen Core Processor Gaussian & Neural Accelerator [8086:464f] (rev 04) +00:0a.0 Signal processing controller [1180]: Intel Corporation Platform Monitoring Technology [8086:467d] (rev 01) +00:0d.0 USB controller [0c03]: Intel Corporation Alder Lake-P Thunderbolt 4 USB Controller [8086:461e] (rev 04) +00:0d.2 USB controller [0c03]: Intel Corporation Alder Lake-P Thunderbolt 4 NHI #0 [8086:463e] (rev 04) +00:0d.3 USB controller [0c03]: Intel Corporation Alder Lake-P Thunderbolt 4 NHI #1 [8086:466d] (rev 04) +00:14.0 USB controller [0c03]: Intel Corporation Alder Lake PCH USB 3.2 xHCI Host Controller [8086:51ed] (rev 01) +00:14.2 RAM memory [0500]: Intel Corporation Alder Lake PCH Shared SRAM [8086:51ef] (rev 01) +00:14.3 Network controller [0280]: Intel Corporation Alder Lake-P PCH CNVi WiFi [8086:51f0] (rev 01) +00:15.0 Serial bus controller [0c80]: Intel Corporation Alder Lake PCH Serial IO I2C Controller #0 [8086:51e8] (rev 01) +00:15.2 Serial bus controller [0c80]: Intel Corporation Alder Lake PCH Serial IO I2C Controller #2 [8086:51ea] (rev 01) +00:16.0 Communication controller [0780]: Intel Corporation Alder Lake PCH HECI Controller [8086:51e0] (rev 01) +00:1f.0 ISA bridge [0601]: Intel Corporation Alder Lake PCH eSPI Controller [8086:5182] (rev 01) +00:1f.3 Multimedia audio controller [0401]: Intel Corporation Alder Lake PCH-P High Definition Audio Controller [8086:51c8] (rev 01) +00:1f.4 SMBus [0c05]: Intel Corporation Alder Lake PCH-P SMBus Host Controller [8086:51a3] (rev 01) +00:1f.5 Serial bus controller [0c80]: Intel Corporation Alder Lake-P PCH SPI Controller [8086:51a4] (rev 01) +00:1f.6 Ethernet controller [0200]: Intel Corporation Ethernet Connection (16) I219-V [8086:1a1f] (rev 01) +01:00.0 Non-Volatile memory controller [0108]: Sandisk Corp WD PC SN740 NVMe SSD 512GB (DRAM-less) [15b7:5016] (rev 01) +``` + +## Updating Firmware + +First enable `fwupd` in your config + +```nix +services.fwupd.enable = true; +``` + +Then run + +```bash + $ fwupdmgr update +``` diff --git a/lenovo/thinkpad/e15/default.nix b/lenovo/thinkpad/e15/default.nix new file mode 100644 index 00000000..c6948b35 --- /dev/null +++ b/lenovo/thinkpad/e15/default.nix @@ -0,0 +1,14 @@ +{ ... }: + +{ + imports = [ + ../. + ../../../common/pc/laptop/ssd + ]; + + boot.kernelParams = [ + # Force use of the thinkpad_acpi driver for backlight control. + # This allows the backlight save/load systemd service to work. + "acpi_backlight=native" + ]; +} diff --git a/lenovo/thinkpad/e15/intel/default.nix b/lenovo/thinkpad/e15/intel/default.nix new file mode 100644 index 00000000..3aeee392 --- /dev/null +++ b/lenovo/thinkpad/e15/intel/default.nix @@ -0,0 +1,10 @@ +{ lib, ... }: + +{ + imports = [ + ../. + ../../../../common/cpu/intel/alder-lake + ]; + + services.throttled.enable = lib.mkDefault true; +} From 09e97074ad78706156e8c8d380b8196a602ef719 Mon Sep 17 00:00:00 2001 From: emergentmind <7410928+emergentmind@users.noreply.github.com> Date: Mon, 3 Mar 2025 09:48:34 -0700 Subject: [PATCH 036/134] refactor: add generic laptop spec --- lenovo/thinkpad/e15/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/lenovo/thinkpad/e15/default.nix b/lenovo/thinkpad/e15/default.nix index c6948b35..a8805138 100644 --- a/lenovo/thinkpad/e15/default.nix +++ b/lenovo/thinkpad/e15/default.nix @@ -3,6 +3,7 @@ { imports = [ ../. + ../../../common/pc/laptop ../../../common/pc/laptop/ssd ]; From e1f12151258b12c567f456d8248e4694e9390613 Mon Sep 17 00:00:00 2001 From: emergentmind <7410928+emergentmind@users.noreply.github.com> Date: Mon, 3 Mar 2025 10:02:49 -0700 Subject: [PATCH 037/134] refactor: add model to outputs --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index 0a0f505f..7ccecdda 100644 --- a/flake.nix +++ b/flake.nix @@ -174,6 +174,7 @@ lenovo-thinkpad-a475 = import ./lenovo/thinkpad/a475; lenovo-thinkpad-e14-amd = import ./lenovo/thinkpad/e14/amd; lenovo-thinkpad-e14-intel = import ./lenovo/thinkpad/e14/intel; + lenovo-thinkpad-e15-intel = import ./lenovo/thinkpad/e15/intel; lenovo-thinkpad-e470 = import ./lenovo/thinkpad/e470; lenovo-thinkpad-e495 = import ./lenovo/thinkpad/e495; lenovo-thinkpad-l13 = import ./lenovo/thinkpad/l13; From 3970af5d5831be5c31eb6271a21bf5944cc0e791 Mon Sep 17 00:00:00 2001 From: Eva Dengler Date: Fri, 14 Mar 2025 11:19:45 +0100 Subject: [PATCH 038/134] lenovo/thinkpad/x13-yoga: add thunderbolt support --- lenovo/thinkpad/x13/yoga/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lenovo/thinkpad/x13/yoga/default.nix b/lenovo/thinkpad/x13/yoga/default.nix index 5a454d6f..b7ff8778 100644 --- a/lenovo/thinkpad/x13/yoga/default.nix +++ b/lenovo/thinkpad/x13/yoga/default.nix @@ -5,4 +5,6 @@ ]; services.xserver.wacom.enable = lib.mkDefault config.services.xserver.enable; + + services.hardware.bolt.enable = lib.mkDefault true; } From 113cd3916682def185290145924fa30b30bda972 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 02:45:14 +0000 Subject: [PATCH 039/134] build(deps): bump cachix/install-nix-action from 30 to 31 Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 30 to 31. - [Release notes](https://github.com/cachix/install-nix-action/releases) - [Commits](https://github.com/cachix/install-nix-action/compare/v30...v31) --- updated-dependencies: - dependency-name: cachix/install-nix-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3e96b10d..1a7c3f7e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,5 +9,5 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v30 + - uses: cachix/install-nix-action@v31 - run: nix run ./tests#run . From 05fa89d1c502762064c964bcd2f7f304f3d6794f Mon Sep 17 00:00:00 2001 From: Cassie Cheung Date: Mon, 17 Mar 2025 15:04:44 +0800 Subject: [PATCH 040/134] apple/t2: migrate renamed option --- apple/t2/default.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apple/t2/default.nix b/apple/t2/default.nix index 2201211a..28f9258a 100644 --- a/apple/t2/default.nix +++ b/apple/t2/default.nix @@ -7,6 +7,8 @@ let inherit (lib) types; + nixosVersion = lib.versions.majorMinor lib.version; + audioFiles = pkgs.fetchFromGitHub { owner = "kekrby"; repo = "t2-better-audio"; @@ -82,8 +84,6 @@ in "iommu=pt" ]; - hardware.pulseaudio.package = overrideAudioFiles pkgs.pulseaudio "src/modules/"; - services.pipewire.package = pipewirePackage; services.pipewire.wireplumber.package = pkgs.wireplumber.override { pipewire = pipewirePackage; @@ -92,6 +92,13 @@ in # Make sure post-resume.service exists powerManagement.enable = true; } + + (if lib.versionAtLeast nixosVersion "25.05" then { + services.pulseaudio.package = overrideAudioFiles pkgs.pulseaudio "src/modules/"; + } else { + hardware.pulseaudio.package = overrideAudioFiles pkgs.pulseaudio "src/modules/"; + }) + (lib.mkIf t2Cfg.enableIGPU { # Enable the iGPU by default if present environment.etc."modprobe.d/apple-gmux.conf".text = '' From e8c83f075915408266b2f9794f49e65ac4b3c110 Mon Sep 17 00:00:00 2001 From: Cassie Cheung Date: Tue, 11 Mar 2025 08:32:54 +0800 Subject: [PATCH 041/134] apple/t2: sync patches this includes a new touchpad driver which was tested and should feel smoother. users may need to re-set touchpad settings in their DE. --- apple/t2/pkgs/linux-t2/generic.nix | 1 + apple/t2/pkgs/linux-t2/latest.json | 22 +++++++++++++++++----- apple/t2/pkgs/linux-t2/stable.json | 22 +++++++++++++++++----- 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/apple/t2/pkgs/linux-t2/generic.nix b/apple/t2/pkgs/linux-t2/generic.nix index 297433c3..a4e6e284 100644 --- a/apple/t2/pkgs/linux-t2/generic.nix +++ b/apple/t2/pkgs/linux-t2/generic.nix @@ -40,6 +40,7 @@ kernel.override ( HID_APPLETB_BL = module; HID_APPLETB_KBD = module; HID_APPLE = module; + HID_MAGICMOUSE = module; DRM_APPLETBDRM = module; HID_SENSOR_ALS = module; SND_PCM = module; diff --git a/apple/t2/pkgs/linux-t2/latest.json b/apple/t2/pkgs/linux-t2/latest.json index 5a1dfdcc..4ed6b186 100644 --- a/apple/t2/pkgs/linux-t2/latest.json +++ b/apple/t2/pkgs/linux-t2/latest.json @@ -1,5 +1,5 @@ { - "base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/2f093ab779b24997c3cbd9c2abb2e114bc34addb/", + "base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/4109f2144b626097a34b21def849a5d8cbcf3f7c/", "patches": [ { "name": "1001-Add-apple-bce-driver.patch", @@ -43,7 +43,7 @@ }, { "name": "1015-drm-tiny-add-driver-for-Apple-Touch-Bars-in-x86-Macs.patch", - "hash": "sha256-wlMVeoDQtSRtGuquHKtAHvrGUzZOLxiwkmHj12ZQ8o0=" + "hash": "sha256-zFeDJeoM/XS+Ds3DBLEcv4JbUhlEk9z4rHQ4t6XaghA=" }, { "name": "2008-i915-4-lane-quirk-for-mbp15-1.patch", @@ -90,8 +90,20 @@ "hash": "sha256-skYKmLsJ6O42/wINLccZWoKS0XhVlC1Nfxi1Ekloxns=" }, { - "name": "4001-Input-bcm5974-Add-support-for-the-T2-Macs.patch", - "hash": "sha256-CaviinY3rYqQh+/DGyeBTzLL/ZfIvguOQlWCs3KN4zc=" + "name": "4001-asahi-trackpad.patch", + "hash": "sha256-NOuGgUxDQEfFPlij/EnhWmgqeG3/l+j+r2T1YJG7raY=" + }, + { + "name": "4002-HID-quirks-remove-T2-devices-from-hid_mouse_ignore_l.patch", + "hash": "sha256-DdUo4/4254VD+MzEaLI3opSS0Z7+UwsitJaS2lAlpI8=" + }, + { + "name": "4003-HID-apple-ignore-the-trackpad-on-T2-Macs.patch", + "hash": "sha256-PZpdvPKvVsLsg3vx3jmq3QCapBUcUVE35N37usBRb6g=" + }, + { + "name": "4004-HID-magicmouse-Add-support-for-trackpads-found-on-T2.patch", + "hash": "sha256-pmGR0JdMMwGWG3zwMwMBuSyzltLvvzjTgfi1Ii1cglk=" }, { "name": "7001-drm-i915-fbdev-Discard-BIOS-framebuffers-exceeding-h.patch", @@ -99,7 +111,7 @@ }, { "name": "8001-Add-APFS-driver.patch", - "hash": "sha256-qwLxBY0wDEPBqP32IcGS1Jd/5BlgMFxXu1z2N7+Ti50=" + "hash": "sha256-T0ZmO99nmnpNVLjlzMRc7wrkBON7w2F6HaPk4pQVV7A=" }, { "name": "8002-Necessary-modifications-to-build-APFS-with-the-kerne.patch", diff --git a/apple/t2/pkgs/linux-t2/stable.json b/apple/t2/pkgs/linux-t2/stable.json index 5e672ec3..0426662f 100644 --- a/apple/t2/pkgs/linux-t2/stable.json +++ b/apple/t2/pkgs/linux-t2/stable.json @@ -1,5 +1,5 @@ { - "base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/361d2cef87bb76ba14a24d30ed1479393d92be6f/", + "base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/dd2e78d234fc289d3ebadf1852d761498e668a02/", "patches": [ { "name": "1001-Add-apple-bce-driver.patch", @@ -43,7 +43,7 @@ }, { "name": "1015-drm-tiny-add-driver-for-Apple-Touch-Bars-in-x86-Macs.patch", - "hash": "sha256-wlMVeoDQtSRtGuquHKtAHvrGUzZOLxiwkmHj12ZQ8o0=" + "hash": "sha256-zFeDJeoM/XS+Ds3DBLEcv4JbUhlEk9z4rHQ4t6XaghA=" }, { "name": "2008-i915-4-lane-quirk-for-mbp15-1.patch", @@ -90,8 +90,20 @@ "hash": "sha256-skYKmLsJ6O42/wINLccZWoKS0XhVlC1Nfxi1Ekloxns=" }, { - "name": "4001-Input-bcm5974-Add-support-for-the-T2-Macs.patch", - "hash": "sha256-CaviinY3rYqQh+/DGyeBTzLL/ZfIvguOQlWCs3KN4zc=" + "name": "4001-asahi-trackpad.patch", + "hash": "sha256-NOuGgUxDQEfFPlij/EnhWmgqeG3/l+j+r2T1YJG7raY=" + }, + { + "name": "4002-HID-quirks-remove-T2-devices-from-hid_mouse_ignore_l.patch", + "hash": "sha256-DdUo4/4254VD+MzEaLI3opSS0Z7+UwsitJaS2lAlpI8=" + }, + { + "name": "4003-HID-apple-ignore-the-trackpad-on-T2-Macs.patch", + "hash": "sha256-PZpdvPKvVsLsg3vx3jmq3QCapBUcUVE35N37usBRb6g=" + }, + { + "name": "4004-HID-magicmouse-Add-support-for-trackpads-found-on-T2.patch", + "hash": "sha256-pmGR0JdMMwGWG3zwMwMBuSyzltLvvzjTgfi1Ii1cglk=" }, { "name": "7001-drm-i915-fbdev-Discard-BIOS-framebuffers-exceeding-h.patch", @@ -99,7 +111,7 @@ }, { "name": "8001-Add-APFS-driver.patch", - "hash": "sha256-oyk6K8smAWkNS2aFauCugP+9R5hJRaIhNBa9oEreIBU=" + "hash": "sha256-xjB7lqE4bweUvDa6Tx6LurxWlUlX4nUN+DbTRQb5bQI=" }, { "name": "8002-Necessary-modifications-to-build-APFS-with-the-kerne.patch", From 36d0027ef4a2d23476a5e29bc7f76c8861912b57 Mon Sep 17 00:00:00 2001 From: mkorje Date: Mon, 17 Mar 2025 12:40:06 +1100 Subject: [PATCH 042/134] apple/t2: add Wi-Fi and Bluetooth firmware option --- apple/t2/default.nix | 19 +++ apple/t2/pkgs/brcm-firmware/default.nix | 89 ++++++++++++ apple/t2/pkgs/brcm-firmware/fetchmacos.nix | 42 ++++++ .../get-firmware-standalone.patch | 133 ++++++++++++++++++ apple/t2/pkgs/brcm-firmware/get-firmware.nix | 35 +++++ apple/t2/pkgs/brcm-firmware/macrecovery.nix | 36 +++++ 6 files changed, 354 insertions(+) create mode 100644 apple/t2/pkgs/brcm-firmware/default.nix create mode 100644 apple/t2/pkgs/brcm-firmware/fetchmacos.nix create mode 100644 apple/t2/pkgs/brcm-firmware/get-firmware-standalone.patch create mode 100644 apple/t2/pkgs/brcm-firmware/get-firmware.nix create mode 100644 apple/t2/pkgs/brcm-firmware/macrecovery.nix diff --git a/apple/t2/default.nix b/apple/t2/default.nix index 28f9258a..38115ba2 100644 --- a/apple/t2/default.nix +++ b/apple/t2/default.nix @@ -63,6 +63,19 @@ in example = "latest"; description = "The kernel release stream to use."; }; + firmware = { + enable = lib.mkEnableOption "automatic and declarative Wi-Fi and Bluetooth firmware configuration"; + version = lib.mkOption { + type = types.enum [ + "monterey" + "ventura" + "sonoma" + ]; + default = "sonoma"; + example = "ventura"; + description = "The macOS version to use."; + }; + }; }; config = lib.mkMerge [ @@ -105,5 +118,11 @@ in options apple-gmux force_igd=y ''; }) + (lib.mkIf t2Cfg.firmware.enable { + # Configure Wi-Fi and Bluetooth firmware + hardware.firmware = [ + (pkgs.callPackage ./pkgs/brcm-firmware { version = t2Cfg.firmware.version; }) + ]; + }) ]; } diff --git a/apple/t2/pkgs/brcm-firmware/default.nix b/apple/t2/pkgs/brcm-firmware/default.nix new file mode 100644 index 00000000..742d6ff6 --- /dev/null +++ b/apple/t2/pkgs/brcm-firmware/default.nix @@ -0,0 +1,89 @@ +{ + lib, + stdenvNoCC, + callPackage, + vmTools, + util-linux, + linux, + kmod, + version, +}: + +let + get-firmware = callPackage ./get-firmware.nix { }; + fetchmacos = callPackage ./fetchmacos.nix { }; + + # See https://github.com/kholia/OSX-KVM/blob/master/fetch-macOS-v2.py#L534-L546. + # Versions before macOS Monterey don't have Bluetooth firmware. + # Whereas macOS Sequoia doesn't have firmware for MacBook Air 2018 and 2019. + boards = { + monterey = { + boardId = "Mac-B809C3757DA9BB8D"; + mlb = "00000000000000000"; + osType = "latest"; + hash = "sha256-My8FLnqHZn+THfGPIhTSApW/kIWM0ZZhjBxWujhhWPM="; + }; + ventura = { + boardId = "Mac-4B682C642B45593E"; + mlb = "00000000000000000"; + osType = "latest"; + hash = "sha256-Qy9Whu8pqHo+m6wHnCIqURAR53LYQKc0r87g9eHgnS4="; + }; + sonoma = { + boardId = "Mac-827FAC58A8FDFA22"; + mlb = "00000000000000000"; + osType = "default"; + hash = "sha256-phlpwNTYhugqX2KGljqxpbfGtCFDgggQPzB7U29XSmM="; + }; + }; +in + +vmTools.runInLinuxVM ( + stdenvNoCC.mkDerivation { + pname = "brcm-firmware"; + inherit version; + + src = fetchmacos { + name = version; + inherit (boards.${version}) + boardId + mlb + osType + hash + ; + }; + dontUnpack = true; + + nativeBuildInputs = [ + util-linux + get-firmware + ]; + buildPhase = '' + ln -s ${linux}/lib /lib + ${kmod}/bin/modprobe loop + ${kmod}/bin/modprobe hfsplus + + imgdir=$(mktemp -d) + loopdev=$(losetup -f | cut -d "/" -f 3) + losetup -P $loopdev $src + loopdev_partition=/dev/$(lsblk -o KNAME,TYPE,MOUNTPOINT -n | grep $loopdev | tail -1 | awk '{print $1}') + mount $loopdev_partition $imgdir + + get-bluetooth $imgdir/usr/share/firmware/bluetooth bluetooth/ + get-wifi $imgdir/usr/share/firmware/wifi wifi/ + ''; + + installPhase = '' + mkdir -p $out/lib/firmware/brcm + cp bluetooth/brcm/* $out/lib/firmware/brcm/ + cp wifi/brcm/* $out/lib/firmware/brcm/ + ''; + + meta = with lib; { + description = "Wi-Fi and Bluetooth firmware for T2 Macs"; + license = licenses.unfree; + maintainers = with maintainers; [ mkorje ]; + platforms = platforms.linux; + }; + } +) diff --git a/apple/t2/pkgs/brcm-firmware/fetchmacos.nix b/apple/t2/pkgs/brcm-firmware/fetchmacos.nix new file mode 100644 index 00000000..8af21291 --- /dev/null +++ b/apple/t2/pkgs/brcm-firmware/fetchmacos.nix @@ -0,0 +1,42 @@ +{ + lib, + stdenvNoCC, + fetchFromGitHub, + callPackage, + dmg2img, +}: + +let + macrecovery = callPackage ./macrecovery.nix { }; +in + +{ + name, + boardId, + mlb, + osType, + hash, +}: + +stdenvNoCC.mkDerivation { + name = name; + + dontUnpack = true; + + nativeBuildInputs = [ + macrecovery + dmg2img + ]; + buildPhase = '' + macrecovery download -o . -b ${boardId} -m ${mlb} -os ${osType} + dmg2img -s BaseSystem.dmg fw.img + ''; + + installPhase = '' + cp fw.img $out + ''; + + outputHashMode = "recursive"; + outputHashAlgo = "sha256"; + outputHash = hash; +} diff --git a/apple/t2/pkgs/brcm-firmware/get-firmware-standalone.patch b/apple/t2/pkgs/brcm-firmware/get-firmware-standalone.patch new file mode 100644 index 00000000..f0b13f22 --- /dev/null +++ b/apple/t2/pkgs/brcm-firmware/get-firmware-standalone.patch @@ -0,0 +1,133 @@ +diff --git a/asahi_firmware/bluetooth.py b/asahi_firmware/bluetooth.py +index 0934225..3eaa442 100644 +--- a/asahi_firmware/bluetooth.py ++++ b/asahi_firmware/bluetooth.py +@@ -1,8 +1,25 @@ ++#!/usr/bin/env python3 + # SPDX-License-Identifier: MIT + import logging, os, os.path, re, sys + from collections import namedtuple, defaultdict ++from hashlib import sha256 + +-from .core import FWFile ++class FWFile(object): ++ def __init__(self, name, data): ++ self.name = name ++ self.data = data ++ self.sha = sha256(data).hexdigest() ++ ++ def __repr__(self): ++ return f"FWFile({self.name!r}, <{self.sha[:16]}>)" ++ ++ def __eq__(self, other): ++ if other is None: ++ return False ++ return self.sha == other.sha ++ ++ def __hash__(self): ++ return hash(self.sha) + + log = logging.getLogger("asahi_firmware.bluetooth") + +@@ -127,16 +144,16 @@ class BluetoothFWCollection(object): + + if __name__ == "__main__": + col = BluetoothFWCollection(sys.argv[1]) +- +- if len(sys.argv) > 2: +- from . import FWPackage +- +- pkg = FWPackage(sys.argv[2]) +- pkg.add_files(sorted(col.files())) +- pkg.close() +- +- for i in pkg.manifest: +- print(i) +- else: +- for name, fwfile in col.files(): +- print(name, f"{fwfile.name} ({len(fwfile.data)} bytes)") ++ ++ dir = os.path.join(sys.argv[2], "brcm") ++ os.makedirs(dir) ++ ++ hashes = {} ++ for name, data in sorted(col.files()): ++ path = os.path.join(sys.argv[2], name) ++ if data.sha in hashes: ++ os.link(hashes[data.sha], path) ++ else: ++ with open(path, "wb") as f: ++ f.write(data.data) ++ hashes[data.sha] = path +diff --git a/asahi_firmware/wifi.py b/asahi_firmware/wifi.py +index 346965c..261aa32 100644 +--- a/asahi_firmware/wifi.py ++++ b/asahi_firmware/wifi.py +@@ -1,6 +1,24 @@ ++#!/usr/bin/env python3 + # SPDX-License-Identifier: MIT + import sys, os, os.path, pprint, statistics, logging +-from .core import FWFile ++from hashlib import sha256 ++ ++class FWFile(object): ++ def __init__(self, name, data): ++ self.name = name ++ self.data = data ++ self.sha = sha256(data).hexdigest() ++ ++ def __repr__(self): ++ return f"FWFile({self.name!r}, <{self.sha[:16]}>)" ++ ++ def __eq__(self, other): ++ if other is None: ++ return False ++ return self.sha == other.sha ++ ++ def __hash__(self): ++ return hash(self.sha) + + log = logging.getLogger("asahi_firmware.wifi") + +@@ -40,7 +58,9 @@ class WiFiFWCollection(object): + self.prune() + + def load(self, source_path): ++ included_folders = ["C-4355__s-C1", "C-4364__s-B2", "C-4364__s-B3", "C-4377__s-B3"] + for dirpath, dirnames, filenames in os.walk(source_path): ++ dirnames[:] = [d for d in dirnames if d in included_folders] + if "perf" in dirnames: + dirnames.remove("perf") + if "assert" in dirnames: +@@ -141,18 +161,16 @@ class WiFiFWCollection(object): + + if __name__ == "__main__": + col = WiFiFWCollection(sys.argv[1]) +- if len(sys.argv) > 2: +- from .core import FWPackage +- +- pkg = FWPackage(sys.argv[2]) +- pkg.add_files(sorted(col.files())) +- pkg.close() +- +- for i in pkg.manifest: +- print(i) +- else: +- for name, fwfile in col.files(): +- if isinstance(fwfile, str): +- print(name, "->", fwfile) +- else: +- print(name, f"({len(fwfile.data)} bytes)") ++ ++ dir = os.path.join(sys.argv[2], "brcm") ++ os.makedirs(dir) ++ ++ hashes = {} ++ for name, data in sorted(col.files()): ++ path = os.path.join(sys.argv[2], name) ++ if data.sha in hashes: ++ os.link(hashes[data.sha], path) ++ else: ++ with open(path, "wb") as f: ++ f.write(data.data) ++ hashes[data.sha] = path diff --git a/apple/t2/pkgs/brcm-firmware/get-firmware.nix b/apple/t2/pkgs/brcm-firmware/get-firmware.nix new file mode 100644 index 00000000..9c294016 --- /dev/null +++ b/apple/t2/pkgs/brcm-firmware/get-firmware.nix @@ -0,0 +1,35 @@ +{ + lib, + stdenvNoCC, + fetchFromGitHub, + python3, +}: + +stdenvNoCC.mkDerivation { + name = "get-firmware"; + + src = fetchFromGitHub { + owner = "AsahiLinux"; + repo = "asahi-installer"; + rev = "v0.7.9"; + hash = "sha256-vbhepoZ52k5tW2Gd7tfQTZ5CLqzhV7dUcVh6+AYwECk="; + }; + + patches = [ ./get-firmware-standalone.patch ]; + + buildInputs = [ python3 ]; + + installPhase = '' + cd asahi_firmware + install -Dm755 bluetooth.py $out/bin/get-bluetooth + install -Dm755 wifi.py $out/bin/get-wifi + ''; + + meta = with lib; { + description = "Patched Asahi Linux Installer scripts to get brcm firmware"; + homepage = "https://github.com/AsahiLinux/asahi-installer"; + license = licenses.mit; + maintainers = with maintainers; [ mkorje ]; + platforms = platforms.all; + }; +} diff --git a/apple/t2/pkgs/brcm-firmware/macrecovery.nix b/apple/t2/pkgs/brcm-firmware/macrecovery.nix new file mode 100644 index 00000000..eb4a867a --- /dev/null +++ b/apple/t2/pkgs/brcm-firmware/macrecovery.nix @@ -0,0 +1,36 @@ +{ + lib, + stdenvNoCC, + fetchFromGitHub, + python3, +}: + +stdenvNoCC.mkDerivation { + name = "macrecovery"; + + src = fetchFromGitHub { + owner = "acidanthera"; + repo = "OpenCorePkg"; + rev = "1.0.4"; + hash = "sha256-5Eypza9teSJSulHaK7Sxh562cTKedXKn3y+Z3+fC6sM="; + }; + + buildInputs = [ python3 ]; + + installPhase = '' + cd Utilities/macrecovery + install -Dm755 macrecovery.py $out/opt/macrecovery + cp boards.json $out/opt/boards.json + mkdir $out/bin + ln -s $out/opt/macrecovery $out/bin/macrecovery + ''; + + meta = with lib; { + description = "A tool that helps to automate recovery interaction"; + homepage = "https://github.com/acidanthera/OpenCorePkg"; + license = licenses.bsd3; + maintainers = with maintainers; [ mkorje ]; + mainProgram = "macrecovery"; + platforms = platforms.all; + }; +} From 4f4d97d7b7be387286cc9c988760a7ebaa5be1f1 Mon Sep 17 00:00:00 2001 From: matthiasdotsh Date: Fri, 14 Mar 2025 09:46:41 +0100 Subject: [PATCH 043/134] surface: linux 6.12.18 -> 6.12.19 --- microsoft/surface/common/kernel/linux-surface/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/microsoft/surface/common/kernel/linux-surface/default.nix b/microsoft/surface/common/kernel/linux-surface/default.nix index ada42185..5eb1e976 100644 --- a/microsoft/surface/common/kernel/linux-surface/default.nix +++ b/microsoft/surface/common/kernel/linux-surface/default.nix @@ -7,14 +7,14 @@ let cfg = config.microsoft-surface; - version = "6.12.18"; + version = "6.12.19"; kernelPatches = surfacePatches { inherit version; patchFn = ./patches.nix; }; kernelPackages = linuxPackage { inherit version kernelPatches; - sha256 = "sha256-vrkCpfadnldxARIgPbOBEdrW0wVW6ozjiShMgHf+lE0="; + sha256 = "sha256-1zvwV77ARDSxadG2FkGTb30Ml865I6KB8y413U3MZTE="; ignoreConfigErrors=true; }; From 380ed15bcd6440606c6856db44a99140d422b46f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Sat, 22 Mar 2025 00:07:31 +0100 Subject: [PATCH 044/134] framework: fix TRRS headphones modprobe --- framework/13-inch/common/default.nix | 5 +++-- framework/16-inch/common/default.nix | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/framework/13-inch/common/default.nix b/framework/13-inch/common/default.nix index 5d228d03..4e6f519a 100644 --- a/framework/13-inch/common/default.nix +++ b/framework/13-inch/common/default.nix @@ -1,4 +1,5 @@ -{ lib, pkgs, ... }: { +{ lib, config, ... }: +{ imports = [ ../../../common/pc/laptop ../../../common/pc/laptop/ssd @@ -10,7 +11,7 @@ # Fix TRRS headphones missing a mic # https://community.frame.work/t/headset-microphone-on-linux/12387/3 - boot.extraModprobeConfig = lib.mkIf (lib.versionOlder pkgs.linux.version "6.6.8") '' + boot.extraModprobeConfig = lib.mkIf (lib.versionOlder config.boot.kernelPackages.kernel.version "6.6.8") '' options snd-hda-intel model=dell-headset-multi ''; diff --git a/framework/16-inch/common/default.nix b/framework/16-inch/common/default.nix index 5ec8a171..0b803063 100644 --- a/framework/16-inch/common/default.nix +++ b/framework/16-inch/common/default.nix @@ -1,4 +1,5 @@ -{ lib, pkgs, ... }: { +{ lib, config, ... }: +{ imports = [ ../../../common/pc/laptop ../../../common/pc/laptop/ssd @@ -9,7 +10,7 @@ # Fix TRRS headphones missing a mic # https://community.frame.work/t/headset-microphone-on-linux/12387/3 - boot.extraModprobeConfig = lib.mkIf (lib.versionOlder pkgs.linux.version "6.6.8") '' + boot.extraModprobeConfig = lib.mkIf (lib.versionOlder config.boot.kernelPackages.kernel.version "6.6.8") '' options snd-hda-intel model=dell-headset-multi ''; From 97280e2440a75ffae340304817e62c3130055963 Mon Sep 17 00:00:00 2001 From: Peter Bittner Date: Sun, 23 Mar 2025 19:54:37 +0100 Subject: [PATCH 045/134] Make comment less intimidating (Lenovo X1 Yoga Gen 7) --- lenovo/thinkpad/x1/yoga/7th-gen/default.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lenovo/thinkpad/x1/yoga/7th-gen/default.nix b/lenovo/thinkpad/x1/yoga/7th-gen/default.nix index d95ad1ec..20c49074 100644 --- a/lenovo/thinkpad/x1/yoga/7th-gen/default.nix +++ b/lenovo/thinkpad/x1/yoga/7th-gen/default.nix @@ -4,10 +4,7 @@ ../../../../../common/pc/laptop/ssd ]; - # This laptop is too new for the kernel currently in nixos-unstable. - # On Kernel 5.15.x, dmesg shows the `hardware is newer than drivers` message. - # When starting the system with 5.15.x, only a tty is being displayed. - # After our tests, at least version 5.19 is required for the system to work properly. + # 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); From 32cd43425941880843359879fb9f3880b29f163a Mon Sep 17 00:00:00 2001 From: Cassie Cheung Date: Tue, 18 Mar 2025 07:20:59 +0800 Subject: [PATCH 046/134] apple/t2: sync patches also made the update script use threading for speed --- apple/t2/pkgs/linux-t2/latest.json | 24 ++++++++++++++++-------- apple/t2/pkgs/linux-t2/latest.nix | 4 ++-- apple/t2/pkgs/linux-t2/stable.json | 18 +++++++++++++----- apple/t2/pkgs/linux-t2/update-patches.py | 18 ++++++++++++------ 4 files changed, 43 insertions(+), 21 deletions(-) diff --git a/apple/t2/pkgs/linux-t2/latest.json b/apple/t2/pkgs/linux-t2/latest.json index 4ed6b186..d02a40eb 100644 --- a/apple/t2/pkgs/linux-t2/latest.json +++ b/apple/t2/pkgs/linux-t2/latest.json @@ -1,5 +1,5 @@ { - "base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/4109f2144b626097a34b21def849a5d8cbcf3f7c/", + "base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/60a2912ad2d05f8a2d6c68a94641d912c3a555fd/", "patches": [ { "name": "1001-Add-apple-bce-driver.patch", @@ -43,11 +43,11 @@ }, { "name": "1015-drm-tiny-add-driver-for-Apple-Touch-Bars-in-x86-Macs.patch", - "hash": "sha256-zFeDJeoM/XS+Ds3DBLEcv4JbUhlEk9z4rHQ4t6XaghA=" + "hash": "sha256-Ga0LlaS1jWTXSKh1ClcETPJctAymC6jYBQK9wwDU4Xs=" }, { "name": "2008-i915-4-lane-quirk-for-mbp15-1.patch", - "hash": "sha256-f/PTDwRGEyVkGHFyypTKi+gIni3R4TmcsOneGc7Ay5A=" + "hash": "sha256-Ui9tK4IGSWfEscmD92emX/NfulO0m8zwLc9ivIClCFQ=" }, { "name": "2009-apple-gmux-allow-switching-to-igpu-at-probe.patch", @@ -91,19 +91,27 @@ }, { "name": "4001-asahi-trackpad.patch", - "hash": "sha256-NOuGgUxDQEfFPlij/EnhWmgqeG3/l+j+r2T1YJG7raY=" + "hash": "sha256-yfkTKKokb/+JtTwE0Dzht14S0nrSIwLFAFND90P/Cis=" }, { "name": "4002-HID-quirks-remove-T2-devices-from-hid_mouse_ignore_l.patch", - "hash": "sha256-DdUo4/4254VD+MzEaLI3opSS0Z7+UwsitJaS2lAlpI8=" + "hash": "sha256-0PMCE3IWHekir5YV1BD6Jakc7dOV6Fj2HfIGWZnXZV0=" }, { "name": "4003-HID-apple-ignore-the-trackpad-on-T2-Macs.patch", - "hash": "sha256-PZpdvPKvVsLsg3vx3jmq3QCapBUcUVE35N37usBRb6g=" + "hash": "sha256-JTeYtaBqMyTu5IdGb8x7wbP9ZE1rXT4lpEjudR1ySFI=" }, { "name": "4004-HID-magicmouse-Add-support-for-trackpads-found-on-T2.patch", - "hash": "sha256-pmGR0JdMMwGWG3zwMwMBuSyzltLvvzjTgfi1Ii1cglk=" + "hash": "sha256-HcPX7gY3hnlwM/tY06pbtXnch04AqwHgC596E8ZqGY8=" + }, + { + "name": "4005-HID-apple-Add-necessary-IDs-and-support-for-replacem.patch", + "hash": "sha256-SRKESCbpxSYm7U0VyCmvkmT/er6/GEHhwo8tgJDO6mQ=" + }, + { + "name": "4006-HID-magicmouse-Add-MacBookPro15-1-replacement-trackp.patch", + "hash": "sha256-uAlT/4ADwYyKvbuPQaGwqCjZ2/myruC63etVV6cfFLk=" }, { "name": "7001-drm-i915-fbdev-Discard-BIOS-framebuffers-exceeding-h.patch", @@ -111,7 +119,7 @@ }, { "name": "8001-Add-APFS-driver.patch", - "hash": "sha256-T0ZmO99nmnpNVLjlzMRc7wrkBON7w2F6HaPk4pQVV7A=" + "hash": "sha256-py4DNKBsUWvw6o730ApmNdUlSyabOFnFDoAPrF40DNE=" }, { "name": "8002-Necessary-modifications-to-build-APFS-with-the-kerne.patch", diff --git a/apple/t2/pkgs/linux-t2/latest.nix b/apple/t2/pkgs/linux-t2/latest.nix index 7ab2e41b..70145fdb 100644 --- a/apple/t2/pkgs/linux-t2/latest.nix +++ b/apple/t2/pkgs/linux-t2/latest.nix @@ -1,6 +1,6 @@ -{ callPackage, linux_6_13, ... }@args: +{ callPackage, linux_6_14, ... }@args: callPackage ./generic.nix args { - kernel = linux_6_13; + kernel = linux_6_14; patchesFile = ./latest.json; } diff --git a/apple/t2/pkgs/linux-t2/stable.json b/apple/t2/pkgs/linux-t2/stable.json index 0426662f..3a788c72 100644 --- a/apple/t2/pkgs/linux-t2/stable.json +++ b/apple/t2/pkgs/linux-t2/stable.json @@ -1,5 +1,5 @@ { - "base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/dd2e78d234fc289d3ebadf1852d761498e668a02/", + "base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/0543a832ecf1400798e8aef6727110ec21c3484a/", "patches": [ { "name": "1001-Add-apple-bce-driver.patch", @@ -95,15 +95,23 @@ }, { "name": "4002-HID-quirks-remove-T2-devices-from-hid_mouse_ignore_l.patch", - "hash": "sha256-DdUo4/4254VD+MzEaLI3opSS0Z7+UwsitJaS2lAlpI8=" + "hash": "sha256-0PMCE3IWHekir5YV1BD6Jakc7dOV6Fj2HfIGWZnXZV0=" }, { "name": "4003-HID-apple-ignore-the-trackpad-on-T2-Macs.patch", - "hash": "sha256-PZpdvPKvVsLsg3vx3jmq3QCapBUcUVE35N37usBRb6g=" + "hash": "sha256-JTeYtaBqMyTu5IdGb8x7wbP9ZE1rXT4lpEjudR1ySFI=" }, { "name": "4004-HID-magicmouse-Add-support-for-trackpads-found-on-T2.patch", - "hash": "sha256-pmGR0JdMMwGWG3zwMwMBuSyzltLvvzjTgfi1Ii1cglk=" + "hash": "sha256-HcPX7gY3hnlwM/tY06pbtXnch04AqwHgC596E8ZqGY8=" + }, + { + "name": "4005-HID-apple-Add-necessary-IDs-and-support-for-replacem.patch", + "hash": "sha256-SRKESCbpxSYm7U0VyCmvkmT/er6/GEHhwo8tgJDO6mQ=" + }, + { + "name": "4006-HID-magicmouse-Add-MacBookPro15-1-replacement-trackp.patch", + "hash": "sha256-uAlT/4ADwYyKvbuPQaGwqCjZ2/myruC63etVV6cfFLk=" }, { "name": "7001-drm-i915-fbdev-Discard-BIOS-framebuffers-exceeding-h.patch", @@ -111,7 +119,7 @@ }, { "name": "8001-Add-APFS-driver.patch", - "hash": "sha256-xjB7lqE4bweUvDa6Tx6LurxWlUlX4nUN+DbTRQb5bQI=" + "hash": "sha256-1VHKrO2haBqXDCef2xt2fHfCCPv2q/AhFmmM4Xxu24E=" }, { "name": "8002-Necessary-modifications-to-build-APFS-with-the-kerne.patch", diff --git a/apple/t2/pkgs/linux-t2/update-patches.py b/apple/t2/pkgs/linux-t2/update-patches.py index 28d46b13..7b907293 100755 --- a/apple/t2/pkgs/linux-t2/update-patches.py +++ b/apple/t2/pkgs/linux-t2/update-patches.py @@ -7,6 +7,7 @@ import re import subprocess import sys from tempfile import NamedTemporaryFile +from concurrent.futures import ThreadPoolExecutor, as_completed import requests @@ -50,6 +51,11 @@ def get_sri_hash(data: bytes): ) return proc.stdout.decode("utf8").strip() +def download_task(patch: dict): + patch_content = requests.get(patch["download_url"]) + patch_hash = get_sri_hash(patch_content.content) + print(f"{patch['name']}: {patch_hash}") + return {"name": patch["name"], "hash": patch_hash} def main(): args = parser.parse_args() @@ -73,13 +79,13 @@ def main(): patches = filter(lambda e: PATCH_PATTERN.match(e.get("name")), contents) patches_with_hash = [] - for patch in patches: - patch_content = requests.get(patch["download_url"]) - patch_hash = get_sri_hash(patch_content.content) - print(f"{patch['name']}: {patch_hash}") - patches_with_hash.append({"name": patch["name"], "hash": patch_hash}) + with ThreadPoolExecutor() as executor: + futures = {executor.submit(download_task, patch) for patch in patches} - result = {"base_url": base_url, "patches": patches_with_hash} + for future in as_completed(futures): + patches_with_hash.append(future.result()) + + result = {"base_url": base_url, "patches": sorted(patches_with_hash, key=lambda p: p["name"])} with open(args.filename, "w+") as f: json.dump(result, f, indent=2) From af7de84f851e61202cb32bc528917416359336e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Tue, 3 Dec 2024 15:42:01 +0100 Subject: [PATCH 047/134] E14-intel: import intel comet lake The E14 has a i5-10210U which is from comet lake. see https://www.intel.com/content/www/us/en/products/sku/195436/intel-core-i510210u-processor-6m-cache-up-to-4-20-ghz/specifications.html --- lenovo/thinkpad/e14/intel/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lenovo/thinkpad/e14/intel/default.nix b/lenovo/thinkpad/e14/intel/default.nix index 64d2f177..57252205 100644 --- a/lenovo/thinkpad/e14/intel/default.nix +++ b/lenovo/thinkpad/e14/intel/default.nix @@ -3,7 +3,7 @@ { imports = [ ../. - ../../../../common/cpu/intel + ../../../../common/cpu/intel/comet-lake ]; services.throttled.enable = lib.mkDefault true; From 085c9ada2dae5b7a67c8d7ab17754362f96ba8dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Fri, 28 Mar 2025 17:20:53 +0100 Subject: [PATCH 048/134] intel-comet-lake: use intel-media-driver It is new enough that we don't need or want intel-vaapi-driver. --- common/cpu/intel/comet-lake/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/cpu/intel/comet-lake/default.nix b/common/cpu/intel/comet-lake/default.nix index 3c688f50..25af65fe 100644 --- a/common/cpu/intel/comet-lake/default.nix +++ b/common/cpu/intel/comet-lake/default.nix @@ -3,4 +3,6 @@ ./cpu-only.nix ../../../gpu/intel/comet-lake ]; + + hardware.intelgpu.vaapiDriver = "intel-media-driver"; } From be7794e5a66c81be581ceccaf741a97189652f95 Mon Sep 17 00:00:00 2001 From: steeb-k <133536278+steeb-k@users.noreply.github.com> Date: Fri, 21 Mar 2025 17:36:11 -0700 Subject: [PATCH 049/134] Added Lenovo Thinkpad P14s Gen 5 Intel config --- README.md | 1 + flake.nix | 1 + lenovo/thinkpad/p14s/intel/gen5/default.nix | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+) create mode 100644 lenovo/thinkpad/p14s/intel/gen5/default.nix diff --git a/README.md b/README.md index 72a4d281..884a5634 100644 --- a/README.md +++ b/README.md @@ -245,6 +245,7 @@ See code for all available configurations. | [Lenovo ThinkPad P14s AMD Gen 3](lenovo/thinkpad/p14s/amd/gen3) | `` | | [Lenovo ThinkPad P14s AMD Gen 4](lenovo/thinkpad/p14s/amd/gen4) | `` | | [Lenovo ThinkPad P14s Intel Gen 3](lenovo/thinkpad/p14s/intel/gen3) | `` | +| [Lenovo ThinkPad P14s Intel Gen 5](lenovo/thinkpad/p14s/intel/gen5) | `` | | [Lenovo ThinkPad P16s AMD Gen 1](lenovo/thinkpad/p16s/amd/gen1) | `` | | [Lenovo ThinkPad P16s AMD Gen 2](lenovo/thinkpad/p16s/amd/gen2) | `` | | [Lenovo ThinkPad P1](lenovo/thinkpad/p1) | `` | diff --git a/flake.nix b/flake.nix index 7ccecdda..5d160997 100644 --- a/flake.nix +++ b/flake.nix @@ -189,6 +189,7 @@ lenovo-thinkpad-p14s-amd-gen3 = import ./lenovo/thinkpad/p14s/amd/gen3; lenovo-thinkpad-p14s-amd-gen4 = import ./lenovo/thinkpad/p14s/amd/gen4; lenovo-thinkpad-p14s-intel-gen3 = import ./lenovo/thinkpad/p14s/intel/gen3; + lenovo-thinkpad-p14s-intel-gen5 = import ./lenovo/thinkpad/p14s/intel/gen5; lenovo-thinkpad-p16s-amd-gen1 = import ./lenovo/thinkpad/p16s/amd/gen1; lenovo-thinkpad-p16s-amd-gen2 = import ./lenovo/thinkpad/p16s/amd/gen2; lenovo-thinkpad-p50 = import ./lenovo/thinkpad/p50; diff --git a/lenovo/thinkpad/p14s/intel/gen5/default.nix b/lenovo/thinkpad/p14s/intel/gen5/default.nix new file mode 100644 index 00000000..919df030 --- /dev/null +++ b/lenovo/thinkpad/p14s/intel/gen5/default.nix @@ -0,0 +1,19 @@ +{ lib, pkgs, ... }: + +{ + imports = [ + ../. + ../../../../../common/gpu/nvidia/prime.nix + ../../../../../common/gpu/nvidia/turing + ]; + + hardware = { + intelgpu.driver = "i915"; #xe driver may be used on newer kernels + nvidia = { + prime = { + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:1:0:0"; + }; + }; + }; +} From a3f63440fcfb280d7c9c5dd83f6cc95051867b17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mads=20Rumle=20Nordstr=C3=B8m?= Date: Wed, 19 Mar 2025 18:12:28 +0100 Subject: [PATCH 050/134] added lenovo thinkpad p43s --- flake.nix | 1 + lenovo/thinkpad/p43s/default.nix | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 lenovo/thinkpad/p43s/default.nix diff --git a/flake.nix b/flake.nix index 5d160997..629d8f71 100644 --- a/flake.nix +++ b/flake.nix @@ -192,6 +192,7 @@ lenovo-thinkpad-p14s-intel-gen5 = import ./lenovo/thinkpad/p14s/intel/gen5; lenovo-thinkpad-p16s-amd-gen1 = import ./lenovo/thinkpad/p16s/amd/gen1; lenovo-thinkpad-p16s-amd-gen2 = import ./lenovo/thinkpad/p16s/amd/gen2; + lenovo-thinkpad-p43s = import ./lenovo/thinkpad/p43s; lenovo-thinkpad-p50 = import ./lenovo/thinkpad/p50; lenovo-thinkpad-p51 = import ./lenovo/thinkpad/p51; lenovo-thinkpad-p52 = import ./lenovo/thinkpad/p52; diff --git a/lenovo/thinkpad/p43s/default.nix b/lenovo/thinkpad/p43s/default.nix new file mode 100644 index 00000000..f9d722de --- /dev/null +++ b/lenovo/thinkpad/p43s/default.nix @@ -0,0 +1,22 @@ +{ lib, config, ... }: { + imports = [ + ../. + ../../../common/cpu/intel + ../../../common/pc/laptop/ssd + ../../../common/gpu/nvidia/pascal + ../../../common/gpu/nvidia/prime-sync.nix + ]; + + hardware = { + graphics.enable = lib.mkDefault true; + + nvidia = { + prime = { + intelBusId = lib.mkDefault "PCI:0:2:0"; + nvidiaBusId = lib.mkDefault "PCI:60:0:0"; + }; + + powerManagement.enable = lib.mkDefault config.hardware.nvidia.prime.sync.enable; + }; + }; +} From de6fc5551121c59c01e2a3d45b277a6d05077bc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mads=20Rumle=20Nordstr=C3=B8m?= Date: Thu, 20 Mar 2025 00:05:37 +0100 Subject: [PATCH 051/134] added intel whiskey lake --- README.md | 1 + common/cpu/intel/whiskey-lake/cpu-only.nix | 5 +++ common/cpu/intel/whiskey-lake/default.nix | 6 +++ common/gpu/intel/whiskey-lake/default.nix | 7 ++++ lenovo/thinkpad/p43s/README.md | 45 ++++++++++++++++++++++ lenovo/thinkpad/p43s/default.nix | 2 +- 6 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 common/cpu/intel/whiskey-lake/cpu-only.nix create mode 100644 common/cpu/intel/whiskey-lake/default.nix create mode 100644 common/gpu/intel/whiskey-lake/default.nix create mode 100644 lenovo/thinkpad/p43s/README.md diff --git a/README.md b/README.md index 884a5634..29e22f7a 100644 --- a/README.md +++ b/README.md @@ -249,6 +249,7 @@ See code for all available configurations. | [Lenovo ThinkPad P16s AMD Gen 1](lenovo/thinkpad/p16s/amd/gen1) | `` | | [Lenovo ThinkPad P16s AMD Gen 2](lenovo/thinkpad/p16s/amd/gen2) | `` | | [Lenovo ThinkPad P1](lenovo/thinkpad/p1) | `` | +| [Lenovo ThinkPad P43s](lenovo/thinkpad/p43s) | `` | | [Lenovo ThinkPad P50](lenovo/thinkpad/p50) | `` | | [Lenovo ThinkPad P51](lenovo/thinkpad/p51) | `` | | [Lenovo ThinkPad P52](lenovo/thinkpad/p52) | `` | diff --git a/common/cpu/intel/whiskey-lake/cpu-only.nix b/common/cpu/intel/whiskey-lake/cpu-only.nix new file mode 100644 index 00000000..82892615 --- /dev/null +++ b/common/cpu/intel/whiskey-lake/cpu-only.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ../cpu-only.nix + ]; +} diff --git a/common/cpu/intel/whiskey-lake/default.nix b/common/cpu/intel/whiskey-lake/default.nix new file mode 100644 index 00000000..2cb88597 --- /dev/null +++ b/common/cpu/intel/whiskey-lake/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./cpu-only.nix + ../../../gpu/intel/whiskey-lake + ]; +} diff --git a/common/gpu/intel/whiskey-lake/default.nix b/common/gpu/intel/whiskey-lake/default.nix new file mode 100644 index 00000000..43ed1c46 --- /dev/null +++ b/common/gpu/intel/whiskey-lake/default.nix @@ -0,0 +1,7 @@ +{ + imports = [ ../. ]; + + boot.kernelParams = [ "i915.enable_guc=2" ]; + + hardware.intelgpu.vaapiDriver = "intel-media-driver"; +} diff --git a/lenovo/thinkpad/p43s/README.md b/lenovo/thinkpad/p43s/README.md new file mode 100644 index 00000000..49c31923 --- /dev/null +++ b/lenovo/thinkpad/p43s/README.md @@ -0,0 +1,45 @@ +# Lenovo Thinkpad P43s + +[Product page](https://www.lenovo.com/us/en/p/laptops/thinkpad/thinkpadp/p43s/22ws2wpp43s) + +## Tested Hardware +```console +foo@bar:~$ lspci -nn +00:00.0 Host bridge [0600]: Intel Corporation Coffee Lake HOST and DRAM Controller [8086:3e34] (rev 0c) +00:02.0 VGA compatible controller [0300]: Intel Corporation WhiskeyLake-U GT2 [UHD Graphics 620] [8086:3ea0] (rev 02) +00:04.0 Signal processing controller [1180]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem [8086:1903] (rev 0c) +00:08.0 System peripheral [0880]: Intel Corporation Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th/8th Gen Core Processor Gaussian Mixture Model [8086:1911] +00:12.0 Signal processing controller [1180]: Intel Corporation Cannon Point-LP Thermal Controller [8086:9df9] (rev 30) +00:14.0 USB controller [0c03]: Intel Corporation Cannon Point-LP USB 3.1 xHCI Controller [8086:9ded] (rev 30) +00:14.2 RAM memory [0500]: Intel Corporation Cannon Point-LP Shared SRAM [8086:9def] (rev 30) +00:14.3 Network controller [0280]: Intel Corporation Cannon Point-LP CNVi [Wireless-AC] [8086:9df0] (rev 30) +00:15.0 Serial bus controller [0c80]: Intel Corporation Cannon Point-LP Serial IO I2C Controller #0 [8086:9de8] (rev 30) +00:16.0 Communication controller [0780]: Intel Corporation Cannon Point-LP MEI Controller #1 [8086:9de0] (rev 30) +00:16.3 Serial controller [0700]: Intel Corporation Cannon Point-LP Keyboard and Text (KT) Redirection [8086:9de3] (rev 30) +00:1c.0 PCI bridge [0604]: Intel Corporation Cannon Point-LP PCI Express Root Port #1 [8086:9db8] (rev f0) +00:1c.4 PCI bridge [0604]: Intel Corporation Cannon Point-LP PCI Express Root Port #5 [8086:9dbc] (rev f0) +00:1d.0 PCI bridge [0604]: Intel Corporation Cannon Point-LP PCI Express Root Port #9 [8086:9db0] (rev f0) +00:1d.4 PCI bridge [0604]: Intel Corporation Cannon Point-LP PCI Express Root Port #13 [8086:9db4] (rev f0) +00:1f.0 ISA bridge [0601]: Intel Corporation Cannon Point-LP LPC Controller [8086:9d84] (rev 30) +00:1f.3 Audio device [0403]: Intel Corporation Cannon Point-LP High Definition Audio Controller [8086:9dc8] (rev 30) +00:1f.4 SMBus [0c05]: Intel Corporation Cannon Point-LP SMBus Controller [8086:9da3] (rev 30) +00:1f.5 Serial bus controller [0c80]: Intel Corporation Cannon Point-LP SPI Controller [8086:9da4] (rev 30) +00:1f.6 Ethernet controller [0200]: Intel Corporation Ethernet Connection (6) I219-LM [8086:15bd] (rev 30) +01:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS522A PCI Express Card Reader [10ec:522a] (rev 01) +02:00.0 PCI bridge [0604]: Intel Corporation JHL6240 Thunderbolt 3 Bridge (Low Power) [Alpine Ridge LP 2016] [8086:15c0] (rev 01) +03:00.0 PCI bridge [0604]: Intel Corporation JHL6240 Thunderbolt 3 Bridge (Low Power) [Alpine Ridge LP 2016] [8086:15c0] (rev 01) +03:01.0 PCI bridge [0604]: Intel Corporation JHL6240 Thunderbolt 3 Bridge (Low Power) [Alpine Ridge LP 2016] [8086:15c0] (rev 01) +03:02.0 PCI bridge [0604]: Intel Corporation JHL6240 Thunderbolt 3 Bridge (Low Power) [Alpine Ridge LP 2016] [8086:15c0] (rev 01) +04:00.0 System peripheral [0880]: Intel Corporation JHL6240 Thunderbolt 3 NHI (Low Power) [Alpine Ridge LP 2016] [8086:15bf] (rev 01) +3a:00.0 USB controller [0c03]: Intel Corporation JHL6240 Thunderbolt 3 USB 3.1 Controller (Low Power) [Alpine Ridge LP 2016] [8086:15c1] (rev 01) +3c:00.0 3D controller [0302]: NVIDIA Corporation GP108GLM [Quadro P520] [10de:1d34] (rev a1) +3d:00.0 Non-Volatile memory controller [0108]: SK hynix PC601 NVMe Solid State Drive [1c5c:1627] +``` + +## Tested Nix Configuration + - system: `"x86_64-linux"` + - host os: `Linux 6.12.18, NixOS, 25.05 (Warbler), 25.05.20250309.e3e32b6` + - multi-user?: `yes` + - sandbox: `yes` + - version: `nix-env (Nix) 2.24.12` + - nixpkgs: `/nix/store/g4ppspdl4fy7hnp4jgjl4ll03v7i08w3-source` diff --git a/lenovo/thinkpad/p43s/default.nix b/lenovo/thinkpad/p43s/default.nix index f9d722de..46632b79 100644 --- a/lenovo/thinkpad/p43s/default.nix +++ b/lenovo/thinkpad/p43s/default.nix @@ -1,7 +1,7 @@ { lib, config, ... }: { imports = [ ../. - ../../../common/cpu/intel + ../../../common/cpu/intel/whiskey-lake ../../../common/pc/laptop/ssd ../../../common/gpu/nvidia/pascal ../../../common/gpu/nvidia/prime-sync.nix From 8141742b12ab3ff3d4769640dad1e1abeeda6171 Mon Sep 17 00:00:00 2001 From: Andre Date: Thu, 10 Apr 2025 20:37:04 -0400 Subject: [PATCH 052/134] microsoft/surface: add kernel switching for LTS and latest kernels --- microsoft/surface/common/default.nix | 66 ++++++-- .../{linux-surface => 6.12}/patches.nix | 0 .../surface/common/kernel/6.13/patches.nix | 157 ++++++++++++++++++ microsoft/surface/common/kernel/default.nix | 15 -- .../surface/common/kernel/linux-package.nix | 3 +- .../common/kernel/linux-surface/default.nix | 31 ---- microsoft/surface/common/kernel/repos.nix | 9 + microsoft/surface/common/repos.nix | 25 --- .../firmware/ath10k/ath10k-replace.nix | 9 +- 9 files changed, 228 insertions(+), 87 deletions(-) rename microsoft/surface/common/kernel/{linux-surface => 6.12}/patches.nix (100%) create mode 100644 microsoft/surface/common/kernel/6.13/patches.nix delete mode 100644 microsoft/surface/common/kernel/default.nix delete mode 100644 microsoft/surface/common/kernel/linux-surface/default.nix create mode 100644 microsoft/surface/common/kernel/repos.nix delete mode 100644 microsoft/surface/common/repos.nix diff --git a/microsoft/surface/common/default.nix b/microsoft/surface/common/default.nix index d49f4e31..fe3a41ed 100644 --- a/microsoft/surface/common/default.nix +++ b/microsoft/surface/common/default.nix @@ -1,22 +1,62 @@ -{ lib, ... }: +{ config, lib, pkgs, ... }: let - inherit (lib) mkDefault; + inherit (lib) mkDefault mkOption types; + + version = config.microsoft-surface.kernelVersion; + rev = + if version == "6.12" then + "arch-6.12.19-1" + else if version == "6.13" then + "arch-6.13.6-1" + else + abort "Invalid kernel version: ${version}"; + + hash = + if version == "6.12" then + "sha256-Pv7O8D8ma+MPLhYP3HSGQki+Yczp8b7d63qMb6l4+mY=" + else if version == "6.13" then + "sha256-otD1ckNxNnvV8xipf9SZpbfg+bBq5EPwyieYtLIV4Ck=" + else + abort "Invalid kernel version: ${version}"; + + inherit (pkgs.callPackage ./kernel/linux-package.nix { repos = pkgs.callPackage ./kernel/repos.nix { rev = rev; hash = hash; }; }) linuxPackage surfacePatches; + + kernelPatches = surfacePatches { + inherit version; + patchFn = ./kernel/${version}/patches.nix; + }; + kernelPackages = linuxPackage { + inherit version kernelPatches; + sha256 = "sha256-1zvwV77ARDSxadG2FkGTb30Ml865I6KB8y413U3MZTE="; + ignoreConfigErrors=true; + }; in { - imports = [ - ./kernel - ]; + options.microsoft-surface.kernelVersion = mkOption { + description = "Kernel Version to use (patched for MS Surface)"; + type = types.enum [ + "6.12" + "6.13" + ]; + default = "6.12"; + }; - microsoft-surface.kernelVersion = mkDefault "6.12"; + config = { + boot = { + inherit kernelPackages; - # Seems to be required to properly enable S0ix "Modern Standby": - boot.kernelParams = mkDefault [ "mem_sleep_default=deep" ]; + kernelParams = mkDefault [ "mem_sleep_default=deep" ]; + # Seems to be required to properly enable S0ix "Modern Standby": + }; - # NOTE: Check the README before enabling TLP: - services.tlp.enable = mkDefault false; + # NOTE: Check the README before enabling TLP: + services.tlp.enable = mkDefault false; - # i.e. needed for wifi firmware, see https://github.com/NixOS/nixos-hardware/issues/364 - hardware.enableRedistributableFirmware = mkDefault true; - hardware.sensor.iio.enable = mkDefault true; + # i.e. needed for wifi firmware, see https://github.com/NixOS/nixos-hardware/issues/364 + hardware = { + enableRedistributableFirmware = mkDefault true; + sensor.iio.enable = mkDefault true; + }; + }; } diff --git a/microsoft/surface/common/kernel/linux-surface/patches.nix b/microsoft/surface/common/kernel/6.12/patches.nix similarity index 100% rename from microsoft/surface/common/kernel/linux-surface/patches.nix rename to microsoft/surface/common/kernel/6.12/patches.nix diff --git a/microsoft/surface/common/kernel/6.13/patches.nix b/microsoft/surface/common/kernel/6.13/patches.nix new file mode 100644 index 00000000..d905499f --- /dev/null +++ b/microsoft/surface/common/kernel/6.13/patches.nix @@ -0,0 +1,157 @@ +{ lib, + kernel ? lib.kernel, + patchSrc, + version, +}: + +[ + { + name = "microsoft-surface-patches-linux-${version}"; + patch = null; + extraStructuredConfig = with kernel; { + STAGING_MEDIA = yes; + +## +## Surface Aggregator Module +## +CONFIG_SURFACE_AGGREGATOR= module; +# CONFIG_SURFACE_AGGREGATOR_ERROR_INJECTION is not set +CONFIG_SURFACE_AGGREGATOR_BUS= yes; +CONFIG_SURFACE_AGGREGATOR_CDEV= module; +CONFIG_SURFACE_AGGREGATOR_HUB= module; +CONFIG_SURFACE_AGGREGATOR_REGISTRY= module; +CONFIG_SURFACE_AGGREGATOR_TABLET_SWITCH= module; + +CONFIG_SURFACE_ACPI_NOTIFY= module; +CONFIG_SURFACE_DTX= module; +CONFIG_SURFACE_PLATFORM_PROFILE= module; + +CONFIG_SURFACE_HID= module; +CONFIG_SURFACE_KBD= module; + +CONFIG_BATTERY_SURFACE= module; +CONFIG_CHARGER_SURFACE= module; + +CONFIG_SENSORS_SURFACE_TEMP= module; +CONFIG_SENSORS_SURFACE_FAN= module; + +## +## Surface Hotplug +## +CONFIG_SURFACE_HOTPLUG= module; + +## +## IPTS and ITHC touchscreen +## +## This only enables the user interface for IPTS/ITHC data. +## For the touchscreen to work, you need to install iptsd. +## +CONFIG_HID_IPTS= module; +CONFIG_HID_ITHC= module; + +## +## Cameras: IPU3 +## +CONFIG_VIDEO_DW9719= module; +CONFIG_VIDEO_IPU3_IMGU= module; +CONFIG_VIDEO_IPU3_CIO2= module; +CONFIG_IPU_BRIDGE= module; +CONFIG_INTEL_SKL_INT3472= module; +CONFIG_REGULATOR_TPS68470= module; +CONFIG_COMMON_CLK_TPS68470= module; +CONFIG_LEDS_TPS68470= module; + +## +## Cameras: Sensor drivers +## +CONFIG_VIDEO_OV5693= module; +CONFIG_VIDEO_OV7251= module; +CONFIG_VIDEO_OV8865= module; + +## +## Surface 3: atomisp causes problems (see issue #1095). Disable it for now. +## +# CONFIG_INTEL_ATOMISP is not set + +## +## ALS Sensor for Surface Book 3, Surface Laptop 3, Surface Pro 7 +## +CONFIG_APDS9960= module; + +## +## Build-in UFS support (required for some Surface Go devices) +## +CONFIG_SCSI_UFSHCD= module; +CONFIG_SCSI_UFSHCD_PCI= module; + +## +## Other Drivers +## +CONFIG_INPUT_SOC_BUTTON_ARRAY= module; +CONFIG_SURFACE_3_POWER_OPREGION= module; +CONFIG_SURFACE_PRO3_BUTTON= module; +CONFIG_SURFACE_GPE= module; +CONFIG_SURFACE_BOOK1_DGPU_SWITCH= module; + }; + } + { + name = "ms-surface/0001-secureboot"; + patch = patchSrc + "/0001-secureboot.patch"; + } + { + name = "ms-surface/0002-surface3"; + patch = patchSrc + "/0002-surface3.patch"; + } + { + name = "ms-surface/0003-mwifiex"; + patch = patchSrc + "/0003-mwifiex.patch"; + } + { + name = "ms-surface/0004-ath10k"; + patch = patchSrc + "/0004-ath10k.patch"; + } + { + name = "ms-surface/0005-ipts"; + patch = patchSrc + "/0005-ipts.patch"; + } + { + name = "ms-surface/0006-ithc"; + patch = patchSrc + "/0006-ithc.patch"; + } + { + name = "ms-surface/0007-surface-sam"; + patch = patchSrc + "/0007-surface-sam.patch"; + } + { + name = "ms-surface/0008-surface-sam-over-hid"; + patch = patchSrc + "/0008-surface-sam-over-hid.patch"; + } + { + name = "ms-surface/0009-surface-button"; + patch = patchSrc + "/0009-surface-button.patch"; + } + { + name = "ms-surface/0010-surface-typecover"; + patch = patchSrc + "/0010-surface-typecover.patch"; + } + { + name = "ms-surface/0011-surface-shutdown"; + patch = patchSrc + "/0011-surface-shutdown.patch"; + } + { + name = "ms-surface/0012-surface-gpe"; + patch = patchSrc + "/0012-surface-gpe.patch"; + } + { + name = "ms-surface/0013-cameras"; + patch = patchSrc + "/0013-cameras.patch"; + } + { + name = "ms-surface/0014-amd-gpio"; + patch = patchSrc + "/0014-amd-gpio.patch"; + } + { + name = "ms-surface/0015-rtc"; + patch = patchSrc + "/0015-rtc.patch"; + } +] diff --git a/microsoft/surface/common/kernel/default.nix b/microsoft/surface/common/kernel/default.nix deleted file mode 100644 index 490ecd0d..00000000 --- a/microsoft/surface/common/kernel/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ lib, ... }: - -let - inherit (lib) mkOption types; - -in { - imports = [ - ./linux-surface - ]; - - options.microsoft-surface.kernelVersion = mkOption { - description = "Kernel Version to use (patched for MS Surface)"; - type = types.enum [ ]; - }; -} diff --git a/microsoft/surface/common/kernel/linux-package.nix b/microsoft/surface/common/kernel/linux-package.nix index b179fcb7..28e3e0e7 100644 --- a/microsoft/surface/common/kernel/linux-package.nix +++ b/microsoft/surface/common/kernel/linux-package.nix @@ -3,14 +3,13 @@ fetchurl, buildLinux, linuxPackagesFor, + repos, }: let inherit (builtins) elem; inherit (lib) recurseIntoAttrs types versions; - repos = pkgs.callPackage ../repos.nix {}; - linuxPackage = { url ? "mirror://kernel/linux/kernel/v${versions.major version}.x/linux-${version}.tar.xz", sha256 ? null, diff --git a/microsoft/surface/common/kernel/linux-surface/default.nix b/microsoft/surface/common/kernel/linux-surface/default.nix deleted file mode 100644 index 5eb1e976..00000000 --- a/microsoft/surface/common/kernel/linux-surface/default.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ config, lib, pkgs, ... }: - -let - inherit (lib) mkIf mkOption; - - inherit (pkgs.callPackage ../linux-package.nix { }) linuxPackage surfacePatches isVersionOf versionsOfEnum; - - cfg = config.microsoft-surface; - - version = "6.12.19"; - kernelPatches = surfacePatches { - inherit version; - patchFn = ./patches.nix; - }; - kernelPackages = linuxPackage { - inherit version kernelPatches; - sha256 = "sha256-1zvwV77ARDSxadG2FkGTb30Ml865I6KB8y413U3MZTE="; - ignoreConfigErrors=true; - }; - -in { - options.microsoft-surface.kernelVersion = mkOption { - type = versionsOfEnum version; - }; - - config = mkIf (isVersionOf cfg.kernelVersion version) { - boot = { - inherit kernelPackages; - }; - }; -} diff --git a/microsoft/surface/common/kernel/repos.nix b/microsoft/surface/common/kernel/repos.nix new file mode 100644 index 00000000..6d8349fd --- /dev/null +++ b/microsoft/surface/common/kernel/repos.nix @@ -0,0 +1,9 @@ +{ fetchFromGitHub, rev, hash }: +{ + linux-surface = fetchFromGitHub { + owner = "linux-surface"; + repo = "linux-surface"; + rev = rev; + hash = hash; + }; +} \ No newline at end of file diff --git a/microsoft/surface/common/repos.nix b/microsoft/surface/common/repos.nix deleted file mode 100644 index a6bb7368..00000000 --- a/microsoft/surface/common/repos.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ fetchFromGitHub }: - -{ - linux-surface = fetchFromGitHub { - owner = "linux-surface"; - repo = "linux-surface"; - rev = "arch-6.12.7-1"; - hash = "sha256-Pv7O8D8ma+MPLhYP3HSGQki+Yczp8b7d63qMb6l4+mY="; - }; - - # This is the owner and repo for the pre-patched kernel from the "linux-surface" project: - linux-surface-kernel = { rev, sha256 }: - fetchFromGitHub { - owner = "linux-surface"; - repo = "kernel"; - inherit rev sha256; - }; - - surface-go-ath10k-firmware_backup = fetchFromGitHub { - owner = "mexisme"; - repo = "linux-surface_ath10k-firmware"; - rev = "74e5409e699383d6ca2bc4da4a8433d16f3850b1"; - sha256 = "169vgvxpgad9anmchs22fj5qm6ahzjfdnwhd8pc280q705vx6pjk"; - }; -} diff --git a/microsoft/surface/surface-go/firmware/ath10k/ath10k-replace.nix b/microsoft/surface/surface-go/firmware/ath10k/ath10k-replace.nix index 6cc55fa2..132695e5 100644 --- a/microsoft/surface/surface-go/firmware/ath10k/ath10k-replace.nix +++ b/microsoft/surface/surface-go/firmware/ath10k/ath10k-replace.nix @@ -1,7 +1,14 @@ { stdenv, lib, pkgs, firmwareLinuxNonfree, ... }: let - repos = pkgs.callPackage ../../../common/repos.nix {}; + repos = pkgs.callPackage { + surface-go-ath10k-firmware_backup = lib.fetchFromGitHub { + owner = "mexisme"; + repo = "linux-surface_ath10k-firmware"; + rev = "74e5409e699383d6ca2bc4da4a8433d16f3850b1"; + sha256 = "169vgvxpgad9anmchs22fj5qm6ahzjfdnwhd8pc280q705vx6pjk"; + }; + } {}; killernetworking_firmware = repos.surface-go-ath10k-firmware_backup + "/K1535_Debian"; in stdenv.mkDerivation { From c7034bb57b045c0b6d4fb9180abe42a96f4d1add Mon Sep 17 00:00:00 2001 From: Ganga Ram Date: Fri, 11 Apr 2025 12:37:15 +0400 Subject: [PATCH 053/134] Fix compilation issue Updated makeFlags as latest buildArmTrustedFirmware specifies CC and LD explicitly, which doesn't work well with the nxp imx8mp-evk platform. Signed-off-by: Ganga Ram --- nxp/imx8mp-evk/bsp/imx8mp-atf.nix | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/nxp/imx8mp-evk/bsp/imx8mp-atf.nix b/nxp/imx8mp-evk/bsp/imx8mp-atf.nix index 55454c4a..84e921f6 100644 --- a/nxp/imx8mp-evk/bsp/imx8mp-atf.nix +++ b/nxp/imx8mp-evk/bsp/imx8mp-atf.nix @@ -25,10 +25,16 @@ in sha256 = "sha256-96EddJXlFEkP/LIGVgNBvUP4IDI3BbDE/c9Yub22gnc="; }; - extraMakeFlags = lib.concatLists [ - (lib.optional (lib.versionAtLeast pkgs.binutils.version "2.39") "LDFLAGS=--no-warn-rwx-segments") - ["PLAT=${platform}" "bl31" "${opteedflag}"] - ]; + makeFlags = [ + "HOSTCC=$(CC_FOR_BUILD)" + "M0_CROSS_COMPILE=arm-none-eabi-" + "CROSS_COMPILE=aarch64-unknown-linux-gnu-" + # binutils 2.39 regression + # `warning: /build/source/build/rk3399/release/bl31/bl31.elf has a LOAD segment with RWX permissions` + # See also: https://developer.trustedfirmware.org/T996 + "LDFLAGS=-no-warn-rwx-segments" + "PLAT=${platform}" "bl31" "${opteedflag}" + ]; filesToInstall = ["build/${target-board}/release/bl31.bin"]; } From 9726adf371a51e3f6884b190b259e8842c32e6ca Mon Sep 17 00:00:00 2001 From: Andre Date: Fri, 11 Apr 2025 09:35:36 -0400 Subject: [PATCH 054/134] microsoft/surface: add kernel source hash logic --- microsoft/surface/common/default.nix | 33 ++++++++++++++++++---------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/microsoft/surface/common/default.nix b/microsoft/surface/common/default.nix index fe3a41ed..2ad22332 100644 --- a/microsoft/surface/common/default.nix +++ b/microsoft/surface/common/default.nix @@ -3,32 +3,41 @@ let inherit (lib) mkDefault mkOption types; - version = config.microsoft-surface.kernelVersion; - rev = - if version == "6.12" then - "arch-6.12.19-1" - else if version == "6.13" then - "arch-6.13.6-1" + shortVersion = config.microsoft-surface.kernelVersion; + version = if shortVersion == "6.12" then + "6.12.19" + else if shortVersion == "6.13" then + "6.13.6" else - abort "Invalid kernel version: ${version}"; + abort "Invalid kernel version: ${shortVersion}"; + + rev = "arch-${version}-1"; hash = - if version == "6.12" then + if shortVersion == "6.12" then "sha256-Pv7O8D8ma+MPLhYP3HSGQki+Yczp8b7d63qMb6l4+mY=" - else if version == "6.13" then + else if shortVersion == "6.13" then "sha256-otD1ckNxNnvV8xipf9SZpbfg+bBq5EPwyieYtLIV4Ck=" else - abort "Invalid kernel version: ${version}"; + abort "Invalid kernel version: ${shortVersion}"; + + srcHash = + if shortVersion == "6.12" then + "sha256-1zvwV77ARDSxadG2FkGTb30Ml865I6KB8y413U3MZTE=" + else if shortVersion == "6.13" then + "sha256-3gBTy0E9QI8g/R1XiCGZUbikQD5drBsdkDIJCTis0Zk=" + else + abort "Invalid kernel version: ${shortVersion}"; inherit (pkgs.callPackage ./kernel/linux-package.nix { repos = pkgs.callPackage ./kernel/repos.nix { rev = rev; hash = hash; }; }) linuxPackage surfacePatches; kernelPatches = surfacePatches { inherit version; - patchFn = ./kernel/${version}/patches.nix; + patchFn = ./kernel/${shortVersion}/patches.nix; }; kernelPackages = linuxPackage { inherit version kernelPatches; - sha256 = "sha256-1zvwV77ARDSxadG2FkGTb30Ml865I6KB8y413U3MZTE="; + sha256 = srcHash; ignoreConfigErrors=true; }; From bb295c09d96dc62b24f101c98a1115552449db92 Mon Sep 17 00:00:00 2001 From: Andre Date: Fri, 11 Apr 2025 14:54:03 -0400 Subject: [PATCH 055/134] microsoft/surface: remove repos.nix file and update README --- microsoft/surface/README.md | 26 +++++++++----- microsoft/surface/common/default.nix | 41 ++++++++++++++--------- microsoft/surface/common/kernel/repos.nix | 9 ----- 3 files changed, 44 insertions(+), 32 deletions(-) delete mode 100644 microsoft/surface/common/kernel/repos.nix diff --git a/microsoft/surface/README.md b/microsoft/surface/README.md index a461f318..508bbebc 100644 --- a/microsoft/surface/README.md +++ b/microsoft/surface/README.md @@ -1,8 +1,3 @@ -# NOTE: Structure changes from 2023-01-10 - -Please read the [Deprecated Behaviour README](./OLD-BEHAVIOUR-DEPRECATION.md) to understand how some structural changes to -the code might affect you! - # Derivations for Microsoft Surface notebooks These derivatives use the patches from the [linux-surface repo](https://github.com/linux-surface/linux-surface/tree/master/patches). @@ -32,13 +27,24 @@ Not all hardware is fully supported, but the [linux-surface feature matrix](https://github.com/linux-surface/linux-surface/wiki/Supported-Devices-and-Features#feature-matrix) provides details on which devices are supported on which types of machine. -The kernel-specific derivations are under the [`common/kernel/`](./common/kernel/) sub-directory. -In order to simplify maintenance of the Nix code, only the most-recent kernel patch-set is expected -to be maintained in this repo. +The kernel-specific derivations are under the [`common/kernel/`](./common/kernel/) sub-directory. This directory defines patch sets for each supported kernel release (see Kernel versions below for more information). _*NOTE:*_ Some built-in Kernel config items need to be set, that aren't set by default: - https://github.com/linux-surface/surface-aggregator-module/wiki/Testing-and-Installing +#### Kernel versions + +There are multiple versions of the Surface kernel available: + +- `lts`, which tracks the latest LTS release. +- `latest`, which tracks the most recent release. + +This repo uses `lts` by default, but you can switch it to `latest` by adding this to your configuration file: + +```nix +microsoft-surface.kernelVersion = "latest"; +``` + ### Support Tools ### IPTS @@ -120,3 +126,7 @@ References: - https://github.com/thebitstick/surfacego-wifi - https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/ath10k - https://wireless.wiki.kernel.org/en/users/drivers/ath10k/firmware + +## Structural changes from earlier versions (2023-01-10 and earlier) + +If you're upgrading from an older version of nixos-hardware, please read the [Deprecated Behaviour README](./OLD-BEHAVIOUR-DEPRECATION.md) to understand how some structural changes to the code might affect you! diff --git a/microsoft/surface/common/default.nix b/microsoft/surface/common/default.nix index 2ad22332..c7bd3547 100644 --- a/microsoft/surface/common/default.nix +++ b/microsoft/surface/common/default.nix @@ -1,19 +1,19 @@ { config, lib, pkgs, ... }: let - inherit (lib) mkDefault mkOption types; + inherit (lib) fetchFromGitHub mkDefault mkOption types versions; - shortVersion = config.microsoft-surface.kernelVersion; - version = if shortVersion == "6.12" then + # Set the full kernel version and hashes + version = + if config.microsoft-surface.kernelVersion == "lts" then "6.12.19" - else if shortVersion == "6.13" then + else if config.microsoft-surface.kernelVersion == "latest" then "6.13.6" else - abort "Invalid kernel version: ${shortVersion}"; - - rev = "arch-${version}-1"; + abort "Invalid kernel version: ${config.microsoft-surface.kernelVersion}"; - hash = + shortVersion = versions.majorMinor version; + packageHash = if shortVersion == "6.12" then "sha256-Pv7O8D8ma+MPLhYP3HSGQki+Yczp8b7d63qMb6l4+mY=" else if shortVersion == "6.13" then @@ -29,15 +29,26 @@ let else abort "Invalid kernel version: ${shortVersion}"; - inherit (pkgs.callPackage ./kernel/linux-package.nix { repos = pkgs.callPackage ./kernel/repos.nix { rev = rev; hash = hash; }; }) linuxPackage surfacePatches; + # Fetch the release from the linux-surface project + rev = "arch-${version}-1"; + repos = pkgs.callPackage ({ fetchFromGitHub, rev, packageHash }: { + linux-surface = fetchFromGitHub { + owner = "linux-surface"; + repo = "linux-surface"; + rev = rev; + hash = packageHash; + }; + }) { inherit rev packageHash; }; + # Build the kernel package + inherit (pkgs.callPackage ./kernel/linux-package.nix { inherit repos; }) linuxPackage surfacePatches; kernelPatches = surfacePatches { inherit version; patchFn = ./kernel/${shortVersion}/patches.nix; }; kernelPackages = linuxPackage { inherit version kernelPatches; - sha256 = srcHash; + hash = srcHash; ignoreConfigErrors=true; }; @@ -45,24 +56,24 @@ in { options.microsoft-surface.kernelVersion = mkOption { description = "Kernel Version to use (patched for MS Surface)"; type = types.enum [ - "6.12" - "6.13" + "lts" + "latest" ]; - default = "6.12"; + default = "lts"; }; config = { boot = { inherit kernelPackages; - kernelParams = mkDefault [ "mem_sleep_default=deep" ]; # Seems to be required to properly enable S0ix "Modern Standby": + kernelParams = mkDefault [ "mem_sleep_default=deep" ]; }; # NOTE: Check the README before enabling TLP: services.tlp.enable = mkDefault false; - # i.e. needed for wifi firmware, see https://github.com/NixOS/nixos-hardware/issues/364 + # Needed for wifi firmware, see https://github.com/NixOS/nixos-hardware/issues/364 hardware = { enableRedistributableFirmware = mkDefault true; sensor.iio.enable = mkDefault true; diff --git a/microsoft/surface/common/kernel/repos.nix b/microsoft/surface/common/kernel/repos.nix deleted file mode 100644 index 6d8349fd..00000000 --- a/microsoft/surface/common/kernel/repos.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ fetchFromGitHub, rev, hash }: -{ - linux-surface = fetchFromGitHub { - owner = "linux-surface"; - repo = "linux-surface"; - rev = rev; - hash = hash; - }; -} \ No newline at end of file From dab2104c1fe488bf5d7ef537e60378a9d9b81a34 Mon Sep 17 00:00:00 2001 From: Andre Date: Sat, 12 Apr 2025 10:37:47 -0400 Subject: [PATCH 056/134] microsoft/surface: switch back to using sha256 instead of hash due to connection breaking --- microsoft/surface/common/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/microsoft/surface/common/default.nix b/microsoft/surface/common/default.nix index c7bd3547..ecbdf4e7 100644 --- a/microsoft/surface/common/default.nix +++ b/microsoft/surface/common/default.nix @@ -1,7 +1,7 @@ { config, lib, pkgs, ... }: let - inherit (lib) fetchFromGitHub mkDefault mkOption types versions; + inherit (lib) mkDefault mkOption types versions; # Set the full kernel version and hashes version = @@ -48,7 +48,7 @@ let }; kernelPackages = linuxPackage { inherit version kernelPatches; - hash = srcHash; + sha256 = srcHash; ignoreConfigErrors=true; }; From 2034c5d2e7831e8aab82e2fa21821b30767fbe8e Mon Sep 17 00:00:00 2001 From: Andre Date: Sat, 12 Apr 2025 10:42:29 -0400 Subject: [PATCH 057/134] microsoft/surface: rename 'lts' and 'latest' to 'longterm' and 'stable' --- microsoft/surface/README.md | 8 ++++---- microsoft/surface/common/default.nix | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/microsoft/surface/README.md b/microsoft/surface/README.md index 508bbebc..cc5dbde5 100644 --- a/microsoft/surface/README.md +++ b/microsoft/surface/README.md @@ -36,13 +36,13 @@ _*NOTE:*_ Some built-in Kernel config items need to be set, that aren't set by d There are multiple versions of the Surface kernel available: -- `lts`, which tracks the latest LTS release. -- `latest`, which tracks the most recent release. +- `longterm`, which tracks the latest long term support (LTS) release. +- `stable`, which tracks the most recent stable release. -This repo uses `lts` by default, but you can switch it to `latest` by adding this to your configuration file: +This repo uses `longterm` by default, but you can switch it to `stable` by adding this to your configuration file: ```nix -microsoft-surface.kernelVersion = "latest"; +microsoft-surface.kernelVersion = "stable"; ``` ### Support Tools diff --git a/microsoft/surface/common/default.nix b/microsoft/surface/common/default.nix index ecbdf4e7..52435ec4 100644 --- a/microsoft/surface/common/default.nix +++ b/microsoft/surface/common/default.nix @@ -5,9 +5,9 @@ let # Set the full kernel version and hashes version = - if config.microsoft-surface.kernelVersion == "lts" then + if config.microsoft-surface.kernelVersion == "longterm" then "6.12.19" - else if config.microsoft-surface.kernelVersion == "latest" then + else if config.microsoft-surface.kernelVersion == "stable" then "6.13.6" else abort "Invalid kernel version: ${config.microsoft-surface.kernelVersion}"; @@ -56,10 +56,10 @@ in { options.microsoft-surface.kernelVersion = mkOption { description = "Kernel Version to use (patched for MS Surface)"; type = types.enum [ - "lts" - "latest" + "longterm" + "stable" ]; - default = "lts"; + default = "longterm"; }; config = { From 33aa2d8399259a2b761ebc52815566b7654ff1c9 Mon Sep 17 00:00:00 2001 From: Andre Date: Sat, 12 Apr 2025 11:28:09 -0400 Subject: [PATCH 058/134] microsoft/surface: decouple kernel source and linux-surface package versions --- microsoft/surface/common/default.nix | 61 ++++++++++++++++------------ 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/microsoft/surface/common/default.nix b/microsoft/surface/common/default.nix index 52435ec4..f40de69e 100644 --- a/microsoft/surface/common/default.nix +++ b/microsoft/surface/common/default.nix @@ -3,51 +3,58 @@ let inherit (lib) mkDefault mkOption types versions; - # Set the full kernel version and hashes - version = - if config.microsoft-surface.kernelVersion == "longterm" then + # Set the version and hash for the kernel sources + srcVersion = with config.microsoft-surface; + if kernelVersion == "longterm" then "6.12.19" - else if config.microsoft-surface.kernelVersion == "stable" then + else if kernelVersion == "stable" then "6.13.6" else - abort "Invalid kernel version: ${config.microsoft-surface.kernelVersion}"; - - shortVersion = versions.majorMinor version; - packageHash = - if shortVersion == "6.12" then - "sha256-Pv7O8D8ma+MPLhYP3HSGQki+Yczp8b7d63qMb6l4+mY=" - else if shortVersion == "6.13" then - "sha256-otD1ckNxNnvV8xipf9SZpbfg+bBq5EPwyieYtLIV4Ck=" - else - abort "Invalid kernel version: ${shortVersion}"; + abort "Invalid kernel version: ${kernelVersion}"; - srcHash = - if shortVersion == "6.12" then + srcHash = with config.microsoft-surface; + if kernelVersion == "longterm" then "sha256-1zvwV77ARDSxadG2FkGTb30Ml865I6KB8y413U3MZTE=" - else if shortVersion == "6.13" then + else if kernelVersion == "stable" then "sha256-3gBTy0E9QI8g/R1XiCGZUbikQD5drBsdkDIJCTis0Zk=" else - abort "Invalid kernel version: ${shortVersion}"; + abort "Invalid kernel version: ${kernelVersion}"; - # Fetch the release from the linux-surface project - rev = "arch-${version}-1"; - repos = pkgs.callPackage ({ fetchFromGitHub, rev, packageHash }: { + # Set the version and hash for the linux-surface releases + pkgVersion = with config.microsoft-surface; + if kernelVersion == "longterm" then + "6.12.7" + else if kernelVersion == "stable" then + "6.13.6" + else + abort "Invalid kernel version: ${kernelVersion}"; + + pkgHash = with config.microsoft-surface; + if kernelVersion == "longterm" then + "sha256-Pv7O8D8ma+MPLhYP3HSGQki+Yczp8b7d63qMb6l4+mY=" + else if kernelVersion == "stable" then + "sha256-otD1ckNxNnvV8xipf9SZpbfg+bBq5EPwyieYtLIV4Ck=" + else + abort "Invalid kernel version: ${kernelVersion}"; + + # Fetch the linux-surface package + repos = pkgs.callPackage ({ fetchFromGitHub, rev, hash }: { linux-surface = fetchFromGitHub { owner = "linux-surface"; repo = "linux-surface"; rev = rev; - hash = packageHash; + hash = hash; }; - }) { inherit rev packageHash; }; + }) { hash = pkgHash; rev = "arch-${pkgVersion}-1"; }; - # Build the kernel package + # Fetch and build the kernel package inherit (pkgs.callPackage ./kernel/linux-package.nix { inherit repos; }) linuxPackage surfacePatches; kernelPatches = surfacePatches { - inherit version; - patchFn = ./kernel/${shortVersion}/patches.nix; + version = pkgVersion; + patchFn = ./kernel/${versions.majorMinor pkgVersion}/patches.nix; }; kernelPackages = linuxPackage { - inherit version kernelPatches; + inherit kernelPatches; version = srcVersion; sha256 = srcHash; ignoreConfigErrors=true; }; From 48a8eaeac8059c23a2f8d6f41e8486a47d6ba95f Mon Sep 17 00:00:00 2001 From: Ganga Ram Date: Mon, 14 Apr 2025 11:10:36 +0400 Subject: [PATCH 059/134] Fixed native build issues for imx8mp-evk atf Signed-off-by: Ganga Ram --- nxp/imx8mp-evk/bsp/imx8mp-atf.nix | 89 ++++++++++++++++++------------ nxp/imx8mp-evk/bsp/imx8mp-boot.nix | 1 - 2 files changed, 53 insertions(+), 37 deletions(-) diff --git a/nxp/imx8mp-evk/bsp/imx8mp-atf.nix b/nxp/imx8mp-evk/bsp/imx8mp-atf.nix index 84e921f6..a75cec33 100644 --- a/nxp/imx8mp-evk/bsp/imx8mp-atf.nix +++ b/nxp/imx8mp-evk/bsp/imx8mp-atf.nix @@ -1,40 +1,57 @@ -{ - lib, - pkgs, - buildArmTrustedFirmware, - fetchgit, - enable-tee, -}: -with pkgs; let - opteedflag = - if enable-tee - then "SPD=opteed" - else ""; +{ lib, fetchgit, enable-tee, stdenv, buildPackages, pkgsCross, openssl, }: +let + opteedflag = if enable-tee then "SPD=opteed" else ""; target-board = "imx8mp"; -in - buildArmTrustedFirmware rec { - pname = "imx8mp-atf"; - platform = target-board; - enableParallelBuilding = true; - extraMeta.platforms = ["aarch64-linux"]; +in stdenv.mkDerivation rec { + pname = "imx8mp-atf"; + version = "lf6.1.55_2.2.0"; + platform = target-board; + enableParallelBuilding = true; - src = fetchgit { - url = "https://github.com/nxp-imx/imx-atf.git"; - #lf6.1.55_2.2.0 - rev = "08e9d4eef2262c0dd072b4325e8919e06d349e02"; - sha256 = "sha256-96EddJXlFEkP/LIGVgNBvUP4IDI3BbDE/c9Yub22gnc="; - }; + src = fetchgit { + url = "https://github.com/nxp-imx/imx-atf.git"; + rev = "08e9d4eef2262c0dd072b4325e8919e06d349e02"; + sha256 = "sha256-96EddJXlFEkP/LIGVgNBvUP4IDI3BbDE/c9Yub22gnc="; + }; - makeFlags = [ - "HOSTCC=$(CC_FOR_BUILD)" - "M0_CROSS_COMPILE=arm-none-eabi-" - "CROSS_COMPILE=aarch64-unknown-linux-gnu-" - # binutils 2.39 regression - # `warning: /build/source/build/rk3399/release/bl31/bl31.elf has a LOAD segment with RWX permissions` - # See also: https://developer.trustedfirmware.org/T996 - "LDFLAGS=-no-warn-rwx-segments" - "PLAT=${platform}" "bl31" "${opteedflag}" - ]; + depsBuildBuild = [ buildPackages.stdenv.cc ]; - filesToInstall = ["build/${target-board}/release/bl31.bin"]; - } + # For Cortex-M0 firmware in RK3399 + nativeBuildInputs = [ pkgsCross.arm-embedded.stdenv.cc ]; + + buildInputs = [ openssl ]; + + makeFlags = [ + "HOSTCC=$(CC_FOR_BUILD)" + "M0_CROSS_COMPILE=${pkgsCross.arm-embedded.stdenv.cc.targetPrefix}" + "CROSS_COMPILE=${stdenv.cc.targetPrefix}" + # binutils 2.39 regression + # `warning: /build/source/build/rk3399/release/bl31/bl31.elf has a LOAD segment with RWX permissions` + # See also: https://developer.trustedfirmware.org/T996 + "LDFLAGS=-no-warn-rwx-segments" + "PLAT=${platform}" + "bl31" + "${opteedflag}" + ]; + + installPhase = '' + runHook preInstall + + mkdir -p $out + cp build/${target-board}/release/bl31.bin $out + + runHook postInstall + ''; + + hardeningDisable = [ "all" ]; + dontStrip = true; + + meta = with lib; { + homepage = "https://github.com/nxp-imx/imx-atf"; + description = + "Reference implementation of secure world software for ARMv8-A"; + license = [ licenses.bsd3 ]; + maintainers = with maintainers; [ gngram ]; + platforms = [ "aarch64-linux" ]; + }; +} diff --git a/nxp/imx8mp-evk/bsp/imx8mp-boot.nix b/nxp/imx8mp-evk/bsp/imx8mp-boot.nix index 25e72ccb..c078f9ca 100644 --- a/nxp/imx8mp-evk/bsp/imx8mp-boot.nix +++ b/nxp/imx8mp-evk/bsp/imx8mp-boot.nix @@ -10,7 +10,6 @@ with pkgs; let else ""; imx8mp-atf = pkgs.callPackage ./imx8mp-atf.nix { - inherit (pkgs) buildArmTrustedFirmware; inherit enable-tee; }; imx8mp-firmware = pkgs.callPackage ./imx8mp-firmware.nix {}; From e3a967ba29a3fdb55373231a70fe791cd19945ed Mon Sep 17 00:00:00 2001 From: Ganga Ram Date: Mon, 14 Apr 2025 13:39:52 +0400 Subject: [PATCH 060/134] Fixed build issues for imx8mq-evk Signed-off-by: Ganga Ram --- nxp/imx8mq-evk/bsp/imx8mq-atf.nix | 83 +++++++++++++++++++----------- nxp/imx8mq-evk/bsp/imx8mq-boot.nix | 1 - 2 files changed, 53 insertions(+), 31 deletions(-) diff --git a/nxp/imx8mq-evk/bsp/imx8mq-atf.nix b/nxp/imx8mq-evk/bsp/imx8mq-atf.nix index 0d5028d6..a7e86b86 100644 --- a/nxp/imx8mq-evk/bsp/imx8mq-atf.nix +++ b/nxp/imx8mq-evk/bsp/imx8mq-atf.nix @@ -1,34 +1,57 @@ -{ - lib, - pkgs, - buildArmTrustedFirmware, - fetchgit, - enable-tee, -}: -with pkgs; let - opteedflag = - if enable-tee - then "SPD=opteed" - else ""; +{ lib, fetchgit, enable-tee, stdenv, buildPackages, pkgsCross, openssl, }: +let + opteedflag = if enable-tee then "SPD=opteed" else ""; target-board = "imx8mq"; -in - buildArmTrustedFirmware rec { - pname = "imx8mq-atf"; - platform = target-board; - enableParallelBuilding = true; - extraMeta.platforms = ["aarch64-linux"]; +in stdenv.mkDerivation rec { + pname = "imx8mq-atf"; + version = "lf6.1.55_2.2.0"; + platform = target-board; + enableParallelBuilding = true; - src = fetchgit { - url = "https://github.com/nxp-imx/imx-atf.git"; - #lf6.1.55_2.2.0 - rev = "08e9d4eef2262c0dd072b4325e8919e06d349e02"; - sha256 = "sha256-96EddJXlFEkP/LIGVgNBvUP4IDI3BbDE/c9Yub22gnc="; - }; + src = fetchgit { + url = "https://github.com/nxp-imx/imx-atf.git"; + rev = "08e9d4eef2262c0dd072b4325e8919e06d349e02"; + sha256 = "sha256-96EddJXlFEkP/LIGVgNBvUP4IDI3BbDE/c9Yub22gnc="; + }; - extraMakeFlags = lib.concatLists [ - (lib.optional (lib.versionAtLeast pkgs.binutils.version "2.39") "LDFLAGS=--no-warn-rwx-segments") - ["PLAT=${platform}" "bl31" "${opteedflag}"] - ]; + depsBuildBuild = [ buildPackages.stdenv.cc ]; - filesToInstall = ["build/${target-board}/release/bl31.bin"]; - } + # For Cortex-M0 firmware in RK3399 + nativeBuildInputs = [ pkgsCross.arm-embedded.stdenv.cc ]; + + buildInputs = [ openssl ]; + + makeFlags = [ + "HOSTCC=$(CC_FOR_BUILD)" + "M0_CROSS_COMPILE=${pkgsCross.arm-embedded.stdenv.cc.targetPrefix}" + "CROSS_COMPILE=${stdenv.cc.targetPrefix}" + # binutils 2.39 regression + # `warning: /build/source/build/rk3399/release/bl31/bl31.elf has a LOAD segment with RWX permissions` + # See also: https://developer.trustedfirmware.org/T996 + "LDFLAGS=-no-warn-rwx-segments" + "PLAT=${platform}" + "bl31" + "${opteedflag}" + ]; + + installPhase = '' + runHook preInstall + + mkdir -p $out + cp build/${target-board}/release/bl31.bin $out + + runHook postInstall + ''; + + hardeningDisable = [ "all" ]; + dontStrip = true; + + meta = with lib; { + homepage = "https://github.com/nxp-imx/imx-atf"; + description = + "Reference implementation of secure world software for ARMv8-A"; + license = [ licenses.bsd3 ]; + maintainers = with maintainers; [ gngram ]; + platforms = [ "aarch64-linux" ]; + }; +} diff --git a/nxp/imx8mq-evk/bsp/imx8mq-boot.nix b/nxp/imx8mq-evk/bsp/imx8mq-boot.nix index 72fcfc0a..f0e53d49 100644 --- a/nxp/imx8mq-evk/bsp/imx8mq-boot.nix +++ b/nxp/imx8mq-evk/bsp/imx8mq-boot.nix @@ -9,7 +9,6 @@ with pkgs; let else ""; imx8mq-atf = pkgs.callPackage ./imx8mq-atf.nix { - inherit (pkgs) buildArmTrustedFirmware; inherit enable-tee; }; imx8mq-firmware = pkgs.callPackage ./imx8mq-firmware.nix {}; From 0012cffb692c640807d1f19b395502499cc9d80b Mon Sep 17 00:00:00 2001 From: Andre Date: Sun, 20 Apr 2025 12:08:18 -0400 Subject: [PATCH 061/134] microsoft/surface: update stable linux-surface to 6.14.2 --- microsoft/surface/common/default.nix | 12 +- .../surface/common/kernel/6.13/patches.nix | 157 ----------------- .../surface/common/kernel/6.14/patches.nix | 158 ++++++++++++++++++ 3 files changed, 164 insertions(+), 163 deletions(-) delete mode 100644 microsoft/surface/common/kernel/6.13/patches.nix create mode 100644 microsoft/surface/common/kernel/6.14/patches.nix diff --git a/microsoft/surface/common/default.nix b/microsoft/surface/common/default.nix index f40de69e..09fa344a 100644 --- a/microsoft/surface/common/default.nix +++ b/microsoft/surface/common/default.nix @@ -6,17 +6,17 @@ let # Set the version and hash for the kernel sources srcVersion = with config.microsoft-surface; if kernelVersion == "longterm" then - "6.12.19" + "6.12.22" else if kernelVersion == "stable" then - "6.13.6" + "6.14.2" else abort "Invalid kernel version: ${kernelVersion}"; srcHash = with config.microsoft-surface; if kernelVersion == "longterm" then - "sha256-1zvwV77ARDSxadG2FkGTb30Ml865I6KB8y413U3MZTE=" + "sha256-q0iACrSZhaeNIxiuisXyj9PhI+oXNX7yFJgQWlMzczY=" else if kernelVersion == "stable" then - "sha256-3gBTy0E9QI8g/R1XiCGZUbikQD5drBsdkDIJCTis0Zk=" + "sha256-xcaCo1TqMZATk1elfTSnnlw3IhrOgjqTjhARa1d6Lhs=" else abort "Invalid kernel version: ${kernelVersion}"; @@ -25,7 +25,7 @@ let if kernelVersion == "longterm" then "6.12.7" else if kernelVersion == "stable" then - "6.13.6" + "6.14.2" else abort "Invalid kernel version: ${kernelVersion}"; @@ -33,7 +33,7 @@ let if kernelVersion == "longterm" then "sha256-Pv7O8D8ma+MPLhYP3HSGQki+Yczp8b7d63qMb6l4+mY=" else if kernelVersion == "stable" then - "sha256-otD1ckNxNnvV8xipf9SZpbfg+bBq5EPwyieYtLIV4Ck=" + "sha256-Pzn+C52TtDcqDVepM5z2cVNCsnRDy0Wwn+FLwgsuicQ=" else abort "Invalid kernel version: ${kernelVersion}"; diff --git a/microsoft/surface/common/kernel/6.13/patches.nix b/microsoft/surface/common/kernel/6.13/patches.nix deleted file mode 100644 index d905499f..00000000 --- a/microsoft/surface/common/kernel/6.13/patches.nix +++ /dev/null @@ -1,157 +0,0 @@ -{ lib, - kernel ? lib.kernel, - patchSrc, - version, -}: - -[ - { - name = "microsoft-surface-patches-linux-${version}"; - patch = null; - extraStructuredConfig = with kernel; { - STAGING_MEDIA = yes; - -## -## Surface Aggregator Module -## -CONFIG_SURFACE_AGGREGATOR= module; -# CONFIG_SURFACE_AGGREGATOR_ERROR_INJECTION is not set -CONFIG_SURFACE_AGGREGATOR_BUS= yes; -CONFIG_SURFACE_AGGREGATOR_CDEV= module; -CONFIG_SURFACE_AGGREGATOR_HUB= module; -CONFIG_SURFACE_AGGREGATOR_REGISTRY= module; -CONFIG_SURFACE_AGGREGATOR_TABLET_SWITCH= module; - -CONFIG_SURFACE_ACPI_NOTIFY= module; -CONFIG_SURFACE_DTX= module; -CONFIG_SURFACE_PLATFORM_PROFILE= module; - -CONFIG_SURFACE_HID= module; -CONFIG_SURFACE_KBD= module; - -CONFIG_BATTERY_SURFACE= module; -CONFIG_CHARGER_SURFACE= module; - -CONFIG_SENSORS_SURFACE_TEMP= module; -CONFIG_SENSORS_SURFACE_FAN= module; - -## -## Surface Hotplug -## -CONFIG_SURFACE_HOTPLUG= module; - -## -## IPTS and ITHC touchscreen -## -## This only enables the user interface for IPTS/ITHC data. -## For the touchscreen to work, you need to install iptsd. -## -CONFIG_HID_IPTS= module; -CONFIG_HID_ITHC= module; - -## -## Cameras: IPU3 -## -CONFIG_VIDEO_DW9719= module; -CONFIG_VIDEO_IPU3_IMGU= module; -CONFIG_VIDEO_IPU3_CIO2= module; -CONFIG_IPU_BRIDGE= module; -CONFIG_INTEL_SKL_INT3472= module; -CONFIG_REGULATOR_TPS68470= module; -CONFIG_COMMON_CLK_TPS68470= module; -CONFIG_LEDS_TPS68470= module; - -## -## Cameras: Sensor drivers -## -CONFIG_VIDEO_OV5693= module; -CONFIG_VIDEO_OV7251= module; -CONFIG_VIDEO_OV8865= module; - -## -## Surface 3: atomisp causes problems (see issue #1095). Disable it for now. -## -# CONFIG_INTEL_ATOMISP is not set - -## -## ALS Sensor for Surface Book 3, Surface Laptop 3, Surface Pro 7 -## -CONFIG_APDS9960= module; - -## -## Build-in UFS support (required for some Surface Go devices) -## -CONFIG_SCSI_UFSHCD= module; -CONFIG_SCSI_UFSHCD_PCI= module; - -## -## Other Drivers -## -CONFIG_INPUT_SOC_BUTTON_ARRAY= module; -CONFIG_SURFACE_3_POWER_OPREGION= module; -CONFIG_SURFACE_PRO3_BUTTON= module; -CONFIG_SURFACE_GPE= module; -CONFIG_SURFACE_BOOK1_DGPU_SWITCH= module; - }; - } - { - name = "ms-surface/0001-secureboot"; - patch = patchSrc + "/0001-secureboot.patch"; - } - { - name = "ms-surface/0002-surface3"; - patch = patchSrc + "/0002-surface3.patch"; - } - { - name = "ms-surface/0003-mwifiex"; - patch = patchSrc + "/0003-mwifiex.patch"; - } - { - name = "ms-surface/0004-ath10k"; - patch = patchSrc + "/0004-ath10k.patch"; - } - { - name = "ms-surface/0005-ipts"; - patch = patchSrc + "/0005-ipts.patch"; - } - { - name = "ms-surface/0006-ithc"; - patch = patchSrc + "/0006-ithc.patch"; - } - { - name = "ms-surface/0007-surface-sam"; - patch = patchSrc + "/0007-surface-sam.patch"; - } - { - name = "ms-surface/0008-surface-sam-over-hid"; - patch = patchSrc + "/0008-surface-sam-over-hid.patch"; - } - { - name = "ms-surface/0009-surface-button"; - patch = patchSrc + "/0009-surface-button.patch"; - } - { - name = "ms-surface/0010-surface-typecover"; - patch = patchSrc + "/0010-surface-typecover.patch"; - } - { - name = "ms-surface/0011-surface-shutdown"; - patch = patchSrc + "/0011-surface-shutdown.patch"; - } - { - name = "ms-surface/0012-surface-gpe"; - patch = patchSrc + "/0012-surface-gpe.patch"; - } - { - name = "ms-surface/0013-cameras"; - patch = patchSrc + "/0013-cameras.patch"; - } - { - name = "ms-surface/0014-amd-gpio"; - patch = patchSrc + "/0014-amd-gpio.patch"; - } - { - name = "ms-surface/0015-rtc"; - patch = patchSrc + "/0015-rtc.patch"; - } -] diff --git a/microsoft/surface/common/kernel/6.14/patches.nix b/microsoft/surface/common/kernel/6.14/patches.nix new file mode 100644 index 00000000..a78be406 --- /dev/null +++ b/microsoft/surface/common/kernel/6.14/patches.nix @@ -0,0 +1,158 @@ +{ lib, + kernel ? lib.kernel, + patchSrc, + version, +}: + +[ + { + name = "microsoft-surface-patches-linux-${version}"; + patch = null; + extraStructuredConfig = with kernel; { + STAGING_MEDIA = yes; + ## + ## Surface Aggregator Module + ## + CONFIG_SURFACE_AGGREGATOR = module; + # CONFIG_SURFACE_AGGREGATOR_ERROR_INJECTION is not set + CONFIG_SURFACE_AGGREGATOR_BUS = yes; + CONFIG_SURFACE_AGGREGATOR_CDEV = module; + CONFIG_SURFACE_AGGREGATOR_HUB = module; + CONFIG_SURFACE_AGGREGATOR_REGISTRY = module; + CONFIG_SURFACE_AGGREGATOR_TABLET_SWITCH = module; + + CONFIG_SURFACE_ACPI_NOTIFY = module; + CONFIG_SURFACE_DTX = module; + CONFIG_SURFACE_PLATFORM_PROFILE = module; + + CONFIG_SURFACE_HID = module; + CONFIG_SURFACE_KBD = module; + + CONFIG_BATTERY_SURFACE = module; + CONFIG_CHARGER_SURFACE = module; + + CONFIG_SENSORS_SURFACE_TEMP = module; + CONFIG_SENSORS_SURFACE_FAN = module; + + CONFIG_RTC_DRV_SURFACE = module; + + ## + ## Surface Hotplug + ## + CONFIG_SURFACE_HOTPLUG = module; + + ## + ## IPTS and ITHC touchscreen + ## + ## This only enables the user interface for IPTS/ITHC data. + ## For the touchscreen to work, you need to install iptsd. + ## + CONFIG_HID_IPTS = module; + CONFIG_HID_ITHC = module; + + ## + ## Cameras: IPU3 + ## + CONFIG_VIDEO_DW9719 = module; + CONFIG_VIDEO_IPU3_IMGU = module; + CONFIG_VIDEO_IPU3_CIO2 = module; + CONFIG_IPU_BRIDGE = module; + CONFIG_INTEL_SKL_INT3472 = module; + CONFIG_REGULATOR_TPS68470 = module; + CONFIG_COMMON_CLK_TPS68470 = module; + CONFIG_LEDS_TPS68470 = module; + + ## + ## Cameras: Sensor drivers + ## + CONFIG_VIDEO_OV5693 = module; + CONFIG_VIDEO_OV7251 = module; + CONFIG_VIDEO_OV8865 = module; + + ## + ## Surface 3: atomisp causes problems (see issue #1095). Disable it for now. + ## + # CONFIG_INTEL_ATOMISP is not set + + ## + ## ALS Sensor for Surface Book 3, Surface Laptop 3, Surface Pro 7 + ## + CONFIG_APDS9960 = module; + + ## + ## Build-in UFS support (required for some Surface Go devices) + ## + CONFIG_SCSI_UFSHCD = module; + CONFIG_SCSI_UFSHCD_PCI = module; + + ## + ## Other Drivers + ## + CONFIG_INPUT_SOC_BUTTON_ARRAY = module; + CONFIG_SURFACE_3_POWER_OPREGION = module; + CONFIG_SURFACE_PRO3_BUTTON = module; + CONFIG_SURFACE_GPE = module; + CONFIG_SURFACE_BOOK1_DGPU_SWITCH = module; + }; + } + { + name = "ms-surface/0001-secureboot"; + patch = patchSrc + "/0001-secureboot.patch"; + } + { + name = "ms-surface/0002-surface3"; + patch = patchSrc + "/0002-surface3.patch"; + } + { + name = "ms-surface/0003-mwifiex"; + patch = patchSrc + "/0003-mwifiex.patch"; + } + { + name = "ms-surface/0004-ath10k"; + patch = patchSrc + "/0004-ath10k.patch"; + } + { + name = "ms-surface/0005-ipts"; + patch = patchSrc + "/0005-ipts.patch"; + } + { + name = "ms-surface/0006-ithc"; + patch = patchSrc + "/0006-ithc.patch"; + } + { + name = "ms-surface/0007-surface-sam"; + patch = patchSrc + "/0007-surface-sam.patch"; + } + { + name = "ms-surface/0008-surface-sam-over-hid"; + patch = patchSrc + "/0008-surface-sam-over-hid.patch"; + } + { + name = "ms-surface/0009-surface-button"; + patch = patchSrc + "/0009-surface-button.patch"; + } + { + name = "ms-surface/0010-surface-typecover"; + patch = patchSrc + "/0010-surface-typecover.patch"; + } + { + name = "ms-surface/0011-surface-shutdown"; + patch = patchSrc + "/0011-surface-shutdown.patch"; + } + { + name = "ms-surface/0012-surface-gpe"; + patch = patchSrc + "/0012-surface-gpe.patch"; + } + { + name = "ms-surface/0013-cameras"; + patch = patchSrc + "/0013-cameras.patch"; + } + { + name = "ms-surface/0014-amd-gpio"; + patch = patchSrc + "/0014-amd-gpio.patch"; + } + { + name = "ms-surface/0015-rtc"; + patch = patchSrc + "/0015-rtc.patch"; + } +] From 047799739c0c04c11075018a23b5ec55e4652b24 Mon Sep 17 00:00:00 2001 From: QuietSeeker <123584613+QuietSeeker@users.noreply.github.com> Date: Fri, 11 Apr 2025 17:00:57 +0100 Subject: [PATCH 062/134] lenovo-legion-16arh7h: add integrated GPU only and hybrid configurations --- README.md | 2 ++ flake.nix | 2 ++ lenovo/legion/16arh7h/README.md | 4 +++ lenovo/legion/16arh7h/hybrid/default.nix | 32 +++++++++++++++++++++ lenovo/legion/16arh7h/igpu-only/default.nix | 11 +++++++ 5 files changed, 51 insertions(+) create mode 100644 lenovo/legion/16arh7h/README.md create mode 100644 lenovo/legion/16arh7h/hybrid/default.nix create mode 100644 lenovo/legion/16arh7h/igpu-only/default.nix diff --git a/README.md b/README.md index 29e22f7a..8b7849a2 100644 --- a/README.md +++ b/README.md @@ -221,6 +221,8 @@ See code for all available configurations. | [Lenovo Legion 5 Pro 16ach6h](lenovo/legion/16ach6h) | `` | | [Lenovo Legion 5 Pro 16ach6h (Hybrid)](lenovo/legion/16ach6h/hybrid) | `` | | [Lenovo Legion 5 Pro 16ach6h (Nvidia)](lenovo/legion/16ach6h/nvidia) | `` | +| [Lenovo Legion 5 Pro 16arh7h (IGPU Only)](lenovo/legion/16arh7h/igpu-only) | `` | +| [Lenovo Legion 5 Pro 16arh7h (Hybrid)](lenovo/legion/16arh7h/hybrid) | `` | | [Lenovo Legion 7 16achg6 (Hybrid)](lenovo/legion/16achg6/hybrid) | `` | | [Lenovo Legion 7 16achg6 (Nvidia)](lenovo/legion/16achg6/nvidia) | `` | | [Lenovo Legion 7i Pro 16irx8h (Intel)](lenovo/legion/16irx8h) | `` | diff --git a/flake.nix b/flake.nix index 629d8f71..4587806c 100644 --- a/flake.nix +++ b/flake.nix @@ -161,6 +161,8 @@ lenovo-legion-16ach6h = import ./lenovo/legion/16ach6h; lenovo-legion-16ach6h-hybrid = import ./lenovo/legion/16ach6h/hybrid; lenovo-legion-16ach6h-nvidia = import ./lenovo/legion/16ach6h/nvidia; + lenovo-legion-16arh7h-igpu-only = import ./lenovo/legion/16arh7h/igpu-only; + lenovo-legion-16arh7h-hybrid = import ./lenovo/legion/16arh7h/hybrid; lenovo-legion-16achg6-hybrid = import ./lenovo/legion/16achg6/hybrid; lenovo-legion-16achg6-nvidia = import ./lenovo/legion/16achg6/nvidia; lenovo-legion-16aph8 = import ./lenovo/legion/16aph8; diff --git a/lenovo/legion/16arh7h/README.md b/lenovo/legion/16arh7h/README.md new file mode 100644 index 00000000..0258d495 --- /dev/null +++ b/lenovo/legion/16arh7h/README.md @@ -0,0 +1,4 @@ +# Useful Links + +[NixOS Wiki - Nvidia](https://wiki.nixos.org/wiki/NVIDIA) + diff --git a/lenovo/legion/16arh7h/hybrid/default.nix b/lenovo/legion/16arh7h/hybrid/default.nix new file mode 100644 index 00000000..af6ff64a --- /dev/null +++ b/lenovo/legion/16arh7h/hybrid/default.nix @@ -0,0 +1,32 @@ +{ + config, + lib, + ... +}: { + imports = [ + ../../../../common/cpu/amd + ../../../../common/cpu/amd/pstate.nix + ../../../../common/gpu/nvidia/prime.nix # prime offload + ../../../../common/gpu/nvidia/ampere # use open drivers + ../../../../common/pc/laptop + ../../../../common/pc/laptop/ssd + ]; + + boot.kernelModules = ["amdgpu"]; + services.xserver.videoDrivers = ["nvidia"]; + + hardware = { + amdgpu.initrd.enable = false; + + nvidia = { + package = config.boot.kernelPackages.nvidiaPackages.latest; + modesetting.enable = lib.mkDefault true; + powerManagement.enable = lib.mkDefault true; + powerManagement.finegrained = lib.mkDefault true; + prime = { + amdgpuBusId = lib.mkDefault "PCI:52:0:0"; # Hexadecimal 34:00.0 + nvidiaBusId = lib.mkDefault "PCI:1:0:0"; # Hexadecimal 01:00.0 + }; + }; + }; +} diff --git a/lenovo/legion/16arh7h/igpu-only/default.nix b/lenovo/legion/16arh7h/igpu-only/default.nix new file mode 100644 index 00000000..c8e477f2 --- /dev/null +++ b/lenovo/legion/16arh7h/igpu-only/default.nix @@ -0,0 +1,11 @@ +# This will enable only the integrated AMD GPU, while disabling the dedicated Nvidia GPU +{...}: { + imports = [ + ../../../../common/cpu/amd + ../../../../common/cpu/amd/pstate.nix + ../../../../common/gpu/amd + ../../../../common/gpu/nvidia/disable.nix + ../../../../common/pc/laptop + ../../../../common/pc/laptop/ssd + ]; +} From 34f02c326d7458750b5ac30fae4b794cc0610ab4 Mon Sep 17 00:00:00 2001 From: Andre <10094408+8bitbuddhist@users.noreply.github.com> Date: Wed, 23 Apr 2025 09:49:58 -0400 Subject: [PATCH 063/134] Apply suggestions from code review - option name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add `hardware` to option name Co-authored-by: Jörg Thalheim --- microsoft/surface/README.md | 2 +- microsoft/surface/common/default.nix | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/microsoft/surface/README.md b/microsoft/surface/README.md index cc5dbde5..7fc5675c 100644 --- a/microsoft/surface/README.md +++ b/microsoft/surface/README.md @@ -42,7 +42,7 @@ There are multiple versions of the Surface kernel available: This repo uses `longterm` by default, but you can switch it to `stable` by adding this to your configuration file: ```nix -microsoft-surface.kernelVersion = "stable"; +hardware.microsoft-surface.kernelVersion = "stable"; ``` ### Support Tools diff --git a/microsoft/surface/common/default.nix b/microsoft/surface/common/default.nix index 09fa344a..361b802d 100644 --- a/microsoft/surface/common/default.nix +++ b/microsoft/surface/common/default.nix @@ -4,7 +4,7 @@ let inherit (lib) mkDefault mkOption types versions; # Set the version and hash for the kernel sources - srcVersion = with config.microsoft-surface; + srcVersion = with config.hardware.microsoft-surface; if kernelVersion == "longterm" then "6.12.22" else if kernelVersion == "stable" then @@ -12,7 +12,7 @@ let else abort "Invalid kernel version: ${kernelVersion}"; - srcHash = with config.microsoft-surface; + srcHash = with config.hardware.microsoft-surface; if kernelVersion == "longterm" then "sha256-q0iACrSZhaeNIxiuisXyj9PhI+oXNX7yFJgQWlMzczY=" else if kernelVersion == "stable" then @@ -21,7 +21,7 @@ let abort "Invalid kernel version: ${kernelVersion}"; # Set the version and hash for the linux-surface releases - pkgVersion = with config.microsoft-surface; + pkgVersion = with config.hardware.microsoft-surface; if kernelVersion == "longterm" then "6.12.7" else if kernelVersion == "stable" then @@ -29,7 +29,7 @@ let else abort "Invalid kernel version: ${kernelVersion}"; - pkgHash = with config.microsoft-surface; + pkgHash = with config.hardware.microsoft-surface; if kernelVersion == "longterm" then "sha256-Pv7O8D8ma+MPLhYP3HSGQki+Yczp8b7d63qMb6l4+mY=" else if kernelVersion == "stable" then @@ -60,7 +60,7 @@ let }; in { - options.microsoft-surface.kernelVersion = mkOption { + options.hardware.microsoft-surface.kernelVersion = mkOption { description = "Kernel Version to use (patched for MS Surface)"; type = types.enum [ "longterm" From 306ff6c5f6b5554ef5e99af7cc336518d51538d3 Mon Sep 17 00:00:00 2001 From: Andre Date: Wed, 23 Apr 2025 13:44:36 -0400 Subject: [PATCH 064/134] surface: revert longterm kernel to 6.12.19 --- microsoft/surface/common/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/microsoft/surface/common/default.nix b/microsoft/surface/common/default.nix index 361b802d..5d9d7d98 100644 --- a/microsoft/surface/common/default.nix +++ b/microsoft/surface/common/default.nix @@ -6,7 +6,7 @@ let # Set the version and hash for the kernel sources srcVersion = with config.hardware.microsoft-surface; if kernelVersion == "longterm" then - "6.12.22" + "6.12.19" else if kernelVersion == "stable" then "6.14.2" else @@ -14,7 +14,7 @@ let srcHash = with config.hardware.microsoft-surface; if kernelVersion == "longterm" then - "sha256-q0iACrSZhaeNIxiuisXyj9PhI+oXNX7yFJgQWlMzczY=" + "sha256-1zvwV77ARDSxadG2FkGTb30Ml865I6KB8y413U3MZTE=" else if kernelVersion == "stable" then "sha256-xcaCo1TqMZATk1elfTSnnlw3IhrOgjqTjhARa1d6Lhs=" else From 3fd285f3860727e5af8d8859db914392cfdab5ef Mon Sep 17 00:00:00 2001 From: Petr Hodina Date: Sat, 12 Apr 2025 08:24:21 +0200 Subject: [PATCH 065/134] lenovo-thinkpad-x13s: Add support for aarch64 system --- README.md | 1 + flake.nix | 1 + lenovo/thinkpad/x13s/README.md | 10 +++ lenovo/thinkpad/x13s/default.nix | 101 +++++++++++++++++++++++++++++++ 4 files changed, 113 insertions(+) create mode 100644 lenovo/thinkpad/x13s/README.md create mode 100644 lenovo/thinkpad/x13s/default.nix diff --git a/README.md b/README.md index 29e22f7a..273ca628 100644 --- a/README.md +++ b/README.md @@ -294,6 +294,7 @@ See code for all available configurations. | [Lenovo ThinkPad X1 Extreme Gen 3](lenovo/thinkpad/x1-extreme/gen3) | `` | | [Lenovo ThinkPad X1 Extreme Gen 4](lenovo/thinkpad/x1-extreme/gen4) | `` | | [Lenovo ThinkPad X1 Nano Gen 1](lenovo/thinkpad/x1-nano/gen1) | `` | +| [Lenovo ThinkPad X13s](lenovo/thinkpad/x13s) | `` | | [Lenovo ThinkPad X13 Yoga](lenovo/thinkpad/x13/yoga) | `` | | [Lenovo ThinkPad X13 Yoga (3th Gen)](lenovo/thinkpad/x13/yoga/3th-gen) | `` | | [Lenovo ThinkPad X13 (Intel)](lenovo/thinkpad/x13/intel) | `` | diff --git a/flake.nix b/flake.nix index 629d8f71..848265ca 100644 --- a/flake.nix +++ b/flake.nix @@ -244,6 +244,7 @@ lenovo-thinkpad-x13-amd = import ./lenovo/thinkpad/x13/amd; lenovo-thinkpad-x13-yoga = import ./lenovo/thinkpad/x13/yoga; lenovo-thinkpad-x13-yoga-3th-gen = import ./lenovo/thinkpad/x13/yoga/3th-gen; + lenovo-thinkpad-x13s = import ./lenovo/thinkpad/x13s; lenovo-thinkpad-x140e = import ./lenovo/thinkpad/x140e; lenovo-thinkpad-x200s = import ./lenovo/thinkpad/x200s; lenovo-thinkpad-x220 = import ./lenovo/thinkpad/x220; diff --git a/lenovo/thinkpad/x13s/README.md b/lenovo/thinkpad/x13s/README.md new file mode 100644 index 00000000..f4608185 --- /dev/null +++ b/lenovo/thinkpad/x13s/README.md @@ -0,0 +1,10 @@ +# Lenovo X13s + +[Debian](https://wiki.debian.org/InstallingDebianOn/Thinkpad/X13s) +[PostmarketOS](https://wiki.postmarketos.org/wiki/Lenovo_ThinkPad_X13s_(lenovo-21bx)) + +## Camera +The MIPI camera does work, however, it's not accelerated by the ISP and therefore image processing is done on CPU. + +## Wifi and Bluetooth MAC addresses +Currently they need to be set manually diff --git a/lenovo/thinkpad/x13s/default.nix b/lenovo/thinkpad/x13s/default.nix new file mode 100644 index 00000000..161d3891 --- /dev/null +++ b/lenovo/thinkpad/x13s/default.nix @@ -0,0 +1,101 @@ +{ lib, pkgs, ... }: + +let + dtbName = "sc8280xp-lenovo-thinkpad-x13s.dtb"; + dtb = "${pkgs.linux}/dtbs/qcom/${dtbName}"; + # Version the dtb based on the kernel + dtbEfiPath = "dtbs/x13s-${pkgs.linux.version}.dtb"; + cfg = { + wifiMac = "e4:65:38:52:22:a9"; + bluetoothMac = "E4:25:18:22:44:AA"; + }; + inherit (lib) mkDefault; +in +{ + imports = [ + ../. + ../../../common/pc/laptop + ]; + + boot = { + loader.systemd-boot.extraFiles = { + "${dtbEfiPath}" = dtb; + }; + + kernelParams = mkDefault [ + # needed to boot + "dtb=${dtbEfiPath}" + + # jhovold recommended + "clk_ignore_unused" + "pd_ignore_unused" + "arm64.nopauth" + ]; + + kernelModules = mkDefault [ + "nvme" + "phy-qcom-qmp-pcie" + "pcie-qcom" + + "i2c-core" + "i2c-hid" + "i2c-hid-of" + "i2c-qcom-geni" + + "leds_qcom_lpg" + "pwm_bl" + "qrtr" + "pmic_glink_altmode" + "gpio_sbu_mux" + "phy-qcom-qmp-combo" + "gpucc_sc8280xp" + "dispcc_sc8280xp" + "phy_qcom_edp" + "panel-edp" + "msm" + ]; + }; + + hardware.enableRedistributableFirmware = mkDefault true; + + systemd.services.bluetooth-x13s-mac = lib.mkIf (cfg.bluetoothMac != null) { + wantedBy = [ "multi-user.target" ]; + before = [ "bluetooth.service" ]; + requiredBy = [ "bluetooth.service" ]; + + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + ExecStart = "${pkgs.util-linux}/bin/script -q -c '${pkgs.bluez}/bin/btmgmt --index 0 public-addr ${cfg.bluetoothMac}'"; + }; + }; + + # https://github.com/jhovold/linux/wiki/X13s#modem + networking.networkmanager.fccUnlockScripts = [ + + { + id = "105b:e0c3"; + path = "${pkgs.modemmanager}/share/ModemManager/fcc-unlock.available.d/105b"; + } + ]; + + # https://github.com/jhovold/linux/wiki/X13s#camera + services.udev.extraRules = lib.strings.concatLines ( + [ + '' + ACTION=="add", SUBSYSTEM=="dma_heap", KERNEL=="linux,cma", GROUP="video", MODE="0660" + ACTION=="add", SUBSYSTEM=="dma_heap", KERNEL=="system", GROUP="video", MODE="0660" + '' + ] + ++ ( + if cfg.wifiMac != null then + [ + '' + ACTION=="add", SUBSYSTEM=="net", KERNELS=="0006:01:00.0", RUN+="${pkgs.iproute2}/bin/ip link set dev $name address ${cfg.wifiMac}" + '' + ] + else + [ ] + ) + ); +} From d07bb614490b4e55765b5c963ac88375fb53d0da Mon Sep 17 00:00:00 2001 From: VuiMuich Date: Sat, 26 Apr 2025 15:21:12 +0200 Subject: [PATCH 066/134] lenovo-thinkpad-x1-2nd-gen --- README.md | 1 + flake.nix | 1 + lenovo/thinkpad/x1/2nd-gen/default.nix | 10 ++++++++++ 3 files changed, 12 insertions(+) create mode 100644 lenovo/thinkpad/x1/2nd-gen/default.nix diff --git a/README.md b/README.md index b68ee6b7..77942129 100644 --- a/README.md +++ b/README.md @@ -286,6 +286,7 @@ See code for all available configurations. | [Lenovo ThinkPad W520](lenovo/thinkpad/w520) | `` | | [Lenovo ThinkPad X1 Yoga](lenovo/thinkpad/x1/yoga) | `` | | [Lenovo ThinkPad X1 Yoga Gen 7](lenovo/thinkpad/x1/yoga/7th-gen/) | `` | +| [Lenovo ThinkPad X1 (2nd Gen)](lenovo/thinkpad/x1/2nd-gen) | `` | | [Lenovo ThinkPad X1 (6th Gen)](lenovo/thinkpad/x1/6th-gen) | `` | | [Lenovo ThinkPad X1 (7th Gen)](lenovo/thinkpad/x1/7th-gen) | `` | | [Lenovo ThinkPad X1 (9th Gen)](lenovo/thinkpad/x1/9th-gen) | `` | diff --git a/flake.nix b/flake.nix index 68cc77a7..fc673574 100644 --- a/flake.nix +++ b/flake.nix @@ -230,6 +230,7 @@ lenovo-thinkpad-x1 = import ./lenovo/thinkpad/x1; lenovo-thinkpad-x1-yoga = import ./lenovo/thinkpad/x1/yoga; lenovo-thinkpad-x1-yoga-7th-gen = import ./lenovo/thinkpad/x1/yoga/7th-gen; + lenovo-thinkpad-x1-2nd-gen = import ./lenovo/thinkpad/x1/2nd-gen; lenovo-thinkpad-x1-6th-gen = import ./lenovo/thinkpad/x1/6th-gen; lenovo-thinkpad-x1-7th-gen = import ./lenovo/thinkpad/x1/7th-gen; lenovo-thinkpad-x1-9th-gen = import ./lenovo/thinkpad/x1/9th-gen; diff --git a/lenovo/thinkpad/x1/2nd-gen/default.nix b/lenovo/thinkpad/x1/2nd-gen/default.nix new file mode 100644 index 00000000..ac338c61 --- /dev/null +++ b/lenovo/thinkpad/x1/2nd-gen/default.nix @@ -0,0 +1,10 @@ +{ lib, ... }: +{ + imports = [ + ../. + ../../../../common/cpu/intel/haswell + ../../../../common/pc/laptop/ssd + ]; + + services.throttled.enable = lib.mkDefault true; +} From f16e0cd51c8bb6df7bfc5b7bbec3b36ed59020ae Mon Sep 17 00:00:00 2001 From: Johannes Arnold Date: Sat, 19 Apr 2025 12:15:00 +0200 Subject: [PATCH 067/134] Add yt6801 driver for TUXEDO InfinityBook Pro 14 - Gen9 - INTEL --- flake.nix | 2 +- tuxedo/infinitybook/gen9-intel/default.nix | 11 +++++++++++ tuxedo/infinitybook/pro14/gen9-intel/default.nix | 6 ------ .../infinitybook/pro14/{gen9-intel => gen9}/README.md | 0 tuxedo/infinitybook/pro14/gen9/default.nix | 9 +++++++++ tuxedo/infinitybook/pro14/gen9/intel/default.nix | 6 ++++++ 6 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 tuxedo/infinitybook/gen9-intel/default.nix delete mode 100644 tuxedo/infinitybook/pro14/gen9-intel/default.nix rename tuxedo/infinitybook/pro14/{gen9-intel => gen9}/README.md (100%) create mode 100644 tuxedo/infinitybook/pro14/gen9/default.nix create mode 100644 tuxedo/infinitybook/pro14/gen9/intel/default.nix diff --git a/flake.nix b/flake.nix index fc673574..fc84741f 100644 --- a/flake.nix +++ b/flake.nix @@ -334,7 +334,7 @@ tuxedo-aura-15-gen1 = import ./tuxedo/aura/15/gen1; tuxedo-infinitybook-v4 = import ./tuxedo/infinitybook/v4; tuxedo-infinitybook-pro14-gen7 = import ./tuxedo/infinitybook/pro14/gen7; - tuxedo-infinitybook-pro14-gen9-intel = import ./tuxedo/infinitybook/pro14/gen9-intel; + tuxedo-infinitybook-pro14-gen9-intel = import ./tuxedo/infinitybook/pro14/gen9/intel; tuxedo-pulse-14-gen3 = import ./tuxedo/pulse/14/gen3; tuxedo-pulse-15-gen2 = import ./tuxedo/pulse/15/gen2; xiaomi-redmibook-16-pro-2024 = import ./xiaomi/redmibook/16-pro-2024; diff --git a/tuxedo/infinitybook/gen9-intel/default.nix b/tuxedo/infinitybook/gen9-intel/default.nix new file mode 100644 index 00000000..3f0b97a2 --- /dev/null +++ b/tuxedo/infinitybook/gen9-intel/default.nix @@ -0,0 +1,11 @@ +{ + warnings = [ + '' + DEPRECATED: The module has been renamed to + + The gen9-intel module will be removed in a future release. + '' + ]; + + imports = [ ../pro14/gen9/intel ]; +} diff --git a/tuxedo/infinitybook/pro14/gen9-intel/default.nix b/tuxedo/infinitybook/pro14/gen9-intel/default.nix deleted file mode 100644 index 4b6ee893..00000000 --- a/tuxedo/infinitybook/pro14/gen9-intel/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - imports = [ - ../../. - ../../../../common/cpu/intel - ]; -} diff --git a/tuxedo/infinitybook/pro14/gen9-intel/README.md b/tuxedo/infinitybook/pro14/gen9/README.md similarity index 100% rename from tuxedo/infinitybook/pro14/gen9-intel/README.md rename to tuxedo/infinitybook/pro14/gen9/README.md diff --git a/tuxedo/infinitybook/pro14/gen9/default.nix b/tuxedo/infinitybook/pro14/gen9/default.nix new file mode 100644 index 00000000..7662c658 --- /dev/null +++ b/tuxedo/infinitybook/pro14/gen9/default.nix @@ -0,0 +1,9 @@ +{ lib, config, ... }: { + imports = [ + ../../. + ]; + + # Add Motorcomm YT6801 Driver if available + boot.extraModulePackages = with config.boot; lib.lists.optional + ( kernelPackages ? yt6801 ) kernelPackages.yt6801; +} diff --git a/tuxedo/infinitybook/pro14/gen9/intel/default.nix b/tuxedo/infinitybook/pro14/gen9/intel/default.nix new file mode 100644 index 00000000..80d5c29c --- /dev/null +++ b/tuxedo/infinitybook/pro14/gen9/intel/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ../. + ../../../../../common/cpu/intel + ]; +} From c56ef7b7228987345916b74ac9ddb3886c8a0c23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 29 Apr 2025 07:52:25 +0200 Subject: [PATCH 068/134] dell-precision-5530: remove unnecessary default nvidia options In the nvidia module, we already disable the open source driver and we default to the stable nvidia package --- dell/precision/5530/default.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dell/precision/5530/default.nix b/dell/precision/5530/default.nix index 6f270c26..84ac324b 100644 --- a/dell/precision/5530/default.nix +++ b/dell/precision/5530/default.nix @@ -1,4 +1,4 @@ -{ lib, config, ... }: +{ lib, ... }: { imports = [ @@ -29,19 +29,17 @@ hardware = { nvidia = { - open = lib.mkDefault false; nvidiaSettings = lib.mkDefault true; modesetting.enable = lib.mkDefault true; - package = lib.mkDefault config.boot.kernelPackages.nvidiaPackages.stable; prime = { intelBusId = lib.mkDefault "PCI:0:2:0"; nvidiaBusId = lib.mkDefault "PCI:1:0:0"; }; }; }; - # This will save you money and possibly your life! services = { fwupd.enable = lib.mkDefault true; + # This will save you money and possibly your life! thermald.enable = lib.mkDefault true; }; } From 342b1b319d04d4afe775752523feb643e23f4397 Mon Sep 17 00:00:00 2001 From: Relief Melone Date: Sun, 3 Nov 2024 23:36:46 +0100 Subject: [PATCH 069/134] gu605my: modsettings, fn keys and use laptop/ssd --- asus/zephyrus/gu605my/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/asus/zephyrus/gu605my/default.nix b/asus/zephyrus/gu605my/default.nix index f9f1d9ac..003dbf13 100644 --- a/asus/zephyrus/gu605my/default.nix +++ b/asus/zephyrus/gu605my/default.nix @@ -6,7 +6,7 @@ ../../../common/gpu/nvidia/prime.nix ../../../common/gpu/nvidia/ada-lovelace ../../../common/pc/laptop - ../../../common/pc/ssd + ../../../common/pc/laptop/ssd ]; hardware.nvidia = { @@ -15,6 +15,7 @@ nvidiaBusId = "PCI:1:0:0"; }; + modesetting.enable = lib.mkDefault true; dynamicBoost.enable = lib.mkDefault true; }; @@ -23,7 +24,9 @@ udev.extraHwdb = '' evdev:name:*:dmi:bvn*:bvr*:bd*:svnASUS*:pn*:* - KEYBOARD_KEY_ff31007c=f20 # fixes mic mute button + KEYBOARD_KEY_ff31007c=f20 # fixes mic mute button + KEYBOARD_KEY_ff3100b2=home # Set fn+LeftArrow as Home + KEYBOARD_KEY_ff3100b3=end # Set fn+RightArrow as End ''; }; } From f1e52a018166e1a324f832de913e12c0e55792d0 Mon Sep 17 00:00:00 2001 From: Relief Melone Date: Tue, 7 Jan 2025 17:21:49 +0100 Subject: [PATCH 070/134] gu605my: enable zeph g16 backlight control --- asus/zephyrus/gu605my/default.nix | 1 + asus/zephyrus/shared/backlight.nix | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 asus/zephyrus/shared/backlight.nix diff --git a/asus/zephyrus/gu605my/default.nix b/asus/zephyrus/gu605my/default.nix index 003dbf13..d1ce68bb 100644 --- a/asus/zephyrus/gu605my/default.nix +++ b/asus/zephyrus/gu605my/default.nix @@ -7,6 +7,7 @@ ../../../common/gpu/nvidia/ada-lovelace ../../../common/pc/laptop ../../../common/pc/laptop/ssd + ../shared/backlight.nix ]; hardware.nvidia = { diff --git a/asus/zephyrus/shared/backlight.nix b/asus/zephyrus/shared/backlight.nix new file mode 100644 index 00000000..938ce4ac --- /dev/null +++ b/asus/zephyrus/shared/backlight.nix @@ -0,0 +1,9 @@ +{ ... }: +{ + # These flags are used to enable backlight control when the dGPU is working in hybrid mode + boot.kernelParams = [ + "i915.enable_dpcd_backlight=1" + "nvidia.NVreg_EnableBacklightHandler=0" + "nvidia.NVReg_RegistryDwords=EnableBrightnessControl=0" + ]; +} From 6267b43af934ed22b2402b065ceeec3f9a276312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Zavala=20Villag=C3=B3mez?= Date: Mon, 28 Apr 2025 02:34:19 -0400 Subject: [PATCH 071/134] hp/elitebook/830/g6: check kernel version through `config` instead of `pkgs` The previous implementation was checking the kernel version through `pkgs.linux`, which is only representative of the final system if `boot.kernelPackages` is left as the default value of `pkgs.linuxPackages`. You can of course change this to other package sets, such as `pkgs.linuxPackages_latest`. Instead, we now reference the kernel through `config.boot.kernelPackages.kernel`. --- hp/elitebook/830/g6/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hp/elitebook/830/g6/default.nix b/hp/elitebook/830/g6/default.nix index 3b209b46..9e62264f 100644 --- a/hp/elitebook/830/g6/default.nix +++ b/hp/elitebook/830/g6/default.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, ... }: +{ config, lib, ... }: { imports = [ ../../../../common/cpu/intel @@ -16,7 +16,7 @@ services.fwupd.enable = lib.mkDefault true; # Enables ACPI platform profiles - boot = lib.mkIf (lib.versionAtLeast pkgs.linux.version "6.1") { + boot = lib.mkIf (lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.1") { kernelModules = [ "hp-wmi" ]; }; From 6e80224000e1ee4a883cb0f26e3ac7510aaefe90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Zavala=20Villag=C3=B3mez?= Date: Mon, 28 Apr 2025 02:37:02 -0400 Subject: [PATCH 072/134] lenovo/thinkpad/p14s: check kernel version through `config` instead of `pkgs` The previous implementation was checking the kernel version through `pkgs.linux`, which is only representative of the final system if `boot.kernelPackages` is left as the default value of `pkgs.linuxPackages`. You can of course change this to other package sets, such as `pkgs.linuxPackages_latest`. Instead, we now reference the kernel through `config.boot.kernelPackages.kernel`. --- lenovo/thinkpad/p14s/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lenovo/thinkpad/p14s/default.nix b/lenovo/thinkpad/p14s/default.nix index edaeda86..6e87b7bc 100644 --- a/lenovo/thinkpad/p14s/default.nix +++ b/lenovo/thinkpad/p14s/default.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, ... }: +{ config, lib, pkgs, ... }: { # P14s is a rebadged T14 with slight internal differences. @@ -14,7 +14,7 @@ # "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 pkgs.linux.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; From 01f1548e40f6f629d370bc43b4623b52b30fef85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Zavala=20Villag=C3=B3mez?= Date: Mon, 28 Apr 2025 02:40:37 -0400 Subject: [PATCH 073/134] lenovo/thinkpad/x13s: source kernel through `config` instead of `pkgs` The previous implementation was sourcing the kernel through `pkgs.linux`, which is only representative of the final system if `boot.kernelPackages` is left as the default value of `pkgs.linuxPackages`. You can of course change this to other package sets, such as `pkgs.linuxPackages_latest`. Instead, we now reference the kernel through `config.boot.kernelPackages.kernel`. --- lenovo/thinkpad/x13s/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lenovo/thinkpad/x13s/default.nix b/lenovo/thinkpad/x13s/default.nix index 161d3891..dd9159dc 100644 --- a/lenovo/thinkpad/x13s/default.nix +++ b/lenovo/thinkpad/x13s/default.nix @@ -1,10 +1,12 @@ -{ lib, pkgs, ... }: +{ config, lib, pkgs, ... }: let + inherit (config.boot.kernelPackages) kernel; + dtbName = "sc8280xp-lenovo-thinkpad-x13s.dtb"; - dtb = "${pkgs.linux}/dtbs/qcom/${dtbName}"; + dtb = "${kernel}/dtbs/qcom/${dtbName}"; # Version the dtb based on the kernel - dtbEfiPath = "dtbs/x13s-${pkgs.linux.version}.dtb"; + dtbEfiPath = "dtbs/x13s-${kernel.version}.dtb"; cfg = { wifiMac = "e4:65:38:52:22:a9"; bluetoothMac = "E4:25:18:22:44:AA"; From 232c204afb36fa16a928e8c0a289f8cf8313be72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Zavala=20Villag=C3=B3mez?= Date: Mon, 28 Apr 2025 02:16:15 -0400 Subject: [PATCH 074/134] omen/*: check kernel version through `config` instead of `pkgs` The previous implementation was checking the kernel version through `pkgs.linux`, which is only representative of the final system if `boot.kernelPackages` is left as the default value of `pkgs.linuxPackages`. You can of course change this to other package sets, such as `pkgs.linuxPackages_latest`. Instead, we now reference the kernel through `config.boot.kernelPackages.kernel`. --- omen/14-fb0798ng/default.nix | 4 ++-- omen/15-en0010ca/default.nix | 4 ++-- omen/15-en1007sa/default.nix | 4 ++-- omen/16-n0005ne/default.nix | 4 ++-- omen/16-n0280nd/default.nix | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/omen/14-fb0798ng/default.nix b/omen/14-fb0798ng/default.nix index b1382455..f5cc17d7 100644 --- a/omen/14-fb0798ng/default.nix +++ b/omen/14-fb0798ng/default.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, ... }: +{ config, lib, ... }: { imports = [ @@ -10,7 +10,7 @@ ]; # Enables ACPI platform profiles - boot = lib.mkIf (lib.versionAtLeast pkgs.linux.version "6.1") { + boot = lib.mkIf (lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.1") { kernelModules = [ "hp-wmi" ]; }; diff --git a/omen/15-en0010ca/default.nix b/omen/15-en0010ca/default.nix index da3c85e8..c99e8066 100644 --- a/omen/15-en0010ca/default.nix +++ b/omen/15-en0010ca/default.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, ... }: +{ config, lib, ... }: { imports = [ @@ -12,7 +12,7 @@ ]; # Enables ACPI platform profiles - boot = lib.mkIf (lib.versionAtLeast pkgs.linux.version "6.1") { + boot = lib.mkIf (lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.1") { kernelModules = [ "hp-wmi" ]; }; diff --git a/omen/15-en1007sa/default.nix b/omen/15-en1007sa/default.nix index 704e4d8b..cdb09a82 100644 --- a/omen/15-en1007sa/default.nix +++ b/omen/15-en1007sa/default.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, ... }: +{ config, lib, ... }: { imports = [ @@ -11,7 +11,7 @@ ]; # Enables ACPI platform profiles - boot = lib.mkIf (lib.versionAtLeast pkgs.linux.version "6.1") { + boot = lib.mkIf (lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.1") { kernelModules = [ "hp-wmi" ]; }; diff --git a/omen/16-n0005ne/default.nix b/omen/16-n0005ne/default.nix index e8bfea83..c8d5636c 100644 --- a/omen/16-n0005ne/default.nix +++ b/omen/16-n0005ne/default.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, ... }: +{ config, lib, ... }: { imports = [ @@ -10,7 +10,7 @@ ]; # Enables ACPI platform profiles - boot = lib.mkIf (lib.versionAtLeast pkgs.linux.version "6.1") { + boot = lib.mkIf (lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.1") { kernelModules = [ "hp-wmi" ]; }; } diff --git a/omen/16-n0280nd/default.nix b/omen/16-n0280nd/default.nix index 704e4d8b..cdb09a82 100644 --- a/omen/16-n0280nd/default.nix +++ b/omen/16-n0280nd/default.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, ... }: +{ config, lib, ... }: { imports = [ @@ -11,7 +11,7 @@ ]; # Enables ACPI platform profiles - boot = lib.mkIf (lib.versionAtLeast pkgs.linux.version "6.1") { + boot = lib.mkIf (lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.1") { kernelModules = [ "hp-wmi" ]; }; From c06d50adebc684d5659fe8426ac29fb85f3bde3c Mon Sep 17 00:00:00 2001 From: Connor Prussin Date: Fri, 25 Apr 2025 07:01:53 -0700 Subject: [PATCH 075/134] Add Framework AMD AI 300 Series --- README.md | 1 + flake.nix | 1 + framework/13-inch/amd-ai-300-series/README.md | 15 +++++++++++++++ framework/13-inch/amd-ai-300-series/default.nix | 9 +++++++++ 4 files changed, 26 insertions(+) create mode 100644 framework/13-inch/amd-ai-300-series/README.md create mode 100644 framework/13-inch/amd-ai-300-series/default.nix diff --git a/README.md b/README.md index 77942129..098b39cb 100644 --- a/README.md +++ b/README.md @@ -180,6 +180,7 @@ See code for all available configurations. | [Framework 13th Gen Intel Core](framework/13-inch/13th-gen-intel) | `` | | [Framework Intel Core Ultra Series 1](framework/13-inch/intel-core-ultra-series1) | `` | | [Framework 13 AMD Ryzen 7040 Series](framework/13-inch/7040-amd) | `` | +| [Framework 13 AMD AI 300 Series](framework/13-inch/amd-ai-300-series) | `` | | [Framework 16 AMD Ryzen 7040 Series](framework/16-inch/7040-amd) | `` | | [FriendlyARM NanoPC-T4](friendlyarm/nanopc-t4) | `` | | [FriendlyARM NanoPi R5s](friendlyarm/nanopi-r5s) | `` | diff --git a/flake.nix b/flake.nix index fc84741f..2af97858 100644 --- a/flake.nix +++ b/flake.nix @@ -122,6 +122,7 @@ framework-13th-gen-intel = import ./framework/13-inch/13th-gen-intel; framework-intel-core-ultra-series1 = import ./framework/13-inch/intel-core-ultra-series1; framework-13-7040-amd = import ./framework/13-inch/7040-amd; + framework-amd-ai-300-series = import ./framework/13-inch/amd-ai-300-series; framework-16-7040-amd = import ./framework/16-inch/7040-amd; friendlyarm-nanopc-t4 = import ./friendlyarm/nanopc-t4; friendlyarm-nanopi-r5s = import ./friendlyarm/nanopi-r5s; diff --git a/framework/13-inch/amd-ai-300-series/README.md b/framework/13-inch/amd-ai-300-series/README.md new file mode 100644 index 00000000..8f3b7a42 --- /dev/null +++ b/framework/13-inch/amd-ai-300-series/README.md @@ -0,0 +1,15 @@ +# [Framework Laptop 13](https://frame.work/) + +## Updating Firmware + +First put enable `fwupd` + +```nix +services.fwupd.enable = true; +``` + +Then run + +```sh + $ fwupdmgr update +``` diff --git a/framework/13-inch/amd-ai-300-series/default.nix b/framework/13-inch/amd-ai-300-series/default.nix new file mode 100644 index 00000000..33c5ec67 --- /dev/null +++ b/framework/13-inch/amd-ai-300-series/default.nix @@ -0,0 +1,9 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ../common + ../common/amd.nix + ]; + config.hardware.framework.laptop13.audioEnhancement.rawDeviceName = lib.mkDefault "alsa_output.pci-0000_c1_00.6.analog-stereo"; +} From 72081c9fbbef63765ae82bff9727ea79cc86bd5b Mon Sep 17 00:00:00 2001 From: Benedikt Rips Date: Fri, 25 Apr 2025 00:44:36 +0200 Subject: [PATCH 076/134] dell-precision-3490: init module --- README.md | 1 + common/cpu/intel/meteor-lake/default.nix | 6 ++++++ common/gpu/intel/meteor-lake/default.nix | 5 +++++ dell/precision/3490/default.nix | 21 +++++++++++++++++++++ flake.nix | 1 + 5 files changed, 34 insertions(+) create mode 100644 common/cpu/intel/meteor-lake/default.nix create mode 100644 common/gpu/intel/meteor-lake/default.nix create mode 100644 dell/precision/3490/default.nix diff --git a/README.md b/README.md index 098b39cb..2d46d425 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,7 @@ See code for all available configurations. | [Dell Latitude E7240](dell/latitude/e7240) | `` | | [Dell Optiplex 3050](dell/optiplex/3050) | `` | | [Dell Poweredge R7515](dell/poweredge/r7515) | `` | +| [Dell Precision 3490](dell/precision/3490) | `` | | [Dell Precision 3541](dell/precision/3541) | `` | | [Dell Precision 5490](dell/precision/5490) | `` | | [Dell Precision 5530](dell/precision/5530) | `` | diff --git a/common/cpu/intel/meteor-lake/default.nix b/common/cpu/intel/meteor-lake/default.nix new file mode 100644 index 00000000..1330e1c5 --- /dev/null +++ b/common/cpu/intel/meteor-lake/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ../cpu-only.nix + ../../../gpu/intel/meteor-lake + ]; +} diff --git a/common/gpu/intel/meteor-lake/default.nix b/common/gpu/intel/meteor-lake/default.nix new file mode 100644 index 00000000..eb5abe99 --- /dev/null +++ b/common/gpu/intel/meteor-lake/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ ../. ]; + + hardware.intelgpu.vaapiDriver = "intel-media-driver"; +} diff --git a/dell/precision/3490/default.nix b/dell/precision/3490/default.nix new file mode 100644 index 00000000..c579f880 --- /dev/null +++ b/dell/precision/3490/default.nix @@ -0,0 +1,21 @@ +{ + imports = [ + ../../../common/cpu/intel/meteor-lake + ../../../common/gpu/nvidia/ada-lovelace + ../../../common/pc/laptop + ]; + + boot.initrd.availableKernelModules = [ + "nvme" + "sd_mod" + "thunderbolt" + "usb_storage" + "vmd" + "xhci_pci" + ]; + + hardware.nvidia.prime = { + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:1:0:0"; + }; +} diff --git a/flake.nix b/flake.nix index 2af97858..d52a37d4 100644 --- a/flake.nix +++ b/flake.nix @@ -80,6 +80,7 @@ dell-latitude-e7240 = import ./dell/latitude/e7240; dell-optiplex-3050 = import ./dell/optiplex/3050; dell-poweredge-r7515 = import ./dell/poweredge/r7515; + dell-precision-3490 = import ./dell/precision/3490; dell-precision-3541 = import ./dell/precision/3541; dell-precision-5490 = import ./dell/precision/5490; dell-precision-5530 = import ./dell/precision/5530; From 84eb0330aed636ed56ce3f3495cc4a329db45278 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 13 Mar 2025 11:15:20 +0000 Subject: [PATCH 077/134] feat: add Lenovo ThinkPad P16s Intel Gen 2 @moduon MT-9339 --- README.md | 1 + common/cpu/intel/raptor-lake/default.nix | 5 +++ common/gpu/intel/raptor-lake/default.nix | 5 +++ flake.nix | 1 + lenovo/thinkpad/p16s/intel/default.nix | 5 +++ lenovo/thinkpad/p16s/intel/gen2/README.md | 40 +++++++++++++++++++++ lenovo/thinkpad/p16s/intel/gen2/default.nix | 18 ++++++++++ 7 files changed, 75 insertions(+) create mode 100644 common/cpu/intel/raptor-lake/default.nix create mode 100644 common/gpu/intel/raptor-lake/default.nix create mode 100644 lenovo/thinkpad/p16s/intel/default.nix create mode 100644 lenovo/thinkpad/p16s/intel/gen2/README.md create mode 100644 lenovo/thinkpad/p16s/intel/gen2/default.nix diff --git a/README.md b/README.md index 2d46d425..4ec3ca8a 100644 --- a/README.md +++ b/README.md @@ -252,6 +252,7 @@ See code for all available configurations. | [Lenovo ThinkPad P14s Intel Gen 5](lenovo/thinkpad/p14s/intel/gen5) | `` | | [Lenovo ThinkPad P16s AMD Gen 1](lenovo/thinkpad/p16s/amd/gen1) | `` | | [Lenovo ThinkPad P16s AMD Gen 2](lenovo/thinkpad/p16s/amd/gen2) | `` | +| [Lenovo ThinkPad P16s Intel Gen 2](lenovo/thinkpad/p16s/intel/gen2) | `` | | [Lenovo ThinkPad P1](lenovo/thinkpad/p1) | `` | | [Lenovo ThinkPad P43s](lenovo/thinkpad/p43s) | `` | | [Lenovo ThinkPad P50](lenovo/thinkpad/p50) | `` | diff --git a/common/cpu/intel/raptor-lake/default.nix b/common/cpu/intel/raptor-lake/default.nix new file mode 100644 index 00000000..665d3d41 --- /dev/null +++ b/common/cpu/intel/raptor-lake/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ../. + ]; +} diff --git a/common/gpu/intel/raptor-lake/default.nix b/common/gpu/intel/raptor-lake/default.nix new file mode 100644 index 00000000..665d3d41 --- /dev/null +++ b/common/gpu/intel/raptor-lake/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ../. + ]; +} diff --git a/flake.nix b/flake.nix index d52a37d4..254f9453 100644 --- a/flake.nix +++ b/flake.nix @@ -196,6 +196,7 @@ lenovo-thinkpad-p14s-intel-gen5 = import ./lenovo/thinkpad/p14s/intel/gen5; lenovo-thinkpad-p16s-amd-gen1 = import ./lenovo/thinkpad/p16s/amd/gen1; lenovo-thinkpad-p16s-amd-gen2 = import ./lenovo/thinkpad/p16s/amd/gen2; + lenovo-thinkpad-p16s-intel-gen2 = import ./lenovo/thinkpad/p16s/intel/gen2; lenovo-thinkpad-p43s = import ./lenovo/thinkpad/p43s; lenovo-thinkpad-p50 = import ./lenovo/thinkpad/p50; lenovo-thinkpad-p51 = import ./lenovo/thinkpad/p51; diff --git a/lenovo/thinkpad/p16s/intel/default.nix b/lenovo/thinkpad/p16s/intel/default.nix new file mode 100644 index 00000000..665d3d41 --- /dev/null +++ b/lenovo/thinkpad/p16s/intel/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ../. + ]; +} diff --git a/lenovo/thinkpad/p16s/intel/gen2/README.md b/lenovo/thinkpad/p16s/intel/gen2/README.md new file mode 100644 index 00000000..43ab342d --- /dev/null +++ b/lenovo/thinkpad/p16s/intel/gen2/README.md @@ -0,0 +1,40 @@ +# Lenovo Thinkpad P16s Gen 2 + +https://www.lenovo.com/us/en/p/laptops/thinkpad/thinkpadp/thinkpad-p16s-gen-2-16-inch-intel/len101t0065 + + +## Tested Hardware + +```shell +lspci -nn +00:00.0 Host bridge [0600]: Intel Corporation Raptor Lake-P/U 4p+8e cores Host Bridge/DRAM Controller [8086:a707] +00:02.0 VGA compatible controller [0300]: Intel Corporation Raptor Lake-P [Iris Xe Graphics] [8086:a7a0] (rev 04) +00:04.0 Signal processing controller [1180]: Intel Corporation Raptor Lake Dynamic Platform and Thermal Framework Processor Participant [8086:a71d] +00:06.0 PCI bridge [0604]: Intel Corporation Raptor Lake PCIe 4.0 Graphics Port [8086:a74d] +00:06.2 PCI bridge [0604]: Intel Corporation Device [8086:a73d] +00:07.0 PCI bridge [0604]: Intel Corporation Raptor Lake-P Thunderbolt 4 PCI Express Root Port #0 [8086:a76e] +00:07.2 PCI bridge [0604]: Intel Corporation Raptor Lake-P Thunderbolt 4 PCI Express Root Port #2 [8086:a72f] +00:0d.0 USB controller [0c03]: Intel Corporation Raptor Lake-P Thunderbolt 4 USB Controller [8086:a71e] +00:0d.2 USB controller [0c03]: Intel Corporation Raptor Lake-P Thunderbolt 4 NHI #0 [8086:a73e] +00:0d.3 USB controller [0c03]: Intel Corporation Raptor Lake-P Thunderbolt 4 NHI #1 [8086:a76d] +00:14.0 USB controller [0c03]: Intel Corporation Alder Lake PCH USB 3.2 xHCI Host Controller [8086:51ed] (rev 01) +00:14.2 RAM memory [0500]: Intel Corporation Alder Lake PCH Shared SRAM [8086:51ef] (rev 01) +00:14.3 Network controller [0280]: Intel Corporation Raptor Lake PCH CNVi WiFi [8086:51f1] (rev 01) +00:15.0 Serial bus controller [0c80]: Intel Corporation Alder Lake PCH Serial IO I2C Controller #0 [8086:51e8] (rev 01) +00:16.0 Communication controller [0780]: Intel Corporation Alder Lake PCH HECI Controller [8086:51e0] (rev 01) +00:1f.0 ISA bridge [0601]: Intel Corporation Raptor Lake LPC/eSPI Controller [8086:519d] (rev 01) +00:1f.3 Audio device [0403]: Intel Corporation Raptor Lake-P/U/H cAVS [8086:51ca] (rev 01) +00:1f.4 SMBus [0c05]: Intel Corporation Alder Lake PCH-P SMBus Host Controller [8086:51a3] (rev 01) +00:1f.5 Serial bus controller [0c80]: Intel Corporation Alder Lake-P PCH SPI Controller [8086:51a4] (rev 01) +00:1f.6 Ethernet controller [0200]: Intel Corporation Ethernet Connection (23) I219-V [8086:0dc6] (rev 01) +02:00.0 Non-Volatile memory controller [0108]: SK hynix Platinum P41/PC801 NVMe Solid State Drive [1c5c:1959] +03:00.0 3D controller [0302]: NVIDIA Corporation GA107GLM [RTX A500 Laptop GPU] [10de:25bb] (rev a1) + +nix-info -m + - system: `"x86_64-linux"` + - host os: `Linux 6.12.10-zen1, NixOS, 24.11 (Vicuna), 24.11.20250304.6af28b8` + - multi-user?: `yes` + - sandbox: `yes` + - version: `nix-env (Nix) 2.24.12` + - nixpkgs: `/nix/store/cdjqlnn7kx4hfmxkry9yjfdvqp2pradh-source` +``` diff --git a/lenovo/thinkpad/p16s/intel/gen2/default.nix b/lenovo/thinkpad/p16s/intel/gen2/default.nix new file mode 100644 index 00000000..39940255 --- /dev/null +++ b/lenovo/thinkpad/p16s/intel/gen2/default.nix @@ -0,0 +1,18 @@ +{lib, ...}: { + imports = [ + ../. + ../../../../../common/cpu/intel/raptor-lake + ../../../../../common/gpu/intel/raptor-lake + ../../../../../common/gpu/nvidia/ampere + ../../../../../common/gpu/nvidia/prime.nix + ]; + + # DOCS https://wiki.nixos.org/wiki/NVIDIA#Offload_mode + hardware.nvidia.prime = { + intelBusId = lib.mkDefault "PCI:0:2:0"; + nvidiaBusId = lib.mkDefault "PCI:3:0:0"; + }; + + # HACK https://github.com/NVIDIA/open-gpu-kernel-modules/issues/472 + hardware.nvidia.open = lib.mkOverride 993 false; +} From 0833dc8bbc4ffa9cf9b0cbfccf1c5ec8632fc66e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Zavala=20Villag=C3=B3mez?= Date: Tue, 29 Apr 2025 07:38:09 -0400 Subject: [PATCH 078/134] gmktec/nucbox/g3-plus: init Product page: This profile just configures the Intel Twin Lake N150 CPU and integrated graphics for this mini-PC. fstrim is also enabled for the SSD. That's all this seemed to need to function properly. As is now expected from Intel NUC systems, it provides a solid "out-of-the-box" experience. No special quirks are apparent. We import the Alder Lake modules since Twin Lake is just a refreshed version of the Alder Lake-N series. Re-using those seems to be fine for this purpose. --- README.md | 1 + flake.nix | 1 + gmktec/nucbox/g3-plus/default.nix | 27 +++++++++++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 gmktec/nucbox/g3-plus/default.nix diff --git a/README.md b/README.md index 4ec3ca8a..3c5fd9ad 100644 --- a/README.md +++ b/README.md @@ -188,6 +188,7 @@ See code for all available configurations. | [Focus M2 Gen 1](focus/m2/gen1) | `` | | [Gigabyte B550](gigabyte/b550) | `` | | [Gigabyte B650](gigabyte/b650) | `` | +| [GMKtec NucBox G3 Plus](gmktec/nucbox/g3-plus) | `` | | [GPD MicroPC](gpd/micropc) | `` | | [GPD P2 Max](gpd/p2-max) | `` | | [GPD Pocket 3](gpd/pocket-3) | `` | diff --git a/flake.nix b/flake.nix index 254f9453..aa2e9564 100644 --- a/flake.nix +++ b/flake.nix @@ -130,6 +130,7 @@ focus-m2-gen1 = import ./focus/m2/gen1; gigabyte-b550 = import ./gigabyte/b550; gigabyte-b650 = import ./gigabyte/b650; + gmktec-nucbox-g3-plus = import ./gmktec/nucbox/g3-plus; google-pixelbook = import ./google/pixelbook; gpd-micropc = import ./gpd/micropc; gpd-p2-max = import ./gpd/p2-max; diff --git a/gmktec/nucbox/g3-plus/default.nix b/gmktec/nucbox/g3-plus/default.nix new file mode 100644 index 00000000..7cd7d6f3 --- /dev/null +++ b/gmktec/nucbox/g3-plus/default.nix @@ -0,0 +1,27 @@ +/* + * `gmktec-nucbox-g3-plus`: + * + * Product page: + * + * + * This profile just configures the Intel + * Twin Lake N150 CPU and integrated + * graphics for this mini-PC. fstrim is also + * enabled for the SSD. That's all this seemed + * to need to function properly. As is now + * expected from Intel NUC systems, it provides + * a solid "out-of-the-box" experience. No + * special quirks are apparent. + * + * We import the Alder Lake modules since Twin + * Lake is just a refreshed version of the + * Alder Lake-N series. Re-using those seems + * to be fine for this purpose. + */ +{ + imports = [ + ../../../common/cpu/intel/alder-lake + ../../../common/gpu/intel/alder-lake + ../../../common/pc/ssd + ]; +} From f5eedd65a342e155585e6d7a4ca7a4bbefecceee Mon Sep 17 00:00:00 2001 From: Peter Bittner Date: Wed, 16 Apr 2025 11:29:41 +0200 Subject: [PATCH 079/134] Lenovo ThinkPad X1 Yoga Gen 8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Convertible laptop equipped with e.g. 13th Gen Intel Core i7-1365U × 12, 32 GiB RAM, and 512 MiB or 1 TiB SSD HDD --- README.md | 1 + flake.nix | 1 + lenovo/thinkpad/x1/yoga/8th-gen/default.nix | 6 ++++++ 3 files changed, 8 insertions(+) create mode 100644 lenovo/thinkpad/x1/yoga/8th-gen/default.nix diff --git a/README.md b/README.md index 3c5fd9ad..82994ba2 100644 --- a/README.md +++ b/README.md @@ -290,6 +290,7 @@ See code for all available configurations. | [Lenovo ThinkPad W520](lenovo/thinkpad/w520) | `` | | [Lenovo ThinkPad X1 Yoga](lenovo/thinkpad/x1/yoga) | `` | | [Lenovo ThinkPad X1 Yoga Gen 7](lenovo/thinkpad/x1/yoga/7th-gen/) | `` | +| [Lenovo ThinkPad X1 Yoga Gen 8](lenovo/thinkpad/x1/yoga/8th-gen/) | `` | | [Lenovo ThinkPad X1 (2nd Gen)](lenovo/thinkpad/x1/2nd-gen) | `` | | [Lenovo ThinkPad X1 (6th Gen)](lenovo/thinkpad/x1/6th-gen) | `` | | [Lenovo ThinkPad X1 (7th Gen)](lenovo/thinkpad/x1/7th-gen) | `` | diff --git a/flake.nix b/flake.nix index aa2e9564..e79c0068 100644 --- a/flake.nix +++ b/flake.nix @@ -234,6 +234,7 @@ lenovo-thinkpad-x1 = import ./lenovo/thinkpad/x1; lenovo-thinkpad-x1-yoga = import ./lenovo/thinkpad/x1/yoga; lenovo-thinkpad-x1-yoga-7th-gen = import ./lenovo/thinkpad/x1/yoga/7th-gen; + lenovo-thinkpad-x1-yoga-8th-gen = import ./lenovo/thinkpad/x1/yoga/8th-gen; lenovo-thinkpad-x1-2nd-gen = import ./lenovo/thinkpad/x1/2nd-gen; lenovo-thinkpad-x1-6th-gen = import ./lenovo/thinkpad/x1/6th-gen; lenovo-thinkpad-x1-7th-gen = import ./lenovo/thinkpad/x1/7th-gen; diff --git a/lenovo/thinkpad/x1/yoga/8th-gen/default.nix b/lenovo/thinkpad/x1/yoga/8th-gen/default.nix new file mode 100644 index 00000000..cc1676cc --- /dev/null +++ b/lenovo/thinkpad/x1/yoga/8th-gen/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ../. + ../../../../../common/pc/laptop/ssd + ]; +} From a4bb30a9000cf0444ecc8fdca8096d072f77f9e8 Mon Sep 17 00:00:00 2001 From: "Andreas V. W. Zacchi" Date: Thu, 20 Mar 2025 14:30:24 +0100 Subject: [PATCH 080/134] add asus-zenbook-ux481 --- README.md | 2 + asus/zenbook/ux481/README.md | 53 +++++++++++++++++++++++++ asus/zenbook/ux481/intelgpu/default.nix | 8 ++++ asus/zenbook/ux481/nvidia/default.nix | 17 ++++++++ asus/zenbook/ux481/shared.nix | 25 ++++++++++++ flake.nix | 2 + 6 files changed, 107 insertions(+) create mode 100644 asus/zenbook/ux481/README.md create mode 100644 asus/zenbook/ux481/intelgpu/default.nix create mode 100644 asus/zenbook/ux481/nvidia/default.nix create mode 100644 asus/zenbook/ux481/shared.nix diff --git a/README.md b/README.md index 82994ba2..6245e507 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,8 @@ See code for all available configurations. | [Asus TUF FA506IC](asus/fa506ic) | `` | | [Asus TUF FA507RM](asus/fa507rm) | `` | | [Asus TUF FA507NV](asus/fa507nv) | `` | +| [Asus Zenbook Duo 14 UX481](asus/zenbook/ux481/intelgpu/) | `` | +| [Asus Zenbook Duo 14 UX481](asus/zenbook/ux481/nvidia/) | `` | | [Asus Zenbook Flip S13 UX371](asus/zenbook/ux371/) | `` | | [Asus Zenbook Pro 15 UX535](asus/zenbook/ux535/) | `` | | [BeagleBoard PocketBeagle](beagleboard/pocketbeagle) | `` | diff --git a/asus/zenbook/ux481/README.md b/asus/zenbook/ux481/README.md new file mode 100644 index 00000000..9c03bcf2 --- /dev/null +++ b/asus/zenbook/ux481/README.md @@ -0,0 +1,53 @@ +# Asus Zenbook Duo 14 UX481 + +These profiles has been tested on a slightly modified device as I have swapped the Intel Optane NVME for a Kingston NVME with a higher capacity. + +# GPU + +You need to pick between running only Intel iGPU or running both Intel iGPU and NVIDIA dGPU. By only running iGPU the battery life is a bit better as the dGPU is turned off. You can offload applications if running on NVIDIA dGPU using + +```bash +nvidia-offload +``` + +## Battery charging limit: + +Using the ASUS module you can limit the charging percentage. This can be done as follows: + +```nix +hardware.asus.battery = +{ + chargeUpto = 90; # Maximum level of charge for your battery, as a percentage. + enableChargeUptoScript = true; # Whether to add charge-upto to environment.systemPackages. `charge-upto 100` temporarily sets the charge limit to 100%, useful if you're going to need the extra battery on a longer journey. +}; +``` + +## Hardware: + +```bash +$ lspci -nn +00:00.0 Host bridge [0600]: Intel Corporation Comet Lake-U v1 4c Host Bridge/DRAM Controller [8086:9b61] (rev 0c) +00:02.0 VGA compatible controller [0300]: Intel Corporation CometLake-U GT2 [UHD Graphics] [8086:9b41] (rev 02) +00:04.0 Signal processing controller [1180]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem [8086:1903] (rev 0c) +00:08.0 System peripheral [0880]: Intel Corporation Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th/8th Gen Core Processor Gaussian Mixture Model [8086:1911] +00:12.0 Signal processing controller [1180]: Intel Corporation Comet Lake Thermal Subsytem [8086:02f9] +00:14.0 USB controller [0c03]: Intel Corporation Comet Lake PCH-LP USB 3.1 xHCI Host Controller [8086:02ed] +00:14.2 RAM memory [0500]: Intel Corporation Comet Lake PCH-LP Shared SRAM [8086:02ef] +00:14.3 Network controller [0280]: Intel Corporation Comet Lake PCH-LP CNVi WiFi [8086:02f0] +00:15.0 Serial bus controller [0c80]: Intel Corporation Serial IO I2C Host Controller [8086:02e8] +00:15.1 Serial bus controller [0c80]: Intel Corporation Comet Lake Serial IO I2C Host Controller [8086:02e9] +00:15.2 Serial bus controller [0c80]: Intel Corporation Comet Lake PCH-LP LPSS: I2C Controller #2 [8086:02ea] +00:15.3 Serial bus controller [0c80]: Intel Corporation Device [8086:02eb] +00:16.0 Communication controller [0780]: Intel Corporation Comet Lake Management Engine Interface [8086:02e0] +00:1c.0 PCI bridge [0604]: Intel Corporation Comet Lake PCI Express Root Port #1 [8086:02b8] (rev f0) +00:1c.4 PCI bridge [0604]: Intel Corporation Comet Lake PCI Express Root Port #5 [8086:02bc] (rev f0) +00:1d.0 PCI bridge [0604]: Intel Corporation Comet Lake PCI Express Root Port #9 [8086:02b0] (rev f0) +00:1d.4 PCI bridge [0604]: Intel Corporation Comet Lake PCI Express Root Port #13 [8086:02b4] (rev f0) +00:1f.0 ISA bridge [0601]: Intel Corporation Comet Lake PCH-LP LPC Premium Controller/eSPI Controller [8086:0284] +00:1f.3 Audio device [0403]: Intel Corporation Comet Lake PCH-LP cAVS [8086:02c8] +00:1f.4 SMBus [0c05]: Intel Corporation Comet Lake PCH-LP SMBus Host Controller [8086:02a3] +00:1f.5 Serial bus controller [0c80]: Intel Corporation Comet Lake SPI (flash) Controller [8086:02a4] +02:00.0 3D controller [0302]: NVIDIA Corporation GP108BM [GeForce MX250] [10de:1d52] (rev a1) +03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS522A PCI Express Card Reader [10ec:522a] (rev 01) +04:00.0 Non-Volatile memory controller [0108]: Kingston Technology Company, Inc. NV2 NVMe SSD [TC2200] (DRAM-less) [2646:501d] +``` diff --git a/asus/zenbook/ux481/intelgpu/default.nix b/asus/zenbook/ux481/intelgpu/default.nix new file mode 100644 index 00000000..b69d9097 --- /dev/null +++ b/asus/zenbook/ux481/intelgpu/default.nix @@ -0,0 +1,8 @@ +{ lib, ... }: +{ + imports = [ + ../shared.nix + ../../../../common/gpu/intel/comet-lake + ../../../../common/gpu/nvidia/disable.nix # Disabling nvidia + ]; +} diff --git a/asus/zenbook/ux481/nvidia/default.nix b/asus/zenbook/ux481/nvidia/default.nix new file mode 100644 index 00000000..359a97d6 --- /dev/null +++ b/asus/zenbook/ux481/nvidia/default.nix @@ -0,0 +1,17 @@ +{lib, ...}: +{ + imports = [ + ../shared.nix + ../../../../common/gpu/nvidia/pascal + ../../../../common/gpu/nvidia/prime.nix + ]; + + hardware.nvidia = { + prime = { + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:2:0:0"; + }; + + dynamicBoost.enable = lib.mkForce false; # Dynamic boost is not supported on Pascal architeture + }; +} diff --git a/asus/zenbook/ux481/shared.nix b/asus/zenbook/ux481/shared.nix new file mode 100644 index 00000000..f23d5e17 --- /dev/null +++ b/asus/zenbook/ux481/shared.nix @@ -0,0 +1,25 @@ +{ + config, + lib, + ... +}: +{ + imports = [ + ../../../common/cpu/intel/comet-lake/cpu-only.nix + ../../../common/pc/laptop + ../../../common/pc/laptop/ssd + ../../battery.nix + ]; + + boot.kernelParams = [ + # These options are needed for suspend to work, + # otherwise the nvme will be mounted read-only on resume + "pcie_aspm=off" + "pcie_port_pm=off" + "nvme_core.default_ps_max_latency_us=0" + "mem_sleep_default=deep" + ]; + + services.thermald.enable = lib.mkDefault true; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; +} diff --git a/flake.nix b/flake.nix index e79c0068..e48d1bd9 100644 --- a/flake.nix +++ b/flake.nix @@ -44,6 +44,8 @@ asus-rog-strix-x570e = import ./asus/rog-strix/x570e; asus-zenbook-ux371 = import ./asus/zenbook/ux371; asus-zenbook-ux535 = import ./asus/zenbook/ux535; + asus-zenbook-ux481-intelgpu = import ./asus/zenbook/ux481/intelgpu; + asus-zenbook-ux481-nvidia = import ./asus/zenbook/ux481/nvidia; asus-zephyrus-ga401 = import ./asus/zephyrus/ga401; asus-zephyrus-ga402 = import ./asus/zephyrus/ga402; asus-zephyrus-ga402x = import ./asus/zephyrus/ga402x; From 7d9552ef6b02da7b8fafe426c0db5358ab8c4009 Mon Sep 17 00:00:00 2001 From: Peter Bittner Date: Mon, 5 May 2025 11:15:11 +0200 Subject: [PATCH 081/134] Replace symlink references by real path and delete symlink The common/pc/laptop/ssd folder was apparently moved a level up and was replaced by a symlink to keep things working. We can consolidate this now. --- apple/imac/18-2/default.nix | 2 +- apple/imac/default.nix | 2 +- apple/macbook-air/default.nix | 2 +- apple/macbook-pro/10-1/default.nix | 2 +- apple/macbook-pro/11-1/default.nix | 2 +- apple/macbook-pro/11-5/default.nix | 2 +- apple/macbook-pro/12-1/default.nix | 2 +- apple/macbook-pro/14-1/default.nix | 2 +- apple/macbook-pro/8-1/default.nix | 2 +- asus/ally/rc71l/default.nix | 2 +- asus/fa506ic/default.nix | 2 +- asus/zenbook/ux371/default.nix | 2 +- asus/zenbook/ux481/shared.nix | 6 +++--- asus/zenbook/ux535/default.nix | 2 +- asus/zephyrus/ga401/default.nix | 2 +- asus/zephyrus/ga402/default.nix | 2 +- asus/zephyrus/gu605my/default.nix | 2 +- chuwi/minibook-x/default.nix | 2 +- common/pc/laptop/ssd | 1 - dell/g3/3579/default.nix | 2 +- dell/g3/3779/default.nix | 2 +- dell/inspiron/7405/default.nix | 2 +- dell/inspiron/7460/default.nix | 2 +- dell/inspiron/7559/README.md | 2 +- dell/latitude/3340/default.nix | 2 +- dell/latitude/3480/default.nix | 2 +- dell/latitude/5490/default.nix | 4 ++-- dell/latitude/5520/default.nix | 2 +- dell/latitude/7280/default.nix | 2 +- dell/latitude/7420/default.nix | 2 +- dell/latitude/7430/default.nix | 8 ++++---- dell/latitude/9430/default.nix | 2 +- dell/precision/5530/default.nix | 2 +- dell/precision/5560/default.nix | 2 +- dell/precision/7520/default.nix | 2 +- dell/xps/13-7390/default.nix | 2 +- dell/xps/13-9343/default.nix | 2 +- dell/xps/13-9350/default.nix | 2 +- dell/xps/15-9500/default.nix | 4 ++-- dell/xps/15-9510/default.nix | 2 +- dell/xps/15-9520/default.nix | 2 +- dell/xps/15-9530/default.nix | 2 +- focus/m2/gen1/default.nix | 2 +- framework/13-inch/common/default.nix | 2 +- framework/16-inch/common/default.nix | 2 +- google/pixelbook/default.nix | 2 +- gpd/micropc/default.nix | 2 +- gpd/p2-max/default.nix | 2 +- gpd/pocket-3/default.nix | 2 +- gpd/pocket-4/default.nix | 2 +- hp/elitebook/830/g6/default.nix | 2 +- hp/elitebook/845/g7/default.nix | 2 +- hp/elitebook/845/g8/default.nix | 2 +- hp/elitebook/845/g9/default.nix | 2 +- hp/laptop/14s-dq2024nf/default.nix | 2 +- hp/probook/440G5/default.nix | 2 +- lenovo/ideapad/15ach6/default.nix | 2 +- lenovo/ideapad/15alc6/default.nix | 2 +- lenovo/ideapad/15arh05/default.nix | 2 +- lenovo/ideapad/16ach6/default.nix | 2 +- lenovo/ideapad/16ahp9/default.nix | 2 +- lenovo/ideapad/16iah8/default.nix | 2 +- lenovo/ideapad/slim-5/default.nix | 2 +- lenovo/legion/15ach6/default.nix | 2 +- lenovo/legion/15ach6h/hybrid/default.nix | 2 +- lenovo/legion/15arh05h/default.nix | 2 +- lenovo/legion/15ich/default.nix | 2 +- lenovo/legion/16ach6h/hybrid/default.nix | 2 +- lenovo/legion/16achg6/hybrid/default.nix | 4 ++-- lenovo/legion/16aph8/default.nix | 2 +- lenovo/legion/16arh7h/hybrid/default.nix | 2 +- lenovo/legion/16arh7h/igpu-only/default.nix | 2 +- lenovo/legion/16arha7/default.nix | 4 ++-- lenovo/legion/16irx8h/default.nix | 2 +- lenovo/legion/16irx9h/default.nix | 2 +- lenovo/legion/16ithg6/default.nix | 2 +- lenovo/thinkpad/e14/default.nix | 2 +- lenovo/thinkpad/e15/default.nix | 2 +- lenovo/thinkpad/l13/default.nix | 2 +- lenovo/thinkpad/l14/default.nix | 2 +- lenovo/thinkpad/l480/default.nix | 2 +- lenovo/thinkpad/p1/default.nix | 2 +- lenovo/thinkpad/p14s/default.nix | 2 +- lenovo/thinkpad/p16s/default.nix | 2 +- lenovo/thinkpad/p43s/default.nix | 2 +- lenovo/thinkpad/t14/default.nix | 2 +- lenovo/thinkpad/x1-extreme/default.nix | 2 +- lenovo/thinkpad/x1-nano/default.nix | 2 +- lenovo/thinkpad/x1/10th-gen/default.nix | 2 +- lenovo/thinkpad/x1/11th-gen/default.nix | 2 +- lenovo/thinkpad/x1/12th-gen/default.nix | 2 +- lenovo/thinkpad/x1/2nd-gen/default.nix | 2 +- lenovo/thinkpad/x1/6th-gen/default.nix | 2 +- lenovo/thinkpad/x1/7th-gen/default.nix | 2 +- lenovo/thinkpad/x1/9th-gen/default.nix | 2 +- lenovo/thinkpad/x1/yoga/7th-gen/default.nix | 2 +- lenovo/thinkpad/x1/yoga/8th-gen/default.nix | 2 +- lenovo/thinkpad/x13/common.nix | 2 +- lenovo/thinkpad/x270/default.nix | 2 +- lenovo/thinkpad/x280/default.nix | 2 +- lenovo/thinkpad/x390/default.nix | 2 +- lenovo/thinkpad/z/default.nix | 2 +- malibal/aon/s1/default.nix | 2 +- msi/gl62/default.nix | 2 +- msi/gl65/10SDR-492/default.nix | 2 +- omen/15-ce002ns/default.nix | 2 +- onenetbook/4/default.nix | 2 +- slimbook/hero/rpl-rtx/default.nix | 2 +- starlabs/starlite/i5/default.nix | 2 +- system76/darp6/default.nix | 2 +- tuxedo/pulse/14/gen3/default.nix | 2 +- tuxedo/pulse/15/gen2/default.nix | 2 +- xiaomi/redmibook/16-pro-2024/default.nix | 2 +- 113 files changed, 121 insertions(+), 122 deletions(-) delete mode 120000 common/pc/laptop/ssd diff --git a/apple/imac/18-2/default.nix b/apple/imac/18-2/default.nix index 4770e10b..9d71ba32 100644 --- a/apple/imac/18-2/default.nix +++ b/apple/imac/18-2/default.nix @@ -9,7 +9,7 @@ ../../../common/cpu/intel/kaby-lake ../../../common/gpu/amd ../../../common/hidpi.nix - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; # apple smc (TODO: check spi) diff --git a/apple/imac/default.nix b/apple/imac/default.nix index ea15175d..86d48299 100644 --- a/apple/imac/default.nix +++ b/apple/imac/default.nix @@ -3,6 +3,6 @@ ../. ../../common/cpu/intel ../../common/pc/laptop - ../../common/pc/laptop/ssd + ../../common/pc/ssd ]; } diff --git a/apple/macbook-air/default.nix b/apple/macbook-air/default.nix index ea15175d..86d48299 100644 --- a/apple/macbook-air/default.nix +++ b/apple/macbook-air/default.nix @@ -3,6 +3,6 @@ ../. ../../common/cpu/intel ../../common/pc/laptop - ../../common/pc/laptop/ssd + ../../common/pc/ssd ]; } diff --git a/apple/macbook-pro/10-1/default.nix b/apple/macbook-pro/10-1/default.nix index 08302289..8967b1cb 100644 --- a/apple/macbook-pro/10-1/default.nix +++ b/apple/macbook-pro/10-1/default.nix @@ -3,7 +3,7 @@ { imports = [ ../. - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ../../../common/gpu/24.05-compat.nix ../../../common/gpu/nvidia/kepler ]; diff --git a/apple/macbook-pro/11-1/default.nix b/apple/macbook-pro/11-1/default.nix index 17525084..6c9509b2 100644 --- a/apple/macbook-pro/11-1/default.nix +++ b/apple/macbook-pro/11-1/default.nix @@ -2,7 +2,7 @@ { imports = [ ../. - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ../../../common/cpu/intel/haswell ]; diff --git a/apple/macbook-pro/11-5/default.nix b/apple/macbook-pro/11-5/default.nix index 81eda9b2..1db2878f 100644 --- a/apple/macbook-pro/11-5/default.nix +++ b/apple/macbook-pro/11-5/default.nix @@ -9,7 +9,7 @@ in { imports = [ ../. - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; # Enable broadcom-43xx firmware diff --git a/apple/macbook-pro/12-1/default.nix b/apple/macbook-pro/12-1/default.nix index 7497b2ff..6f1bc995 100644 --- a/apple/macbook-pro/12-1/default.nix +++ b/apple/macbook-pro/12-1/default.nix @@ -3,7 +3,7 @@ { imports = [ ../. - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd "${modulesPath}/hardware/network/broadcom-43xx.nix" ]; diff --git a/apple/macbook-pro/14-1/default.nix b/apple/macbook-pro/14-1/default.nix index cec9e262..e7897708 100644 --- a/apple/macbook-pro/14-1/default.nix +++ b/apple/macbook-pro/14-1/default.nix @@ -8,7 +8,7 @@ ../. ../../../common/cpu/intel/kaby-lake ../../../common/hidpi.nix - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; # Make the keyboard work in stage1, enable iommu diff --git a/apple/macbook-pro/8-1/default.nix b/apple/macbook-pro/8-1/default.nix index bc77ea6a..a807da27 100644 --- a/apple/macbook-pro/8-1/default.nix +++ b/apple/macbook-pro/8-1/default.nix @@ -4,7 +4,7 @@ imports = [ ../. ../../../common/cpu/intel/sandy-bridge - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; networking.enableB43Firmware = lib.mkDefault true; diff --git a/asus/ally/rc71l/default.nix b/asus/ally/rc71l/default.nix index 9cc83fed..7f2552ec 100644 --- a/asus/ally/rc71l/default.nix +++ b/asus/ally/rc71l/default.nix @@ -5,7 +5,7 @@ ../../../common/cpu/amd/pstate.nix ../../../common/gpu/amd ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ../../battery.nix ]; diff --git a/asus/fa506ic/default.nix b/asus/fa506ic/default.nix index 10d08fbc..c9591fd7 100644 --- a/asus/fa506ic/default.nix +++ b/asus/fa506ic/default.nix @@ -8,7 +8,7 @@ ../../common/gpu/nvidia/prime.nix ../../common/gpu/nvidia/ampere ../../common/pc/laptop - ../../common/pc/laptop/ssd + ../../common/pc/ssd ]; hardware.nvidia = { diff --git a/asus/zenbook/ux371/default.nix b/asus/zenbook/ux371/default.nix index 8e387c0c..1b4b7f26 100644 --- a/asus/zenbook/ux371/default.nix +++ b/asus/zenbook/ux371/default.nix @@ -7,7 +7,7 @@ imports = [ ../../../common/cpu/intel/tiger-lake ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ../../battery.nix ]; diff --git a/asus/zenbook/ux481/shared.nix b/asus/zenbook/ux481/shared.nix index f23d5e17..a9842c7d 100644 --- a/asus/zenbook/ux481/shared.nix +++ b/asus/zenbook/ux481/shared.nix @@ -7,12 +7,12 @@ imports = [ ../../../common/cpu/intel/comet-lake/cpu-only.nix ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ../../battery.nix ]; - boot.kernelParams = [ - # These options are needed for suspend to work, + boot.kernelParams = [ + # These options are needed for suspend to work, # otherwise the nvme will be mounted read-only on resume "pcie_aspm=off" "pcie_port_pm=off" diff --git a/asus/zenbook/ux535/default.nix b/asus/zenbook/ux535/default.nix index a6df788d..f2b3da6e 100644 --- a/asus/zenbook/ux535/default.nix +++ b/asus/zenbook/ux535/default.nix @@ -8,7 +8,7 @@ ../../../common/gpu/nvidia/prime.nix ../../../common/cpu/intel ../../../common/gpu/intel/comet-lake - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ../../../common/hidpi.nix # 4K screen is HiDPI ../../battery.nix ]; diff --git a/asus/zephyrus/ga401/default.nix b/asus/zephyrus/ga401/default.nix index 9dad2c17..f7469f1c 100644 --- a/asus/zephyrus/ga401/default.nix +++ b/asus/zephyrus/ga401/default.nix @@ -8,7 +8,7 @@ ../../../common/gpu/nvidia/prime.nix ../../../common/gpu/nvidia/ampere ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; hardware.nvidia = { diff --git a/asus/zephyrus/ga402/default.nix b/asus/zephyrus/ga402/default.nix index 2002fd09..e38e52e5 100644 --- a/asus/zephyrus/ga402/default.nix +++ b/asus/zephyrus/ga402/default.nix @@ -6,7 +6,7 @@ ../../../common/cpu/amd/pstate.nix ../../../common/gpu/amd ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; services = { diff --git a/asus/zephyrus/gu605my/default.nix b/asus/zephyrus/gu605my/default.nix index d1ce68bb..3ccbdbfd 100644 --- a/asus/zephyrus/gu605my/default.nix +++ b/asus/zephyrus/gu605my/default.nix @@ -6,7 +6,7 @@ ../../../common/gpu/nvidia/prime.nix ../../../common/gpu/nvidia/ada-lovelace ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ../shared/backlight.nix ]; diff --git a/chuwi/minibook-x/default.nix b/chuwi/minibook-x/default.nix index 39bc9ccc..0b78d046 100644 --- a/chuwi/minibook-x/default.nix +++ b/chuwi/minibook-x/default.nix @@ -2,7 +2,7 @@ imports = [ ../../common/cpu/intel ../../common/pc/laptop - ../../common/pc/laptop/ssd + ../../common/pc/ssd ../../common/hidpi.nix ]; # Fixes the display being rotated 90 degrees. diff --git a/common/pc/laptop/ssd b/common/pc/laptop/ssd deleted file mode 120000 index e313834a..00000000 --- a/common/pc/laptop/ssd +++ /dev/null @@ -1 +0,0 @@ -../ssd \ No newline at end of file diff --git a/dell/g3/3579/default.nix b/dell/g3/3579/default.nix index e5246c4c..9b74d522 100644 --- a/dell/g3/3579/default.nix +++ b/dell/g3/3579/default.nix @@ -6,7 +6,7 @@ ../../../common/gpu/nvidia/prime.nix ../../../common/gpu/nvidia/pascal ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; # Specify bus id of Nvidia and Intel graphics diff --git a/dell/g3/3779/default.nix b/dell/g3/3779/default.nix index c9afd482..4e345a02 100644 --- a/dell/g3/3779/default.nix +++ b/dell/g3/3779/default.nix @@ -6,7 +6,7 @@ ../../../common/gpu/nvidia/prime.nix ../../../common/gpu/nvidia/pascal ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; # Specify bus id of Nvidia and Intel graphics diff --git a/dell/inspiron/7405/default.nix b/dell/inspiron/7405/default.nix index 06ccf92f..d894e179 100644 --- a/dell/inspiron/7405/default.nix +++ b/dell/inspiron/7405/default.nix @@ -7,7 +7,7 @@ with lib; ../../../common/cpu/amd ../../../common/gpu/amd ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; # TSC is unstable diff --git a/dell/inspiron/7460/default.nix b/dell/inspiron/7460/default.nix index 5a268970..aacbacaa 100644 --- a/dell/inspiron/7460/default.nix +++ b/dell/inspiron/7460/default.nix @@ -3,7 +3,7 @@ { imports = [ ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ../../../common/gpu/intel/kaby-lake ../../../common/gpu/nvidia/maxwell ../../../common/gpu/nvidia/prime.nix diff --git a/dell/inspiron/7559/README.md b/dell/inspiron/7559/README.md index a1bb0427..6a4b2033 100644 --- a/dell/inspiron/7559/README.md +++ b/dell/inspiron/7559/README.md @@ -41,7 +41,7 @@ This configuration uses Nvidia Prime offloading, which allows use of the `nvidia #### SSD -This laptop has an optional M.2 SSD slot, which isn't accounted for here. If you are using the SSD, you could look into implementing the options in [ssd](common/pc/laptop/ssd) manually. Some sources also say you should ensure your SATA Mode is set to AHCI in your BIOS for it to be detected, however I think this is a prerequisite to installing Linux on this laptop in the first place so you probably already have that set. +This laptop has an optional M.2 SSD slot, which isn't accounted for here. If you are using the SSD, you could look into implementing the options in [ssd](common/pc/ssd) manually. Some sources also say you should ensure your SATA Mode is set to AHCI in your BIOS for it to be detected, however I think this is a prerequisite to installing Linux on this laptop in the first place so you probably already have that set. #### Subwoofer diff --git a/dell/latitude/3340/default.nix b/dell/latitude/3340/default.nix index d50b024c..dda36a88 100644 --- a/dell/latitude/3340/default.nix +++ b/dell/latitude/3340/default.nix @@ -4,6 +4,6 @@ imports = [ ../../../common/cpu/intel ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; } diff --git a/dell/latitude/3480/default.nix b/dell/latitude/3480/default.nix index 0b16e0aa..e54673cb 100644 --- a/dell/latitude/3480/default.nix +++ b/dell/latitude/3480/default.nix @@ -4,7 +4,7 @@ imports = [ ../../../common/cpu/intel ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; # touchpad goes over i2c diff --git a/dell/latitude/5490/default.nix b/dell/latitude/5490/default.nix index ee99f414..2cde4ad0 100644 --- a/dell/latitude/5490/default.nix +++ b/dell/latitude/5490/default.nix @@ -4,12 +4,12 @@ imports = [ ../../../common/cpu/intel ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; # Important Firmware hardware.enableRedistributableFirmware = lib.mkDefault true; - + boot = { # Kernel Panic on suspend fix, taken from ArchLinux wiki. kernelParams = [ "acpi_enforce_resources=lax" "i915.enable_dc=0" ]; diff --git a/dell/latitude/5520/default.nix b/dell/latitude/5520/default.nix index 6ad43309..b72a1830 100644 --- a/dell/latitude/5520/default.nix +++ b/dell/latitude/5520/default.nix @@ -4,7 +4,7 @@ imports = [ ../../../common/cpu/intel ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; # Essential Firmware diff --git a/dell/latitude/7280/default.nix b/dell/latitude/7280/default.nix index 3b57a289..c98daed5 100644 --- a/dell/latitude/7280/default.nix +++ b/dell/latitude/7280/default.nix @@ -4,6 +4,6 @@ imports = [ ../../../common/cpu/intel ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; } diff --git a/dell/latitude/7420/default.nix b/dell/latitude/7420/default.nix index a100101a..7e1f49f1 100644 --- a/dell/latitude/7420/default.nix +++ b/dell/latitude/7420/default.nix @@ -4,6 +4,6 @@ imports = [ ../../../common/cpu/intel/tiger-lake ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; } diff --git a/dell/latitude/7430/default.nix b/dell/latitude/7430/default.nix index 7d2f6f98..18f4bb21 100644 --- a/dell/latitude/7430/default.nix +++ b/dell/latitude/7430/default.nix @@ -4,16 +4,16 @@ imports = [ ../../../common/cpu/intel ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; - boot.kernelParams = [ + boot.kernelParams = [ # needed for Intel Iris Xe "i915.force_probe=46a8" "i915.enable_guc=3" "i915.fastboot=1" # needed for keyboard - "i8042.dumbkbd=1" - "i8042.nopnp=1" + "i8042.dumbkbd=1" + "i8042.nopnp=1" ]; } diff --git a/dell/latitude/9430/default.nix b/dell/latitude/9430/default.nix index f652e9ac..0441f53d 100644 --- a/dell/latitude/9430/default.nix +++ b/dell/latitude/9430/default.nix @@ -4,7 +4,7 @@ imports = [ ../../../common/cpu/intel ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; boot.kernelParams = [ diff --git a/dell/precision/5530/default.nix b/dell/precision/5530/default.nix index 84ac324b..1b7007af 100644 --- a/dell/precision/5530/default.nix +++ b/dell/precision/5530/default.nix @@ -3,7 +3,7 @@ { imports = [ ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ../../../common/gpu/nvidia/pascal ../../../common/gpu/nvidia/prime.nix ../../../common/cpu/intel/coffee-lake diff --git a/dell/precision/5560/default.nix b/dell/precision/5560/default.nix index a17ef775..efd227ca 100644 --- a/dell/precision/5560/default.nix +++ b/dell/precision/5560/default.nix @@ -2,7 +2,7 @@ { imports = [ ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ../../../common/cpu/intel/tiger-lake ../../../common/gpu/nvidia/turing ]; diff --git a/dell/precision/7520/default.nix b/dell/precision/7520/default.nix index 59fa95e6..567aa382 100644 --- a/dell/precision/7520/default.nix +++ b/dell/precision/7520/default.nix @@ -6,7 +6,7 @@ imports = [ ../../../common/cpu/intel/kaby-lake ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ../../../common/gpu/nvidia ]; hardware.enableRedistributableFirmware = lib.mkDefault true; diff --git a/dell/xps/13-7390/default.nix b/dell/xps/13-7390/default.nix index 1f1c4561..c5e8a698 100644 --- a/dell/xps/13-7390/default.nix +++ b/dell/xps/13-7390/default.nix @@ -4,7 +4,7 @@ imports = [ ../../../common/cpu/intel ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; boot.kernelParams = [ "mem_sleep_default=deep" ]; diff --git a/dell/xps/13-9343/default.nix b/dell/xps/13-9343/default.nix index 2904a773..98e0c417 100644 --- a/dell/xps/13-9343/default.nix +++ b/dell/xps/13-9343/default.nix @@ -4,7 +4,7 @@ imports = [ ../../../common/cpu/intel ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; # This will save you money and possibly your life! diff --git a/dell/xps/13-9350/default.nix b/dell/xps/13-9350/default.nix index 8ee58b2c..2157e642 100644 --- a/dell/xps/13-9350/default.nix +++ b/dell/xps/13-9350/default.nix @@ -4,7 +4,7 @@ imports = [ ../../../common/cpu/intel/lunar-lake ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; # The touchpad uses I²C, so PS/2 is unnecessary diff --git a/dell/xps/15-9500/default.nix b/dell/xps/15-9500/default.nix index 7d346a27..b11ecd16 100644 --- a/dell/xps/15-9500/default.nix +++ b/dell/xps/15-9500/default.nix @@ -6,7 +6,7 @@ in imports = [ ../../../common/cpu/intel ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; # Boot loader @@ -18,7 +18,7 @@ in # Thermald doesn't have a default config for the 9500 yet, the one in this repo # was generated with dptfxtract-static (https://github.com/intel/dptfxtract) services.thermald.configFile = lib.mkDefault thermald-conf; - + # WiFi speed is slow and crashes by default (https://bugzilla.kernel.org/show_bug.cgi?id=213381) # disable_11ax - required until ax driver support is fixed # power_save - works well on this card diff --git a/dell/xps/15-9510/default.nix b/dell/xps/15-9510/default.nix index 066039c6..12a64450 100644 --- a/dell/xps/15-9510/default.nix +++ b/dell/xps/15-9510/default.nix @@ -2,7 +2,7 @@ imports = [ ../../../common/cpu/intel ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; # This will save you money and possibly your life! diff --git a/dell/xps/15-9520/default.nix b/dell/xps/15-9520/default.nix index 19205454..b30eee31 100644 --- a/dell/xps/15-9520/default.nix +++ b/dell/xps/15-9520/default.nix @@ -4,7 +4,7 @@ ../../../common/cpu/intel ../../../common/gpu/intel/alder-lake ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; # This will save you money and possibly your life! diff --git a/dell/xps/15-9530/default.nix b/dell/xps/15-9530/default.nix index 95df2da6..99fd8a71 100644 --- a/dell/xps/15-9530/default.nix +++ b/dell/xps/15-9530/default.nix @@ -3,7 +3,7 @@ imports = [ ../../../common/cpu/intel ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; # This will save you money and possibly your life! diff --git a/focus/m2/gen1/default.nix b/focus/m2/gen1/default.nix index f9242900..2b8e5e7c 100644 --- a/focus/m2/gen1/default.nix +++ b/focus/m2/gen1/default.nix @@ -6,7 +6,7 @@ ../../../common/gpu/nvidia/prime.nix ../../../common/gpu/nvidia/turing ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; diff --git a/framework/13-inch/common/default.nix b/framework/13-inch/common/default.nix index 4e6f519a..d42a9f72 100644 --- a/framework/13-inch/common/default.nix +++ b/framework/13-inch/common/default.nix @@ -2,7 +2,7 @@ { imports = [ ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ../../bluetooth.nix ../../kmod.nix ../../framework-tool.nix diff --git a/framework/16-inch/common/default.nix b/framework/16-inch/common/default.nix index 0b803063..8443e401 100644 --- a/framework/16-inch/common/default.nix +++ b/framework/16-inch/common/default.nix @@ -2,7 +2,7 @@ { imports = [ ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ../../bluetooth.nix ../../kmod.nix ../../framework-tool.nix diff --git a/google/pixelbook/default.nix b/google/pixelbook/default.nix index 1ea4c7af..6ad1d2cc 100644 --- a/google/pixelbook/default.nix +++ b/google/pixelbook/default.nix @@ -3,7 +3,7 @@ { imports = [ ../../common/pc/laptop - ../../common/pc/laptop/ssd + ../../common/pc/ssd ../../common/cpu/intel/kaby-lake ]; } diff --git a/gpd/micropc/default.nix b/gpd/micropc/default.nix index d9a699ef..34b35201 100644 --- a/gpd/micropc/default.nix +++ b/gpd/micropc/default.nix @@ -2,7 +2,7 @@ { imports = [ ../../common/pc/laptop - ../../common/pc/laptop/ssd + ../../common/pc/ssd ]; # Needed to have the keyboard working during the initrd sequence diff --git a/gpd/p2-max/default.nix b/gpd/p2-max/default.nix index e8f183e2..206348c4 100644 --- a/gpd/p2-max/default.nix +++ b/gpd/p2-max/default.nix @@ -1,7 +1,7 @@ { imports = [ ../../common/pc/laptop - ../../common/pc/laptop/ssd + ../../common/pc/ssd ../../common/cpu/intel/kaby-lake ../../common/hidpi.nix ]; diff --git a/gpd/pocket-3/default.nix b/gpd/pocket-3/default.nix index 621f4454..a271a644 100644 --- a/gpd/pocket-3/default.nix +++ b/gpd/pocket-3/default.nix @@ -4,7 +4,7 @@ in { imports = [ ../../common/pc/laptop - ../../common/pc/laptop/ssd + ../../common/pc/ssd ../../common/hidpi.nix ../../common/gpu/24.05-compat.nix ]; diff --git a/gpd/pocket-4/default.nix b/gpd/pocket-4/default.nix index 36a6a0a7..4ec54b63 100644 --- a/gpd/pocket-4/default.nix +++ b/gpd/pocket-4/default.nix @@ -4,7 +4,7 @@ in { imports = [ ../../common/pc/laptop - ../../common/pc/laptop/ssd + ../../common/pc/ssd ../../common/cpu/amd ../../common/cpu/amd/pstate.nix ../../common/gpu/amd diff --git a/hp/elitebook/830/g6/default.nix b/hp/elitebook/830/g6/default.nix index 9e62264f..1790c8a9 100644 --- a/hp/elitebook/830/g6/default.nix +++ b/hp/elitebook/830/g6/default.nix @@ -3,7 +3,7 @@ imports = [ ../../../../common/cpu/intel ../../../../common/pc/laptop - ../../../../common/pc/laptop/ssd + ../../../../common/pc/ssd ]; # Needed for wifi diff --git a/hp/elitebook/845/g7/default.nix b/hp/elitebook/845/g7/default.nix index 823bf40c..d18ef3cf 100644 --- a/hp/elitebook/845/g7/default.nix +++ b/hp/elitebook/845/g7/default.nix @@ -7,7 +7,7 @@ ../../../../common/cpu/amd/pstate.nix ../../../../common/gpu/amd ../../../../common/pc/laptop - ../../../../common/pc/laptop/ssd + ../../../../common/pc/ssd ]; hardware.enableRedistributableFirmware = lib.mkDefault true; diff --git a/hp/elitebook/845/g8/default.nix b/hp/elitebook/845/g8/default.nix index 823bf40c..d18ef3cf 100644 --- a/hp/elitebook/845/g8/default.nix +++ b/hp/elitebook/845/g8/default.nix @@ -7,7 +7,7 @@ ../../../../common/cpu/amd/pstate.nix ../../../../common/gpu/amd ../../../../common/pc/laptop - ../../../../common/pc/laptop/ssd + ../../../../common/pc/ssd ]; hardware.enableRedistributableFirmware = lib.mkDefault true; diff --git a/hp/elitebook/845/g9/default.nix b/hp/elitebook/845/g9/default.nix index 823bf40c..d18ef3cf 100644 --- a/hp/elitebook/845/g9/default.nix +++ b/hp/elitebook/845/g9/default.nix @@ -7,7 +7,7 @@ ../../../../common/cpu/amd/pstate.nix ../../../../common/gpu/amd ../../../../common/pc/laptop - ../../../../common/pc/laptop/ssd + ../../../../common/pc/ssd ]; hardware.enableRedistributableFirmware = lib.mkDefault true; diff --git a/hp/laptop/14s-dq2024nf/default.nix b/hp/laptop/14s-dq2024nf/default.nix index acad2f55..f7a1a654 100644 --- a/hp/laptop/14s-dq2024nf/default.nix +++ b/hp/laptop/14s-dq2024nf/default.nix @@ -5,7 +5,7 @@ ../../../common/cpu/intel/tiger-lake ../../../common/pc ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; config = { diff --git a/hp/probook/440G5/default.nix b/hp/probook/440G5/default.nix index 7cc5a234..9bc0fc82 100644 --- a/hp/probook/440G5/default.nix +++ b/hp/probook/440G5/default.nix @@ -7,7 +7,7 @@ ../../../common/cpu/intel/kaby-lake ../../../common/pc ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; config = { diff --git a/lenovo/ideapad/15ach6/default.nix b/lenovo/ideapad/15ach6/default.nix index e86fee90..35527a01 100644 --- a/lenovo/ideapad/15ach6/default.nix +++ b/lenovo/ideapad/15ach6/default.nix @@ -8,7 +8,7 @@ ../../../common/gpu/nvidia/prime.nix ../../../common/gpu/nvidia/turing ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; hardware.nvidia = { diff --git a/lenovo/ideapad/15alc6/default.nix b/lenovo/ideapad/15alc6/default.nix index 386f2720..31a8b390 100644 --- a/lenovo/ideapad/15alc6/default.nix +++ b/lenovo/ideapad/15alc6/default.nix @@ -5,6 +5,6 @@ ../../../common/cpu/amd ../../../common/gpu/amd ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; } diff --git a/lenovo/ideapad/15arh05/default.nix b/lenovo/ideapad/15arh05/default.nix index f021a2d6..a4ff8df1 100644 --- a/lenovo/ideapad/15arh05/default.nix +++ b/lenovo/ideapad/15arh05/default.nix @@ -6,7 +6,7 @@ ../../../common/gpu/nvidia/prime.nix ../../../common/gpu/nvidia/turing ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; # Specify bus id of Nvidia and Intel graphics. diff --git a/lenovo/ideapad/16ach6/default.nix b/lenovo/ideapad/16ach6/default.nix index aeec3298..246b35ea 100644 --- a/lenovo/ideapad/16ach6/default.nix +++ b/lenovo/ideapad/16ach6/default.nix @@ -8,7 +8,7 @@ ../../../common/gpu/nvidia/prime.nix ../../../common/gpu/nvidia/turing ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; hardware.nvidia = { diff --git a/lenovo/ideapad/16ahp9/default.nix b/lenovo/ideapad/16ahp9/default.nix index f83290e2..5a6acd06 100644 --- a/lenovo/ideapad/16ahp9/default.nix +++ b/lenovo/ideapad/16ahp9/default.nix @@ -6,6 +6,6 @@ ../../../common/cpu/amd/pstate.nix ../../../common/gpu/amd ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; } diff --git a/lenovo/ideapad/16iah8/default.nix b/lenovo/ideapad/16iah8/default.nix index 1f71aed2..ee899fc5 100644 --- a/lenovo/ideapad/16iah8/default.nix +++ b/lenovo/ideapad/16iah8/default.nix @@ -4,6 +4,6 @@ imports = [ ../../../common/cpu/intel/alder-lake ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; } diff --git a/lenovo/ideapad/slim-5/default.nix b/lenovo/ideapad/slim-5/default.nix index 02173bd4..202d2c85 100644 --- a/lenovo/ideapad/slim-5/default.nix +++ b/lenovo/ideapad/slim-5/default.nix @@ -3,6 +3,6 @@ ../../../common/cpu/amd ../../../common/gpu/amd ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; } diff --git a/lenovo/legion/15ach6/default.nix b/lenovo/legion/15ach6/default.nix index 0166a5fe..6c890105 100644 --- a/lenovo/legion/15ach6/default.nix +++ b/lenovo/legion/15ach6/default.nix @@ -7,7 +7,7 @@ ../../../common/gpu/nvidia/ampere ../../../common/hidpi.nix ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; hardware.nvidia.prime = { diff --git a/lenovo/legion/15ach6h/hybrid/default.nix b/lenovo/legion/15ach6h/hybrid/default.nix index 044d088b..7fa179ce 100644 --- a/lenovo/legion/15ach6h/hybrid/default.nix +++ b/lenovo/legion/15ach6h/hybrid/default.nix @@ -8,7 +8,7 @@ ../../../../common/gpu/nvidia/prime.nix ../../../../common/gpu/nvidia/ampere ../../../../common/pc/laptop - ../../../../common/pc/laptop/ssd + ../../../../common/pc/ssd ]; # Still needs to load at some point if we want X11 to work diff --git a/lenovo/legion/15arh05h/default.nix b/lenovo/legion/15arh05h/default.nix index bfff924a..554ad8ff 100644 --- a/lenovo/legion/15arh05h/default.nix +++ b/lenovo/legion/15arh05h/default.nix @@ -6,7 +6,7 @@ ../../../common/gpu/nvidia/prime.nix ../../../common/gpu/nvidia/turing ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; # Specify bus id of Nvidia and Intel graphics. diff --git a/lenovo/legion/15ich/default.nix b/lenovo/legion/15ich/default.nix index 8aaffff8..630e1378 100644 --- a/lenovo/legion/15ich/default.nix +++ b/lenovo/legion/15ich/default.nix @@ -6,7 +6,7 @@ ../../../common/gpu/nvidia/prime.nix ../../../common/gpu/nvidia/pascal ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ../../../common/pc/laptop/hdd ]; diff --git a/lenovo/legion/16ach6h/hybrid/default.nix b/lenovo/legion/16ach6h/hybrid/default.nix index 28a68ba1..e987ecd5 100644 --- a/lenovo/legion/16ach6h/hybrid/default.nix +++ b/lenovo/legion/16ach6h/hybrid/default.nix @@ -9,7 +9,7 @@ ../../../../common/gpu/nvidia/prime.nix ../../../../common/gpu/nvidia/ampere ../../../../common/pc/laptop - ../../../../common/pc/laptop/ssd + ../../../../common/pc/ssd ../edid ]; diff --git a/lenovo/legion/16achg6/hybrid/default.nix b/lenovo/legion/16achg6/hybrid/default.nix index fa69491b..f61c4307 100644 --- a/lenovo/legion/16achg6/hybrid/default.nix +++ b/lenovo/legion/16achg6/hybrid/default.nix @@ -7,7 +7,7 @@ ../../../../common/gpu/amd ../../../../common/gpu/nvidia/prime.nix ../../../../common/pc/laptop - ../../../../common/pc/laptop/ssd + ../../../../common/pc/ssd ]; services.xserver.videoDrivers = [ "nvidia" ]; @@ -25,4 +25,4 @@ }; }; }; -} \ No newline at end of file +} diff --git a/lenovo/legion/16aph8/default.nix b/lenovo/legion/16aph8/default.nix index 4718cd3d..e44329fa 100644 --- a/lenovo/legion/16aph8/default.nix +++ b/lenovo/legion/16aph8/default.nix @@ -7,7 +7,7 @@ ../../../common/gpu/amd ../../../common/gpu/nvidia ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; # Use latest LTS kernel for more Raphael fixes diff --git a/lenovo/legion/16arh7h/hybrid/default.nix b/lenovo/legion/16arh7h/hybrid/default.nix index af6ff64a..1654e23c 100644 --- a/lenovo/legion/16arh7h/hybrid/default.nix +++ b/lenovo/legion/16arh7h/hybrid/default.nix @@ -9,7 +9,7 @@ ../../../../common/gpu/nvidia/prime.nix # prime offload ../../../../common/gpu/nvidia/ampere # use open drivers ../../../../common/pc/laptop - ../../../../common/pc/laptop/ssd + ../../../../common/pc/ssd ]; boot.kernelModules = ["amdgpu"]; diff --git a/lenovo/legion/16arh7h/igpu-only/default.nix b/lenovo/legion/16arh7h/igpu-only/default.nix index c8e477f2..bd61814f 100644 --- a/lenovo/legion/16arh7h/igpu-only/default.nix +++ b/lenovo/legion/16arh7h/igpu-only/default.nix @@ -6,6 +6,6 @@ ../../../../common/gpu/amd ../../../../common/gpu/nvidia/disable.nix ../../../../common/pc/laptop - ../../../../common/pc/laptop/ssd + ../../../../common/pc/ssd ]; } diff --git a/lenovo/legion/16arha7/default.nix b/lenovo/legion/16arha7/default.nix index 8c258d58..c6e3a8c4 100644 --- a/lenovo/legion/16arha7/default.nix +++ b/lenovo/legion/16arha7/default.nix @@ -11,12 +11,12 @@ in ../../../common/cpu/amd/pstate.nix ../../../common/gpu/amd ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; # 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 ]; - + # √(2560² + 1600²) px / 16 in ≃ 189 dpi services.xserver.dpi = 189; diff --git a/lenovo/legion/16irx8h/default.nix b/lenovo/legion/16irx8h/default.nix index 6d9c772c..e4b6ca86 100644 --- a/lenovo/legion/16irx8h/default.nix +++ b/lenovo/legion/16irx8h/default.nix @@ -8,7 +8,7 @@ ../../../common/gpu/nvidia/prime.nix ../../../common/gpu/nvidia/ada-lovelace ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ../../../common/hidpi.nix ]; diff --git a/lenovo/legion/16irx9h/default.nix b/lenovo/legion/16irx9h/default.nix index f96bc51b..6a8077d8 100644 --- a/lenovo/legion/16irx9h/default.nix +++ b/lenovo/legion/16irx9h/default.nix @@ -8,7 +8,7 @@ ../../../common/gpu/nvidia/prime.nix ../../../common/gpu/nvidia/ada-lovelace ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ../../../common/hidpi.nix ]; diff --git a/lenovo/legion/16ithg6/default.nix b/lenovo/legion/16ithg6/default.nix index 9d6c292f..a0ee3a76 100644 --- a/lenovo/legion/16ithg6/default.nix +++ b/lenovo/legion/16ithg6/default.nix @@ -6,7 +6,7 @@ ../../../common/gpu/nvidia/prime.nix ../../../common/gpu/nvidia/ampere ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ../../../common/hidpi.nix ]; diff --git a/lenovo/thinkpad/e14/default.nix b/lenovo/thinkpad/e14/default.nix index c6948b35..85c83e17 100644 --- a/lenovo/thinkpad/e14/default.nix +++ b/lenovo/thinkpad/e14/default.nix @@ -3,7 +3,7 @@ { imports = [ ../. - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; boot.kernelParams = [ diff --git a/lenovo/thinkpad/e15/default.nix b/lenovo/thinkpad/e15/default.nix index a8805138..a54db80e 100644 --- a/lenovo/thinkpad/e15/default.nix +++ b/lenovo/thinkpad/e15/default.nix @@ -4,7 +4,7 @@ imports = [ ../. ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; boot.kernelParams = [ diff --git a/lenovo/thinkpad/l13/default.nix b/lenovo/thinkpad/l13/default.nix index dcf9a572..2ee6567a 100644 --- a/lenovo/thinkpad/l13/default.nix +++ b/lenovo/thinkpad/l13/default.nix @@ -2,7 +2,7 @@ { imports = [ ../../../common/cpu/intel - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ../. ]; diff --git a/lenovo/thinkpad/l14/default.nix b/lenovo/thinkpad/l14/default.nix index a59ec14c..d33b4bfa 100644 --- a/lenovo/thinkpad/l14/default.nix +++ b/lenovo/thinkpad/l14/default.nix @@ -1,7 +1,7 @@ { imports = [ ../. - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; boot.kernelParams = [ diff --git a/lenovo/thinkpad/l480/default.nix b/lenovo/thinkpad/l480/default.nix index d000320d..2568433c 100644 --- a/lenovo/thinkpad/l480/default.nix +++ b/lenovo/thinkpad/l480/default.nix @@ -3,7 +3,7 @@ imports = [ ../. ../../../common/cpu/intel/kaby-lake - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; # available cpufreq governors: performance powersave diff --git a/lenovo/thinkpad/p1/default.nix b/lenovo/thinkpad/p1/default.nix index f26e01b5..197bfab2 100644 --- a/lenovo/thinkpad/p1/default.nix +++ b/lenovo/thinkpad/p1/default.nix @@ -4,7 +4,7 @@ # might need nvidia module but we don't know the PCI ids: # https://github.com/NixOS/nixos-hardware/pull/274#discussion_r650483740 #../../../common/gpu/nvidia/prime.nix - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; # Need to set Thunderbolt to "BIOS Assist Mode" diff --git a/lenovo/thinkpad/p14s/default.nix b/lenovo/thinkpad/p14s/default.nix index 6e87b7bc..3a19fc1c 100644 --- a/lenovo/thinkpad/p14s/default.nix +++ b/lenovo/thinkpad/p14s/default.nix @@ -6,7 +6,7 @@ imports = [ ../. - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; # Force use of the amdgpu driver for backlight control on kernel versions where the diff --git a/lenovo/thinkpad/p16s/default.nix b/lenovo/thinkpad/p16s/default.nix index 53a9fdf5..83a4942f 100644 --- a/lenovo/thinkpad/p16s/default.nix +++ b/lenovo/thinkpad/p16s/default.nix @@ -1,6 +1,6 @@ { imports = [ ../. - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; } diff --git a/lenovo/thinkpad/p43s/default.nix b/lenovo/thinkpad/p43s/default.nix index 46632b79..c5e34ff0 100644 --- a/lenovo/thinkpad/p43s/default.nix +++ b/lenovo/thinkpad/p43s/default.nix @@ -2,7 +2,7 @@ imports = [ ../. ../../../common/cpu/intel/whiskey-lake - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ../../../common/gpu/nvidia/pascal ../../../common/gpu/nvidia/prime-sync.nix ]; diff --git a/lenovo/thinkpad/t14/default.nix b/lenovo/thinkpad/t14/default.nix index fb42f2b9..2a725bb5 100644 --- a/lenovo/thinkpad/t14/default.nix +++ b/lenovo/thinkpad/t14/default.nix @@ -3,7 +3,7 @@ { imports = [ ../. - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; # For suspending to RAM to work, set Config -> Power -> Sleep State to "Linux" in EFI. diff --git a/lenovo/thinkpad/x1-extreme/default.nix b/lenovo/thinkpad/x1-extreme/default.nix index 2e4c10e0..b816d538 100644 --- a/lenovo/thinkpad/x1-extreme/default.nix +++ b/lenovo/thinkpad/x1-extreme/default.nix @@ -2,6 +2,6 @@ imports = [ ../. ../../../common/cpu/intel - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; } diff --git a/lenovo/thinkpad/x1-nano/default.nix b/lenovo/thinkpad/x1-nano/default.nix index a842d437..b67595c3 100644 --- a/lenovo/thinkpad/x1-nano/default.nix +++ b/lenovo/thinkpad/x1-nano/default.nix @@ -3,6 +3,6 @@ imports = [ ../. ../../../common/cpu/intel - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; } diff --git a/lenovo/thinkpad/x1/10th-gen/default.nix b/lenovo/thinkpad/x1/10th-gen/default.nix index 75a23d85..8f814835 100644 --- a/lenovo/thinkpad/x1/10th-gen/default.nix +++ b/lenovo/thinkpad/x1/10th-gen/default.nix @@ -1,7 +1,7 @@ { imports = [ ../. - ../../../../common/pc/laptop/ssd + ../../../../common/pc/ssd ]; # Use the right Intel graphics driver diff --git a/lenovo/thinkpad/x1/11th-gen/default.nix b/lenovo/thinkpad/x1/11th-gen/default.nix index 86c2992b..07b32232 100644 --- a/lenovo/thinkpad/x1/11th-gen/default.nix +++ b/lenovo/thinkpad/x1/11th-gen/default.nix @@ -1,7 +1,7 @@ { imports = [ ../. - ../../../../common/pc/laptop/ssd + ../../../../common/pc/ssd ]; # Use the right Intel graphics driver diff --git a/lenovo/thinkpad/x1/12th-gen/default.nix b/lenovo/thinkpad/x1/12th-gen/default.nix index 7d17c714..b13ea279 100644 --- a/lenovo/thinkpad/x1/12th-gen/default.nix +++ b/lenovo/thinkpad/x1/12th-gen/default.nix @@ -1,7 +1,7 @@ { imports = [ ../. - ../../../../common/pc/laptop/ssd + ../../../../common/pc/ssd ]; hardware.trackpoint.device = "TPPS/2 Synaptics TrackPoint"; diff --git a/lenovo/thinkpad/x1/2nd-gen/default.nix b/lenovo/thinkpad/x1/2nd-gen/default.nix index ac338c61..8d381f23 100644 --- a/lenovo/thinkpad/x1/2nd-gen/default.nix +++ b/lenovo/thinkpad/x1/2nd-gen/default.nix @@ -3,7 +3,7 @@ imports = [ ../. ../../../../common/cpu/intel/haswell - ../../../../common/pc/laptop/ssd + ../../../../common/pc/ssd ]; services.throttled.enable = lib.mkDefault true; diff --git a/lenovo/thinkpad/x1/6th-gen/default.nix b/lenovo/thinkpad/x1/6th-gen/default.nix index 264faa6c..92cefaf7 100644 --- a/lenovo/thinkpad/x1/6th-gen/default.nix +++ b/lenovo/thinkpad/x1/6th-gen/default.nix @@ -10,7 +10,7 @@ imports = [ ../. ../../../../common/cpu/intel/kaby-lake - ../../../../common/pc/laptop/ssd + ../../../../common/pc/ssd ]; # New ThinkPads have a different TrackPoint manufacturer/name. diff --git a/lenovo/thinkpad/x1/7th-gen/default.nix b/lenovo/thinkpad/x1/7th-gen/default.nix index 6dd02b8e..38c66fd0 100644 --- a/lenovo/thinkpad/x1/7th-gen/default.nix +++ b/lenovo/thinkpad/x1/7th-gen/default.nix @@ -2,7 +2,7 @@ { imports = [ ../. - ../../../../common/pc/laptop/ssd + ../../../../common/pc/ssd ]; services.throttled.enable = lib.mkDefault true; diff --git a/lenovo/thinkpad/x1/9th-gen/default.nix b/lenovo/thinkpad/x1/9th-gen/default.nix index a52f02b7..ef8bd9f1 100644 --- a/lenovo/thinkpad/x1/9th-gen/default.nix +++ b/lenovo/thinkpad/x1/9th-gen/default.nix @@ -2,7 +2,7 @@ { imports = [ ../. - ../../../../common/pc/laptop/ssd + ../../../../common/pc/ssd ]; # This solves lagging noticeable on high-resolution screens. diff --git a/lenovo/thinkpad/x1/yoga/7th-gen/default.nix b/lenovo/thinkpad/x1/yoga/7th-gen/default.nix index 20c49074..ed1a747f 100644 --- a/lenovo/thinkpad/x1/yoga/7th-gen/default.nix +++ b/lenovo/thinkpad/x1/yoga/7th-gen/default.nix @@ -1,7 +1,7 @@ { lib, pkgs, ... }: { imports = [ ../. - ../../../../../common/pc/laptop/ssd + ../../../../../common/pc/ssd ]; # At least kernel 5.19 is required for the system to work properly. diff --git a/lenovo/thinkpad/x1/yoga/8th-gen/default.nix b/lenovo/thinkpad/x1/yoga/8th-gen/default.nix index cc1676cc..d89bbd49 100644 --- a/lenovo/thinkpad/x1/yoga/8th-gen/default.nix +++ b/lenovo/thinkpad/x1/yoga/8th-gen/default.nix @@ -1,6 +1,6 @@ { imports = [ ../. - ../../../../../common/pc/laptop/ssd + ../../../../../common/pc/ssd ]; } diff --git a/lenovo/thinkpad/x13/common.nix b/lenovo/thinkpad/x13/common.nix index c45a7a67..131f468c 100644 --- a/lenovo/thinkpad/x13/common.nix +++ b/lenovo/thinkpad/x13/common.nix @@ -1,7 +1,7 @@ { ... }: { imports = [ ../. - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; # Somehow psmouse does not load automatically on boot for me diff --git a/lenovo/thinkpad/x270/default.nix b/lenovo/thinkpad/x270/default.nix index 8e09d2a1..636ef145 100644 --- a/lenovo/thinkpad/x270/default.nix +++ b/lenovo/thinkpad/x270/default.nix @@ -2,7 +2,7 @@ imports = [ ../. ../../../common/cpu/intel - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; boot.kernelParams = [ diff --git a/lenovo/thinkpad/x280/default.nix b/lenovo/thinkpad/x280/default.nix index 5b6121a0..7a3b5508 100644 --- a/lenovo/thinkpad/x280/default.nix +++ b/lenovo/thinkpad/x280/default.nix @@ -4,7 +4,7 @@ imports = [ ../. ../../../common/cpu/intel - ../../../common/pc/laptop/ssd/default.nix + ../../../common/pc/ssd/default.nix ]; services.throttled.enable = lib.mkDefault true; diff --git a/lenovo/thinkpad/x390/default.nix b/lenovo/thinkpad/x390/default.nix index d06a4aea..80c893ba 100644 --- a/lenovo/thinkpad/x390/default.nix +++ b/lenovo/thinkpad/x390/default.nix @@ -4,7 +4,7 @@ imports = [ ../. ../../../common/cpu/intel - ../../../common/pc/laptop/ssd/default.nix + ../../../common/pc/ssd/default.nix ]; services.throttled.enable = lib.mkDefault true; diff --git a/lenovo/thinkpad/z/default.nix b/lenovo/thinkpad/z/default.nix index 5d8ba8ac..11dda086 100644 --- a/lenovo/thinkpad/z/default.nix +++ b/lenovo/thinkpad/z/default.nix @@ -5,7 +5,7 @@ ../../../common/cpu/amd/pstate.nix ../../../common/gpu/amd ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; hardware.enableRedistributableFirmware = lib.mkDefault true; diff --git a/malibal/aon/s1/default.nix b/malibal/aon/s1/default.nix index 86995beb..c682a447 100644 --- a/malibal/aon/s1/default.nix +++ b/malibal/aon/s1/default.nix @@ -3,7 +3,7 @@ { imports = [ ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ../../../common/cpu/intel diff --git a/msi/gl62/default.nix b/msi/gl62/default.nix index 977af651..bae5dea5 100644 --- a/msi/gl62/default.nix +++ b/msi/gl62/default.nix @@ -2,7 +2,7 @@ { imports = [ - ../../common/pc/laptop/ssd + ../../common/pc/ssd ../../common/cpu/intel ../../common/gpu/nvidia/prime.nix ../../common/gpu/nvidia/pascal diff --git a/msi/gl65/10SDR-492/default.nix b/msi/gl65/10SDR-492/default.nix index 75289d4b..f2e56656 100644 --- a/msi/gl65/10SDR-492/default.nix +++ b/msi/gl65/10SDR-492/default.nix @@ -2,7 +2,7 @@ { imports = [ - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ../../../common/cpu/intel/comet-lake ../../../common/gpu/nvidia/prime.nix ../../../common/gpu/nvidia/turing diff --git a/omen/15-ce002ns/default.nix b/omen/15-ce002ns/default.nix index c787d3a0..990d59f8 100644 --- a/omen/15-ce002ns/default.nix +++ b/omen/15-ce002ns/default.nix @@ -5,7 +5,7 @@ ../../common/cpu/intel/kaby-lake ../../common/gpu/nvidia/pascal ../../common/pc/laptop - ../../common/pc/laptop/ssd + ../../common/pc/ssd ../../common/pc/laptop/hdd ]; } diff --git a/onenetbook/4/default.nix b/onenetbook/4/default.nix index 6b108b4c..251bc651 100644 --- a/onenetbook/4/default.nix +++ b/onenetbook/4/default.nix @@ -4,7 +4,7 @@ imports = [ ../../common/cpu/intel ../../common/pc/laptop - ../../common/pc/laptop/ssd + ../../common/pc/ssd ]; # OneNetbook 4 has `GXTP7386:00 27C6:011A Stylus` exporting no buttons in 5.12 diff --git a/slimbook/hero/rpl-rtx/default.nix b/slimbook/hero/rpl-rtx/default.nix index b71c22c7..f1a249de 100644 --- a/slimbook/hero/rpl-rtx/default.nix +++ b/slimbook/hero/rpl-rtx/default.nix @@ -6,7 +6,7 @@ ../../../common/gpu/nvidia/ada-lovelace ../../../common/gpu/nvidia/prime.nix ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; hardware = { diff --git a/starlabs/starlite/i5/default.nix b/starlabs/starlite/i5/default.nix index 018a5766..62e9d5a3 100644 --- a/starlabs/starlite/i5/default.nix +++ b/starlabs/starlite/i5/default.nix @@ -3,7 +3,7 @@ imports = [ ../../../common/cpu/intel ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; # Turn on IIO for accelerometer screen rotation. diff --git a/system76/darp6/default.nix b/system76/darp6/default.nix index 3f93993e..ff70ac94 100644 --- a/system76/darp6/default.nix +++ b/system76/darp6/default.nix @@ -28,7 +28,7 @@ in imports = [ ../. ../../common/pc/laptop - ../../common/pc/laptop/ssd + ../../common/pc/ssd ]; options.hardware.system76.darp6 = { diff --git a/tuxedo/pulse/14/gen3/default.nix b/tuxedo/pulse/14/gen3/default.nix index 34cca9ab..52d292cf 100644 --- a/tuxedo/pulse/14/gen3/default.nix +++ b/tuxedo/pulse/14/gen3/default.nix @@ -9,7 +9,7 @@ ../../../../common/cpu/amd/pstate.nix ../../../../common/cpu/amd/raphael/igpu.nix ../../../../common/pc/laptop - ../../../../common/pc/laptop/ssd + ../../../../common/pc/ssd ]; # Fixing a power-issue with older kernels. diff --git a/tuxedo/pulse/15/gen2/default.nix b/tuxedo/pulse/15/gen2/default.nix index 39ed0064..05c56055 100644 --- a/tuxedo/pulse/15/gen2/default.nix +++ b/tuxedo/pulse/15/gen2/default.nix @@ -2,7 +2,7 @@ imports = [ ../../../../common/cpu/amd ../../../../common/gpu/amd - ../../../../common/pc/laptop/ssd + ../../../../common/pc/ssd ]; services.udev.extraRules = builtins.concatStringsSep "\n" ( diff --git a/xiaomi/redmibook/16-pro-2024/default.nix b/xiaomi/redmibook/16-pro-2024/default.nix index ab76680a..35fe687d 100644 --- a/xiaomi/redmibook/16-pro-2024/default.nix +++ b/xiaomi/redmibook/16-pro-2024/default.nix @@ -4,7 +4,7 @@ ../../fix-boot-quirk.nix ../../../common/cpu/intel ../../../common/pc/laptop - ../../../common/pc/laptop/ssd + ../../../common/pc/ssd ]; hardware.enableRedistributableFirmware = lib.mkDefault true; From 33d083f55bab2d3ce5b02666630860038e9867fb Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 13 Mar 2025 11:53:24 +0000 Subject: [PATCH 082/134] feat(nvidia-prime): automatic battery-saver specialisation This enables a boot option that switches off NVIDIA GPU. Allows for battery saving. @moduon MT-9339 --- common/gpu/nvidia/prime.nix | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/common/gpu/nvidia/prime.nix b/common/gpu/nvidia/prime.nix index e54f942c..cf3e7d45 100644 --- a/common/gpu/nvidia/prime.nix +++ b/common/gpu/nvidia/prime.nix @@ -3,11 +3,35 @@ { imports = [ ./. ]; - hardware.nvidia.prime = { - offload = { - enable = lib.mkOverride 990 true; - enableOffloadCmd = lib.mkIf config.hardware.nvidia.prime.offload.enable true; # Provides `nvidia-offload` command. + options = { + hardware.nvidia.primeBatterySaverSpecialisation = lib.mkEnableOption "configure a specialisation which turns on NVIDIA Prime battery saver"; + }; + + config = { + + hardware.nvidia.prime = { + offload = { + enable = lib.mkOverride 990 true; + enableOffloadCmd = lib.mkIf config.hardware.nvidia.prime.offload.enable true; # Provides `nvidia-offload` command. + }; + # Hardware should specify the bus ID for intel/nvidia devices + }; + + specialisation = lib.mkIf config.hardware.nvidia.primeBatterySaverSpecialisation { + battery-saver.configuration = { + system.nixos.tags = ["battery-saver"]; + imports = [ + # Leave only the integrated GPU enabled + ./disable.nix + ]; + hardware.nvidia = { + prime.offload.enable = lib.mkForce false; + powerManagement = { + enable = lib.mkForce false; + finegrained = lib.mkForce false; + }; + }; + }; }; - # Hardware should specify the bus ID for intel/nvidia devices }; } From 9b383cd3f4364ee37728978c8daa33e4f4b2f5f1 Mon Sep 17 00:00:00 2001 From: Or Dagmi Date: Wed, 7 May 2025 15:07:45 +0300 Subject: [PATCH 083/134] Adding gen6 support for lenovo thinkpad e14 (#1470) Co-authored-by: DiGMi --- README.md | 1 + flake.nix | 1 + lenovo/thinkpad/e14/intel/gen6/default.nix | 10 ++++++++++ 3 files changed, 12 insertions(+) create mode 100644 lenovo/thinkpad/e14/intel/gen6/default.nix diff --git a/README.md b/README.md index 6245e507..f3c411b8 100644 --- a/README.md +++ b/README.md @@ -238,6 +238,7 @@ See code for all available configurations. | [Lenovo ThinkPad A475](lenovo/thinkpad/a475) | `` | | [Lenovo ThinkPad E14 (AMD)](lenovo/thinkpad/e14/amd) | `` | | [Lenovo ThinkPad E14 (Intel)](lenovo/thinkpad/e14/intel) | `` | +| [Lenovo ThinkPad E14 (Intel - Gen 6)](lenovo/thinkpad/e14/intel/gen6) | `` | | [Lenovo ThinkPad E15 (Intel)](lenovo/thinkpad/e15/intel) | `` | | [Lenovo ThinkPad E470](lenovo/thinkpad/e470) | `` | | [Lenovo ThinkPad E495](lenovo/thinkpad/e495) | `` | diff --git a/flake.nix b/flake.nix index e48d1bd9..badd9ab7 100644 --- a/flake.nix +++ b/flake.nix @@ -181,6 +181,7 @@ lenovo-thinkpad-a475 = import ./lenovo/thinkpad/a475; lenovo-thinkpad-e14-amd = import ./lenovo/thinkpad/e14/amd; lenovo-thinkpad-e14-intel = import ./lenovo/thinkpad/e14/intel; + lenovo-thinkpad-e14-intel-gen6 = import ./lenovo/thinkpad/e14/intel/gen6; lenovo-thinkpad-e15-intel = import ./lenovo/thinkpad/e15/intel; lenovo-thinkpad-e470 = import ./lenovo/thinkpad/e470; lenovo-thinkpad-e495 = import ./lenovo/thinkpad/e495; diff --git a/lenovo/thinkpad/e14/intel/gen6/default.nix b/lenovo/thinkpad/e14/intel/gen6/default.nix new file mode 100644 index 00000000..2e4505dd --- /dev/null +++ b/lenovo/thinkpad/e14/intel/gen6/default.nix @@ -0,0 +1,10 @@ +{ lib, ... }: + +{ + imports = [ + ../../. + ../../../../../common/cpu/intel/meteor-lake + ]; + + services.throttled.enable = lib.mkDefault false; +} From aaa8e548c34cd261deb760f1641957d6926c7913 Mon Sep 17 00:00:00 2001 From: Florian Pester Date: Wed, 7 May 2025 09:10:30 +0200 Subject: [PATCH 084/134] E14-intel: add gen4 configuration --- README.md | 5 +++-- flake.nix | 1 + lenovo/thinkpad/e14/intel/gen4/default.nix | 11 +++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 lenovo/thinkpad/e14/intel/gen4/default.nix diff --git a/README.md b/README.md index f3c411b8..66108eb7 100644 --- a/README.md +++ b/README.md @@ -237,7 +237,8 @@ See code for all available configurations. | [Lenovo Legion Y530 15ICH](lenovo/legion/15ich) | `` | | [Lenovo ThinkPad A475](lenovo/thinkpad/a475) | `` | | [Lenovo ThinkPad E14 (AMD)](lenovo/thinkpad/e14/amd) | `` | -| [Lenovo ThinkPad E14 (Intel)](lenovo/thinkpad/e14/intel) | `` | +| [Lenovo ThinkPad E14 (Intel - Gen 1)](lenovo/thinkpad/e14/intel) | `` | +| [Lenovo ThinkPad E14 (Intel - Gen 4)](lenovo/thinkpad/e14/intel/gen4) | `` | | [Lenovo ThinkPad E14 (Intel - Gen 6)](lenovo/thinkpad/e14/intel/gen6) | `` | | [Lenovo ThinkPad E15 (Intel)](lenovo/thinkpad/e15/intel) | `` | | [Lenovo ThinkPad E470](lenovo/thinkpad/e470) | `` | @@ -258,7 +259,7 @@ See code for all available configurations. | [Lenovo ThinkPad P16s AMD Gen 2](lenovo/thinkpad/p16s/amd/gen2) | `` | | [Lenovo ThinkPad P16s Intel Gen 2](lenovo/thinkpad/p16s/intel/gen2) | `` | | [Lenovo ThinkPad P1](lenovo/thinkpad/p1) | `` | -| [Lenovo ThinkPad P43s](lenovo/thinkpad/p43s) | `` | +| [Lenovo ThinkPad P43s](lenovo/thinkpad/p43s) | `` | | [Lenovo ThinkPad P50](lenovo/thinkpad/p50) | `` | | [Lenovo ThinkPad P51](lenovo/thinkpad/p51) | `` | | [Lenovo ThinkPad P52](lenovo/thinkpad/p52) | `` | diff --git a/flake.nix b/flake.nix index badd9ab7..8a93ad4c 100644 --- a/flake.nix +++ b/flake.nix @@ -181,6 +181,7 @@ lenovo-thinkpad-a475 = import ./lenovo/thinkpad/a475; lenovo-thinkpad-e14-amd = import ./lenovo/thinkpad/e14/amd; lenovo-thinkpad-e14-intel = import ./lenovo/thinkpad/e14/intel; + lenovo-thinkpad-e14-intel-gen4 = import ./lenovo/thinkpad/e14/intel/gen4; lenovo-thinkpad-e14-intel-gen6 = import ./lenovo/thinkpad/e14/intel/gen6; lenovo-thinkpad-e15-intel = import ./lenovo/thinkpad/e15/intel; lenovo-thinkpad-e470 = import ./lenovo/thinkpad/e470; diff --git a/lenovo/thinkpad/e14/intel/gen4/default.nix b/lenovo/thinkpad/e14/intel/gen4/default.nix new file mode 100644 index 00000000..c79cf8bb --- /dev/null +++ b/lenovo/thinkpad/e14/intel/gen4/default.nix @@ -0,0 +1,11 @@ +{ lib, ... }: + +{ + imports = [ + ../../. + ../../../../../common/cpu/intel/alder-lake + ]; + + services.throttled.enable = lib.mkDefault false; + hardware.intelgpu.driver = "xe"; +} From c40135076deb53668394a023c0220303c0126007 Mon Sep 17 00:00:00 2001 From: Peter Bittner Date: Mon, 5 May 2025 23:42:16 +0200 Subject: [PATCH 085/134] Ensure WiFi works out-of-the-box on XPS13 Inspired by https://github.com/NixOS/nixos-hardware/blob/master/dell/inspiron/3442/default.nix --- dell/xps/13-9343/default.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/dell/xps/13-9343/default.nix b/dell/xps/13-9343/default.nix index 98e0c417..db7012b9 100644 --- a/dell/xps/13-9343/default.nix +++ b/dell/xps/13-9343/default.nix @@ -1,4 +1,4 @@ -{ lib, ... }: +{ config, lib, ... }: { imports = [ @@ -7,6 +7,14 @@ ../../../common/pc/ssd ]; - # This will save you money and possibly your life! - services.thermald.enable = lib.mkDefault true; + services = { + fwupd.enable = lib.mkDefault true; + thermald.enable = lib.mkDefault true; + }; + + boot = { + # needs to be explicitly loaded or else bluetooth/wifi won't work + kernelModules = [ "wl" ]; + extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ]; + }; } From 3c5e12673265dfb0de3d9121420c0c2153bf21e0 Mon Sep 17 00:00:00 2001 From: Peter Bittner Date: Mon, 5 May 2025 23:54:38 +0200 Subject: [PATCH 086/134] Add kvm-intel kernel module for XPS13 --- dell/xps/13-9343/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dell/xps/13-9343/default.nix b/dell/xps/13-9343/default.nix index db7012b9..9cab0427 100644 --- a/dell/xps/13-9343/default.nix +++ b/dell/xps/13-9343/default.nix @@ -14,7 +14,7 @@ boot = { # needs to be explicitly loaded or else bluetooth/wifi won't work - kernelModules = [ "wl" ]; + kernelModules = [ "kvm-intel" "wl" ]; extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ]; }; } From 0d3ca7531030e2a405e6e7f885cc07681cac6aba Mon Sep 17 00:00:00 2001 From: Michael Hess Date: Sun, 11 May 2025 15:39:42 -0400 Subject: [PATCH 087/134] add asus-rog-strix-g533zw --- README.md | 1 + asus/rog-strix/g533zw/default.nix | 17 +++++++++++++++++ flake.nix | 1 + 3 files changed, 19 insertions(+) create mode 100644 asus/rog-strix/g533zw/default.nix diff --git a/README.md b/README.md index 66108eb7..0a6abb05 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,7 @@ See code for all available configurations. | [Asus ROG Flow X13 GV302X\* (2023)](asus/flow/gv302x/amdgpu) | `` | | [Asus ROG Flow X13 GV302X\* (2023)](asus/flow/gv302x/nvidia) | `` | | [Asus ROG Strix G513IM](asus/rog-strix/g513im) | `` | +| [Asus ROG Strix G533ZW](asus/rog-strix/g533zw) | `` | | [Asus ROG Strix G713IE](asus/rog-strix/g713ie) | `` | | [Asus ROG Strix G733QS](asus/rog-strix/g733qs) | `` | | [Asus ROG Strix X570-E GAMING](asus/rog-strix/x570e) | `` | diff --git a/asus/rog-strix/g533zw/default.nix b/asus/rog-strix/g533zw/default.nix new file mode 100644 index 00000000..635ae559 --- /dev/null +++ b/asus/rog-strix/g533zw/default.nix @@ -0,0 +1,17 @@ +{ ... }: + +{ + imports = [ + ../../../common/cpu/intel + ../../../common/gpu/nvidia/prime.nix + ../../../common/gpu/nvidia/ampere + ../../../common/pc/laptop + ../../../common/pc/ssd + ../../battery.nix + ]; + + hardware.nvidia.prime = { + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:1:0:0"; + }; +} diff --git a/flake.nix b/flake.nix index 8a93ad4c..64f968ce 100644 --- a/flake.nix +++ b/flake.nix @@ -39,6 +39,7 @@ asus-flow-gv302x-nvidia = import ./asus/flow/gv302x/nvidia; asus-pro-ws-x570-ace = import ./asus/pro-ws-x570-ace; asus-rog-strix-g513im = import ./asus/rog-strix/g513im; + asus-rog-strix-g533zw = import ./asus/rog-strix/g533zw; asus-rog-strix-g713ie = import ./asus/rog-strix/g713ie; asus-rog-strix-g733qs = import ./asus/rog-strix/g733qs; asus-rog-strix-x570e = import ./asus/rog-strix/x570e; From 16023fe3d4d48a79deaa3ebd9385716ef038a211 Mon Sep 17 00:00:00 2001 From: Flameopathic Date: Sun, 11 May 2025 21:38:50 -0400 Subject: [PATCH 088/134] lenovo/yoga/7/14ILL10: init --- README.md | 1 + flake.nix | 1 + lenovo/yoga/7/14ILL10/README.md | 3 +++ lenovo/yoga/7/14ILL10/default.nix | 13 +++++++++++++ 4 files changed, 18 insertions(+) create mode 100644 lenovo/yoga/7/14ILL10/README.md create mode 100644 lenovo/yoga/7/14ILL10/default.nix diff --git a/README.md b/README.md index 66108eb7..8bea731f 100644 --- a/README.md +++ b/README.md @@ -328,6 +328,7 @@ See code for all available configurations. | [LENOVO Yoga Slim 7 Pro-X 14ARH7 82ND](lenovo/yoga/7/14ARH7/nvidia) | `` | | [Lenovo Yoga Slim 7i Pro X 14IAH7 (Integrated)](lenovo/yoga/7/14IAH7/integrated) | `` | | [Lenovo Yoga Slim 7i Pro X 14IAH7 (Hybrid)](lenovo/yoga/7/14IAH7/hybrid) | `` | +| [Lenovo Yoga Slim 7 14ILL10](lenovo/yoga/7/14ILL10) | `` | | [LENOVO Yoga 7 Slim Gen8](lenovo/yoga/7/slim/gen8) | `` | | [MSI B550-A PRO](msi/b550-a-pro) | `` | | [MSI B350 TOMAHAWK](msi/b350-tomahawk) | `` | diff --git a/flake.nix b/flake.nix index 8a93ad4c..cbf9a2de 100644 --- a/flake.nix +++ b/flake.nix @@ -275,6 +275,7 @@ lenovo-yoga-7-14ARH7-nvidia = import ./lenovo/yoga/7/14ARH7/nvidia; lenovo-yoga-7-14IAH7-integrated = import ./lenovo/yoga/7/14IAH7/integrated; lenovo-yoga-7-14IAH7-hybrid = import ./lenovo/yoga/7/14IAH7/hybrid; + lenovo-yoga-7-14ILL10 = import ./lenovo/yoga/7/14ILL10; lenovo-yoga-7-slim-gen8 = import ./lenovo/yoga/7/slim/gen8; letsnote-cf-lx4 = import ./panasonic/letsnote/cf-lx4; malibal-aon-s1-intel = import ./malibal/aon/s1; diff --git a/lenovo/yoga/7/14ILL10/README.md b/lenovo/yoga/7/14ILL10/README.md new file mode 100644 index 00000000..602dc465 --- /dev/null +++ b/lenovo/yoga/7/14ILL10/README.md @@ -0,0 +1,3 @@ +# Lenovo Slim 7 14ILL10 + +This module imports configuration for the Lunar Lake processors as well as ensuring that the Linux kernel is up to date enough for most features to be available. This does not make the device's built-in speakers or audio jack function. diff --git a/lenovo/yoga/7/14ILL10/default.nix b/lenovo/yoga/7/14ILL10/default.nix new file mode 100644 index 00000000..9c9ca25e --- /dev/null +++ b/lenovo/yoga/7/14ILL10/default.nix @@ -0,0 +1,13 @@ +{ lib, pkgs, ... }: +{ + imports = [ + ../../../../common/cpu/intel/lunar-lake + ../../../../common/pc/laptop + ../../../../common/pc/ssd + ]; + + # touchpad, wifi, and bluetooth do not work before 6.12 + config.boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.12") ( + lib.mkDefault pkgs.linuxPackages_latest + ); +} From b83e517bfc92868c6e7e216d4373ea3edb19d876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 13 May 2025 08:10:23 +0200 Subject: [PATCH 089/134] bump tests/flake.nix to 24.11 --- tests/flake.lock | 52 +++++++++++++++++++++++++----------------------- tests/flake.nix | 5 ++--- 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/tests/flake.lock b/tests/flake.lock index c0ee1775..ba2dc9ab 100644 --- a/tests/flake.lock +++ b/tests/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1736143030, - "narHash": "sha256-+hu54pAoLDEZT9pjHlqL9DNzWz0NbUn8NEAHP7PQPzU=", + "lastModified": 1743550720, + "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "b905f6fc23a9051a6e1b741e1438dbfc0634c6de", + "rev": "c621e8422220273271f52058f618c94e405bb0f5", "type": "github" }, "original": { @@ -22,11 +22,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1736232973, - "narHash": "sha256-8YT/8TMwWRRYFiLWMS98wPW50YBwYeErX7nQ7EmSaVA=", + "lastModified": 1747083103, + "narHash": "sha256-dMx20S2molwqJxbmMB4pGjNfgp5H1IOHNa1Eby6xL+0=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "3713545aca79365cba20d7873b6e51044890b4e8", + "rev": "d1d68fe8b00248caaa5b3bbe4984c12b47e0867d", "type": "github" }, "original": { @@ -37,34 +37,36 @@ }, "nixos-stable": { "locked": { - "lastModified": 1735563628, - "narHash": "sha256-OnSAY7XDSx7CtDoqNh8jwVwh4xNL/2HaJxGjryLWzX8=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "b134951a4c9f3c995fd7be05f3243f8ecd65d798", - "type": "github" + "lastModified": 1746957726, + "narHash": "sha256-k9ut1LSfHCr0AW82ttEQzXVCqmyWVA5+SHJkS5ID/Jo=", + "ref": "nixos-24.11", + "rev": "a39ed32a651fdee6842ec930761e31d1f242cb94", + "shallow": true, + "type": "git", + "url": "https://github.com/NixOS/nixpkgs" }, "original": { - "owner": "NixOS", - "ref": "nixos-24.05", - "repo": "nixpkgs", - "type": "github" + "ref": "nixos-24.11", + "shallow": true, + "type": "git", + "url": "https://github.com/NixOS/nixpkgs" } }, "nixos-unstable-small": { "locked": { - "lastModified": 1736208088, - "narHash": "sha256-2030VBfWuPLPEUrONVY/uF79EuNCztKunuKLgKkQWqM=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "42de2bcb35ccf24626325bd6114ef9d812eaeb0d", - "type": "github" + "lastModified": 1747040834, + "narHash": "sha256-iKQKoNlZmxQq+O2WfImm/jn97g5GZBVW5EZEoCTXZ3I=", + "ref": "nixos-unstable-small", + "rev": "e4f52f3ea82ddd3754b467e3fdc0d709685c9a05", + "shallow": true, + "type": "git", + "url": "https://github.com/NixOS/nixpkgs" }, "original": { - "owner": "NixOS", "ref": "nixos-unstable-small", - "repo": "nixpkgs", - "type": "github" + "shallow": true, + "type": "git", + "url": "https://github.com/NixOS/nixpkgs" } }, "root": { diff --git a/tests/flake.nix b/tests/flake.nix index 2e65b843..91de6edf 100644 --- a/tests/flake.nix +++ b/tests/flake.nix @@ -2,8 +2,8 @@ description = "Test flake for nixos-hardware"; inputs = { - nixos-unstable-small.url = "github:NixOS/nixpkgs/nixos-unstable-small"; - nixos-stable.url = "github:NixOS/nixpkgs/nixos-24.05"; + nixos-unstable-small.url = "git+https://github.com/NixOS/nixpkgs?shallow=1&ref=nixos-unstable-small"; + nixos-stable.url = "git+https://github.com/NixOS/nixpkgs?shallow=1&ref=nixos-24.11"; # override in the test nixos-hardware.url = "github:NixOS/nixos-hardware"; flake-parts.url = "github:hercules-ci/flake-parts"; @@ -23,7 +23,6 @@ system, lib, pkgs, - inputs', ... }: let From d371c70b454935c787c237550bc21debab684f30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 13 May 2025 08:11:36 +0200 Subject: [PATCH 090/134] docs/CONTRIBUTING: replace bors with mergify --- CONTRIBUTING.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 22e78dd4..63a147a7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,8 +48,6 @@ assurance is up to *you*. # For reviewers: -This repository has bors enabled for easier merging after a successfull build: +This repository has [mergify](https://mergify.com/) enabled for easier merging after a successfull build: -* `bors try` - check if the PR builds. -* `bors merge` - same as `bors try` but will also merge the PR if it builds successfully. -* https://bors.tech/documentation/ +* `@mergify queue` will add the current pull request to the merge queue and merge when all tests succeed From 91dc75a805501815969342ad1672e9b553d1f95b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 13 May 2025 08:14:17 +0200 Subject: [PATCH 091/134] fix system.stateVersion for tests --- tests/build-profile.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/build-profile.nix b/tests/build-profile.nix index 786fa8b6..36ab88b5 100644 --- a/tests/build-profile.nix +++ b/tests/build-profile.nix @@ -16,6 +16,6 @@ device = "/dev/disk/by-uuid/00000000-0000-0000-0000-000000000000"; fsType = "btrfs"; }; - system.stateVersion = lib.version; + system.stateVersion = config.system.nixos.release; }) ]).config.system.build.toplevel From 5aa1b0f04942d01cb51b4e865d2ca161ce14a818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 13 May 2025 08:21:52 +0200 Subject: [PATCH 092/134] dell-xps-15-9530-nvidia: include ada-lovelace profile --- dell/xps/15-9530/nvidia/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/dell/xps/15-9530/nvidia/default.nix b/dell/xps/15-9530/nvidia/default.nix index 257462a4..e82bada6 100644 --- a/dell/xps/15-9530/nvidia/default.nix +++ b/dell/xps/15-9530/nvidia/default.nix @@ -3,6 +3,7 @@ imports = [ ../default.nix ../../../../common/gpu/nvidia/prime.nix + ../../../../common/gpu/nvidia/ada-lovelace ]; hardware.nvidia.prime = { From ff949f78d6b04a5294ff059cf7cdce9638ea8a86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 13 May 2025 11:41:12 +0200 Subject: [PATCH 093/134] ideacentr-k330: include nvidia-fermi architecture --- common/gpu/nvidia/fermi/default.nix | 7 +++++++ lenovo/ideacentre/k330/default.nix | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 common/gpu/nvidia/fermi/default.nix diff --git a/common/gpu/nvidia/fermi/default.nix b/common/gpu/nvidia/fermi/default.nix new file mode 100644 index 00000000..0f5c47f0 --- /dev/null +++ b/common/gpu/nvidia/fermi/default.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + imports = [ ../. ]; + + # The open source driver does not support Fermi GPUs. + hardware.nvidia.open = false; +} diff --git a/lenovo/ideacentre/k330/default.nix b/lenovo/ideacentre/k330/default.nix index 381276fc..ff5cf3c4 100644 --- a/lenovo/ideacentre/k330/default.nix +++ b/lenovo/ideacentre/k330/default.nix @@ -2,7 +2,7 @@ { imports = [ ../../../common/cpu/intel - ../../../common/gpu/nvidia # 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/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 ]; @@ -14,6 +14,6 @@ # 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"); -} \ No newline at end of file +} From f139290af12744eca2a5b460ea6cfb1dceded227 Mon Sep 17 00:00:00 2001 From: Johannes Arnold Date: Tue, 13 May 2025 08:12:08 +0200 Subject: [PATCH 094/134] TUXEDO Infinitybook: Enable bluetooth by default --- tuxedo/infinitybook/default.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tuxedo/infinitybook/default.nix b/tuxedo/infinitybook/default.nix index 99f53fcd..a0f21a44 100644 --- a/tuxedo/infinitybook/default.nix +++ b/tuxedo/infinitybook/default.nix @@ -5,8 +5,12 @@ ../../common/pc/ssd ]; - # Enable TUXEDO's kernel drivers if they are available - hardware = lib.optionalAttrs (options.hardware ? tuxedo-drivers) { - tuxedo-drivers.enable = lib.mkDefault true; - }; + hardware = + lib.mkDefault { + bluetooth.enable = true; + } + # Enable TUXEDO's kernel drivers if they are available + // lib.optionalAttrs (options.hardware ? tuxedo-drivers) { + tuxedo-drivers.enable = true; + }; } From 45da8c8ad8f77302ab3cbbcda7a113507f8ecebb Mon Sep 17 00:00:00 2001 From: "Winston R. Milling" Date: Sun, 18 May 2025 10:22:14 -0500 Subject: [PATCH 095/134] lenovo/legion/15ich: Use Coffee Lake CPU --- lenovo/legion/15ich/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lenovo/legion/15ich/default.nix b/lenovo/legion/15ich/default.nix index 630e1378..881e7bce 100644 --- a/lenovo/legion/15ich/default.nix +++ b/lenovo/legion/15ich/default.nix @@ -2,7 +2,7 @@ { imports = [ - ../../../common/cpu/intel + ../../../common/cpu/intel/coffee-lake ../../../common/gpu/nvidia/prime.nix ../../../common/gpu/nvidia/pascal ../../../common/pc/laptop From 687c8fcf681371df084ad98b6211b928163b7394 Mon Sep 17 00:00:00 2001 From: Peter Bittner Date: Mon, 19 May 2025 13:54:40 +0200 Subject: [PATCH 096/134] X1 Yoga: Enable fingerprint reader and FW update --- lenovo/thinkpad/x1/yoga/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lenovo/thinkpad/x1/yoga/default.nix b/lenovo/thinkpad/x1/yoga/default.nix index dfabfd41..2b13440f 100644 --- a/lenovo/thinkpad/x1/yoga/default.nix +++ b/lenovo/thinkpad/x1/yoga/default.nix @@ -4,5 +4,9 @@ ../../yoga.nix ]; - services.xserver.wacom.enable = lib.mkDefault config.services.xserver.enable; + services = { + fprintd.enable = lib.mkDefault true; + fwupd.enable = lib.mkDefault true; + xserver.wacom.enable = lib.mkDefault config.services.xserver.enable; + }; } From a9a7323a067284b5546beef7221ce49a1f3b8d24 Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Mon, 19 May 2025 22:20:12 +0800 Subject: [PATCH 097/134] framework: Add framework12 Signed-off-by: Daniel Schaefer --- README.md | 1 + flake.nix | 1 + framework/12-inch/13th-gen-intel/README.md | 17 +++++++++++++++++ framework/12-inch/13th-gen-intel/default.nix | 7 +++++++ framework/12-inch/common/default.nix | 19 +++++++++++++++++++ 5 files changed, 45 insertions(+) create mode 100644 framework/12-inch/13th-gen-intel/README.md create mode 100644 framework/12-inch/13th-gen-intel/default.nix create mode 100644 framework/12-inch/common/default.nix diff --git a/README.md b/README.md index cbc8896d..d3522b00 100644 --- a/README.md +++ b/README.md @@ -185,6 +185,7 @@ See code for all available configurations. | [Framework Intel Core Ultra Series 1](framework/13-inch/intel-core-ultra-series1) | `` | | [Framework 13 AMD Ryzen 7040 Series](framework/13-inch/7040-amd) | `` | | [Framework 13 AMD AI 300 Series](framework/13-inch/amd-ai-300-series) | `` | +| [Framework 12 13th Gen Intel Core](framework/12-inch/13th-gen-intel) | `` | | [Framework 16 AMD Ryzen 7040 Series](framework/16-inch/7040-amd) | `` | | [FriendlyARM NanoPC-T4](friendlyarm/nanopc-t4) | `` | | [FriendlyARM NanoPi R5s](friendlyarm/nanopi-r5s) | `` | diff --git a/flake.nix b/flake.nix index 9d3dacb2..5f93fd25 100644 --- a/flake.nix +++ b/flake.nix @@ -124,6 +124,7 @@ framework-11th-gen-intel = import ./framework/13-inch/11th-gen-intel; framework-12th-gen-intel = import ./framework/13-inch/12th-gen-intel; framework-13th-gen-intel = import ./framework/13-inch/13th-gen-intel; + framework-12-13th-gen-intel = import ./framework/12-inch/13th-gen-intel; framework-intel-core-ultra-series1 = import ./framework/13-inch/intel-core-ultra-series1; framework-13-7040-amd = import ./framework/13-inch/7040-amd; framework-amd-ai-300-series = import ./framework/13-inch/amd-ai-300-series; diff --git a/framework/12-inch/13th-gen-intel/README.md b/framework/12-inch/13th-gen-intel/README.md new file mode 100644 index 00000000..6d35825f --- /dev/null +++ b/framework/12-inch/13th-gen-intel/README.md @@ -0,0 +1,17 @@ +# [Framework Laptop 12](https://frame.work/laptop12) + +## Updating Firmware + +First put enable `fwupd` + +```nix +services.fwupd.enable = true; +``` + +Then run + +```sh + $ fwupdmgr update +``` + +- [Latest Update](https://fwupd.org/lvfs/devices/work.frame.Laptop12.RPL.BIOS.firmware) diff --git a/framework/12-inch/13th-gen-intel/default.nix b/framework/12-inch/13th-gen-intel/default.nix new file mode 100644 index 00000000..6431338a --- /dev/null +++ b/framework/12-inch/13th-gen-intel/default.nix @@ -0,0 +1,7 @@ +{ config, lib, ... }: +{ + imports = [ + ../common + ../../../common/cpu/intel + ]; +} diff --git a/framework/12-inch/common/default.nix b/framework/12-inch/common/default.nix new file mode 100644 index 00000000..88195ea6 --- /dev/null +++ b/framework/12-inch/common/default.nix @@ -0,0 +1,19 @@ +{ lib, config, ... }: +{ + imports = [ + ../../../common/pc/laptop + ../../../common/pc/ssd + ../../bluetooth.nix + ../../kmod.nix + ../../framework-tool.nix + ]; + + # Fix TRRS headphones missing a mic + # https://github.com/torvalds/linux/commit/7b509910b3ad6d7aacead24c8744de10daf8715d + boot.extraModprobeConfig = lib.mkIf (lib.versionOlder config.boot.kernelPackages.kernel.version "6.13.0") '' + options snd-hda-intel model=dell-headset-multi + ''; + + # Needed for desktop environments to detect display orientation + hardware.sensor.iio.enable = lib.mkDefault true; +} From ee94f43c05e80c7a7e5d94ec78426f2bc92a63dd Mon Sep 17 00:00:00 2001 From: Bu Kun <65808665+pokon548@users.noreply.github.com> Date: Sun, 18 May 2025 17:23:47 +0800 Subject: [PATCH 098/134] Add Lenovo Ideapad 5 Pro 14IMH9 / XiaoXin Pro 14IMH9 2024 --- README.md | 2 + flake.nix | 1 + lenovo/ideapad/14imh9/README.md | 16 +++++ lenovo/ideapad/14imh9/default.nix | 110 ++++++++++++++++++++++++++++++ 4 files changed, 129 insertions(+) create mode 100644 lenovo/ideapad/14imh9/README.md create mode 100644 lenovo/ideapad/14imh9/default.nix diff --git a/README.md b/README.md index cbc8896d..a329894f 100644 --- a/README.md +++ b/README.md @@ -215,6 +215,7 @@ See code for all available configurations. | [Lenovo IdeaPad 3 15alc6](lenovo/ideapad/15alc6) | `` | | [Lenovo IdeaPad Gaming 3 15arh05](lenovo/ideapad/15arh05) | `` | | [Lenovo IdeaPad Gaming 3 15ach6](lenovo/ideapad/15ach6) | `` | +| [Lenovo IdeaPad 5 Pro 14imh9](lenovo/ideapad/14imh9) | `` | | [Lenovo IdeaPad 5 Pro 16ach6](lenovo/ideapad/16ach6) | `` | | [Lenovo IdeaPad Z510](lenovo/ideapad/z510) | `` | | [Lenovo IdeaPad Slim 5](lenovo/ideapad/slim-5) | `` | @@ -324,6 +325,7 @@ See code for all available configurations. | [Lenovo ThinkPad Z Series](lenovo/thinkpad/z) | `` | | [Lenovo ThinkPad Z13 Gen 1](lenovo/thinkpad/z/gen1/z13) | `` | | [Lenovo ThinkPad Z13 Gen 2](lenovo/thinkpad/z/gen2/z13) | `` | +| [Lenovo XiaoXin Pro 14imh9 2024](lenovo/ideapad/14imh9) | `` | | [LENOVO Yoga 6 13ALC6 82ND](lenovo/yoga/6/13ALC6) | `` | | [LENOVO Yoga Slim 7 Pro-X 14ARH7 82ND](lenovo/yoga/7/14ARH7/amdgpu) | `` | | [LENOVO Yoga Slim 7 Pro-X 14ARH7 82ND](lenovo/yoga/7/14ARH7/nvidia) | `` | diff --git a/flake.nix b/flake.nix index 9d3dacb2..a091503f 100644 --- a/flake.nix +++ b/flake.nix @@ -153,6 +153,7 @@ hp-notebook-14-df0023 = import ./hp/notebook/14-df0023; intel-nuc-8i7beh = import ./intel/nuc/8i7beh; lenovo-ideacentre-k330 = import ./lenovo/ideacentre/k330; + lenovo-ideapad-14imh9 = import ./lenovo/ideapad/14imh9; lenovo-ideapad-15alc6 = import ./lenovo/ideapad/15alc6; lenovo-ideapad-15arh05 = import ./lenovo/ideapad/15arh05; lenovo-ideapad-15ach6 = import ./lenovo/ideapad/15ach6; diff --git a/lenovo/ideapad/14imh9/README.md b/lenovo/ideapad/14imh9/README.md new file mode 100644 index 00000000..f3950701 --- /dev/null +++ b/lenovo/ideapad/14imh9/README.md @@ -0,0 +1,16 @@ +# Lenovo Ideapad 5 Pro 14IMH9 / XiaoXin Pro 14IMH9 2024 + +These devices support Conservation mode which charges the battery to 79/80%. See [TLP docs](https://linrunner.de/tlp/settings/bc-vendors.html#lenovo-non-thinkpad-series) and [auto-cpu freq](https://github.com/AdnanHodzic/auto-cpufreq?tab=readme-ov-file#battery-charging-thresholds) to enable it. + +`lspci`: +``` +00:02.0 VGA compatible controller: Intel Corporation Meteor Lake-P [Intel Arc Graphics] (rev 08) +``` +There is no dedicated graphics card. See specs [here](https://psref.lenovo.com/syspool/Sys/PDF/IdeaPad/IdeaPad_Pro_5_14IMH9/IdeaPad_Pro_5_14IMH9_Spec.pdf). + +## Extra Configuration +### Bluetooth +To enable bluetooth support, set `hardware.bluetooth.enable = true;`. + +### Sound +This laptop need extra firmware for hi-quality sound. To enable that, set `hardware.firmware = [ pkgs.sof-firmware ];`. \ No newline at end of file diff --git a/lenovo/ideapad/14imh9/default.nix b/lenovo/ideapad/14imh9/default.nix new file mode 100644 index 00000000..f2bb0f52 --- /dev/null +++ b/lenovo/ideapad/14imh9/default.nix @@ -0,0 +1,110 @@ +{ lib, pkgs, ... }: + +{ + imports = [ + ../../../common/cpu/intel/meteor-lake + ../../../common/pc/laptop + ../../../common/pc/ssd + ]; + + boot = { + # Workaround: Out of the box, resuming from hibernation will break sounds. + # See https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/766 + extraModprobeConfig = '' + options snd-hda-intel model=generic + options snd-hda-intel snd-intel-dspcfg.dsp_driver=1 + blacklist snd_soc_skl + ''; + + kernelParams = [ + # Workaround: i915 0000:00:02.0: [drm] *ERROR* Atomic update failure on pipe A + # See https://www.dedoimedo.com/computers/intel-microcode-atomic-update.html + "i915.enable_psr=0" + + # Workaround: Seems like guc on VT-d is faulty and may also cause GUC: TLB invalidation response timed out. + # It will cause random gpu resets under hw video decoding. + # See https://wiki.archlinux.org/title/Dell_XPS_16_(9640)#Random_freezes + "iommu.strict=1" + "iommu.passthrough=1" + ]; + }; + + environment.variables = { + # Workaround: GPU HANG: ecode 12:1:85dffdfb, in CanvasRenderer [4408] + # See https://gitlab.freedesktop.org/mesa/mesa/-/issues/7755 + INTEL_DEBUG = "no32"; + }; + + systemd = { + # Workaround: Sometimes xhci driver will become malfunctional after resuming from hibernate / suspend. + # This will cause (almost) all external devices stop working. + # A simple reset is enough to bring external devices alive :) + # + # Note: to avoid unnecessary resets, we firstly check if integrated camera is presented + # (Should always be there as it was built into machine!). + # If not, just do the reset. + services.workaround-reset-xhci-driver-after-resume-if-needed = { + script = '' + result=$(${pkgs.usbutils}/bin/lsusb | ${pkgs.gnugrep}/bin/grep Chicony) + if [[ -z $result ]]; then + ${pkgs.kmod}/bin/rmmod xhci_pci xhci_hcd + ${pkgs.kmod}/bin/modprobe xhci_pci xhci_hcd + fi + ''; + after = [ + "suspend.target" + "hibernate.target" + "hybrid-sleep.target" + ]; + wantedBy = [ + "suspend.target" + "hibernate.target" + "hybrid-sleep.target" + "multi-user.target" + ]; + }; + + # Workaround: Lenovo seems write bad acpi power management firmware. Without this config, + # suspend (to ram / disk) will simply reboot instead of power off. :( + sleep.extraConfig = '' + HibernateMode=shutdown + ''; + }; + + # TPM2 module + security.tpm2.enable = lib.mkDefault true; + + hardware = { + enableRedistributableFirmware = lib.mkDefault true; # WiFi + + # Workaround: Lenovo wrote bad screen edid firmware that will cause system + # not able to use 120Hz screen fresh rate. + # Manually patch it with correct value fixes this problem. + # + # TODO: This laptop actually support VRR (Variable refresh rate). + # But I do not have any interests in supporting this. + # PR is welecomed :) + display = { + edid.packages = [ + (pkgs.runCommand "edid-14imh9" { } '' + mkdir -p "$out/lib/firmware/edid" + base64 -d > "$out/lib/firmware/edid/14imh9.bin" <<'EOF' + AP///////wAObxYUAAAAAAAgAQS1HhN4AyEVqFNJnCUPUFQAAAABAQEBAQEBAQEBAQEBAQEBzodAoLAIanAwIDYALbwQAAAYAAAA/QAoeOXlRgEKICAgICAgAAAA/gBDU09UIFQzCiAgICAgAAAA/gBNTkUwMDdaQTEtNQogAa9wE3kAAAMBFJoPAQU/C58ALwAfAAcHaQACAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD4kA== + EOF + '') + ]; + + outputs = { + "eDP-1".edid = "14imh9.bin"; + }; + }; + + i2c.enable = lib.mkDefault true; # Touchpad + }; + + services = { + fwupd.enable = lib.mkDefault true; # Firmware Upgrades. Partially supported. + hardware.bolt.enable = lib.mkDefault true; # Thunderbolt + thermald.enable = lib.mkDefault true; # This will save you money and possibly your life! + }; +} From 4165eb0f7983e0e0aad9b71b5a6aa2bc5389d28c Mon Sep 17 00:00:00 2001 From: spaceoden <26421479+spaceoden@users.noreply.github.com> Date: Wed, 21 May 2025 11:18:34 -0400 Subject: [PATCH 099/134] fix typo in framework audio.nix --- framework/13-inch/common/audio.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/13-inch/common/audio.nix b/framework/13-inch/common/audio.nix index b6aa6d65..8133ab88 100644 --- a/framework/13-inch/common/audio.nix +++ b/framework/13-inch/common/audio.nix @@ -14,7 +14,7 @@ in This option requires PipeWire and WirePlumber. The filter chain includes the following: - - Pyschoacoustic bass enhancement + - Psychoacoustic bass enhancement - Loudness compensation - Equalizer - Slight compression From 03107726cd65509db5dead83b1599e90efa9e0ed Mon Sep 17 00:00:00 2001 From: Danny Freeman Date: Wed, 21 May 2025 22:23:41 -0400 Subject: [PATCH 100/134] Change libusb to libusb1 in pinebook keyboard updater This error is shown after updating to nixos 24.11 > error: 'libusb' has been renamed to/replaced by 'libusb1' --- pine64/pinebook-pro/keyboard-updater/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pine64/pinebook-pro/keyboard-updater/default.nix b/pine64/pinebook-pro/keyboard-updater/default.nix index 3f3cf712..3138277f 100644 --- a/pine64/pinebook-pro/keyboard-updater/default.nix +++ b/pine64/pinebook-pro/keyboard-updater/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, xxd, libusb }: +{ stdenv, fetchFromGitHub, xxd, libusb1 }: stdenv.mkDerivation { pname = "pinebook-pro-keyboard-updater"; @@ -9,7 +9,7 @@ stdenv.mkDerivation { ]; buildInputs = [ - libusb + libusb1 ]; installPhase = '' From 4ce6bba2f7c0d13b930685068e964dfd9f542fe1 Mon Sep 17 00:00:00 2001 From: Ganga Ram Date: Wed, 21 May 2025 16:51:52 +0400 Subject: [PATCH 101/134] Update correct hash for imx mkimage utility - Don't fetch dotGit directory. - Dot git dir gets different object packs when it is pulled from different nixpkgs versions which causes hash mismatch. - Patch Makefile not use git revision from .git. Signed-off-by: Ganga Ram --- nxp/imx8mp-evk/bsp/imx8mp-boot.nix | 15 +++++++++------ nxp/imx8mq-evk/bsp/imx8mq-boot.nix | 15 +++++++++------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/nxp/imx8mp-evk/bsp/imx8mp-boot.nix b/nxp/imx8mp-evk/bsp/imx8mp-boot.nix index c078f9ca..b7fec803 100644 --- a/nxp/imx8mp-evk/bsp/imx8mp-boot.nix +++ b/nxp/imx8mp-evk/bsp/imx8mp-boot.nix @@ -15,18 +15,21 @@ with pkgs; let imx8mp-firmware = pkgs.callPackage ./imx8mp-firmware.nix {}; imx8mp-uboot = pkgs.callPackage ./imx8mp-uboot.nix {}; imx8mp-optee-os = pkgs.callPackage ./imx8mp-optee-os.nix {}; + src = pkgs.fetchgit { + url = "https://github.com/nxp-imx/imx-mkimage.git"; + rev = "c4365450fb115d87f245df2864fee1604d97c06a"; + sha256 = "sha256-KVIVHwBpAwd1RKy3RrYxGIniE45CDlN5RQTXsMg1Jwk="; + }; + shortRev = builtins.substring 0 8 src.rev; in { imx8m-boot = pkgs.stdenv.mkDerivation rec { + inherit src; name = "imx8mp-mkimage"; version = "lf-6.1.55-2.2.0"; - src = pkgs.fetchgit { - url = "https://github.com/nxp-imx/imx-mkimage.git"; - rev = "c4365450fb115d87f245df2864fee1604d97c06a"; - sha256 = "sha256-xycEaWKVM63BlDyBKNN0OefyK6iX/fQOTvv4fRVM55U="; - leaveDotGit = true; - }; postPatch = '' + substituteInPlace Makefile \ + --replace 'git rev-parse --short=8 HEAD' 'echo ${shortRev}' substituteInPlace Makefile \ --replace 'CC = gcc' 'CC = clang' patchShebangs scripts diff --git a/nxp/imx8mq-evk/bsp/imx8mq-boot.nix b/nxp/imx8mq-evk/bsp/imx8mq-boot.nix index f0e53d49..2b5c246d 100644 --- a/nxp/imx8mq-evk/bsp/imx8mq-boot.nix +++ b/nxp/imx8mq-evk/bsp/imx8mq-boot.nix @@ -14,18 +14,21 @@ with pkgs; let imx8mq-firmware = pkgs.callPackage ./imx8mq-firmware.nix {}; imx8mq-uboot = pkgs.callPackage ./imx8mq-uboot.nix {}; imx8mq-optee-os = pkgs.callPackage ./imx8mq-optee-os.nix {}; + src = pkgs.fetchgit { + url = "https://github.com/nxp-imx/imx-mkimage.git"; + rev = "c4365450fb115d87f245df2864fee1604d97c06a"; + sha256 = "sha256-KVIVHwBpAwd1RKy3RrYxGIniE45CDlN5RQTXsMg1Jwk="; + }; + shortRev = builtins.substring 0 8 src.rev; in { imx8m-boot = pkgs.stdenv.mkDerivation rec { + inherit src; name = "imx8mq-mkimage"; version = "lf-6.1.55-2.2.0"; - src = pkgs.fetchgit { - url = "https://github.com/nxp-imx/imx-mkimage.git"; - rev = "c4365450fb115d87f245df2864fee1604d97c06a"; - sha256 = "sha256-xycEaWKVM63BlDyBKNN0OefyK6iX/fQOTvv4fRVM55U="; - leaveDotGit = true; - }; postPatch = '' + substituteInPlace Makefile \ + --replace 'git rev-parse --short=8 HEAD' 'echo ${shortRev}' substituteInPlace Makefile \ --replace 'CC = gcc' 'CC = clang' patchShebangs scripts From 50c1d00e9def0ca0b483459dc2f1e403158eabb1 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 28 May 2025 20:32:58 -0400 Subject: [PATCH 102/134] add optional config that makes lgpio and pigpio work --- raspberry-pi/4/default.nix | 1 + raspberry-pi/4/gpio.nix | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 raspberry-pi/4/gpio.nix diff --git a/raspberry-pi/4/default.nix b/raspberry-pi/4/default.nix index ca2c7a89..150a66b9 100644 --- a/raspberry-pi/4/default.nix +++ b/raspberry-pi/4/default.nix @@ -8,6 +8,7 @@ ./cpu-revision.nix ./digi-amp-plus.nix ./dwc2.nix + ./gpio.nix ./i2c.nix ./leds.nix ./modesetting.nix diff --git a/raspberry-pi/4/gpio.nix b/raspberry-pi/4/gpio.nix new file mode 100644 index 00000000..23c7bdae --- /dev/null +++ b/raspberry-pi/4/gpio.nix @@ -0,0 +1,36 @@ +{ pkgs, lib, config, ... }: +{ + options.hardware.raspberry-pi."4".gpio = { + enable = lib.mkOption { + type = lib.types.bool; + description = + "Enable udev rules and kernelParams that make lgpio and pigpio work"; + default = false; + }; + }; + config = let + cfg = config.hardware.raspberry-pi."4".gpio; + in + lib.mkIf cfg.enable { + users.groups.gpio = lib.mkDefault { }; + + # the bit that matters to lgpio here is + # "${pkgs.coreutils}/bin/chgrp gpio /dev/%k && chmod 660 /dev/%k" + # see https://github.com/NixOS/nixpkgs/pull/352308 + + # sudo udevadm test --action=add /dev/gpiochip0 to test + + # import lgpio; lgpio.gpiochip_open(0) should show "1" and not raise + # an exception + + services.udev.extraRules = lib.mkBefore '' + KERNEL=="gpiomem", GROUP="gpio", MODE="0660" + SUBSYSTEM=="gpio", KERNEL=="gpiochip*", ACTION=="add", PROGRAM="${pkgs.bash}/bin/bash -c '${pkgs.coreutils}/bin/chgrp gpio /dev/%k && chmod 660 /dev/%k && ${pkgs.coreutils}/bin/chgrp -R gpio /sys/class/gpio && ${pkgs.coreutils}/bin/chmod -R g=u /sys/class/gpio'" + SUBSYSTEM=="gpio", ACTION=="add", PROGRAM="${pkgs.bash}/bin/bash -c '${pkgs.coreutils}/bin/chgrp -R gpio /sys%p && ${pkgs.coreutils}/bin/chmod -R g=u /sys%p'" + ''; + + boot.kernelParams = [ + "iomem=relaxed" # for pigpiod + ]; + }; +} From 0985f253857967e0e5ea0f147672742a117c9ca0 Mon Sep 17 00:00:00 2001 From: Ralf Gueldemeister <410488+rgueldem@users.noreply.github.com> Date: Wed, 9 Apr 2025 19:37:17 -0600 Subject: [PATCH 103/134] Add Lenovo Thinkpad X1 13th Gen --- README.md | 1 + flake.nix | 1 + lenovo/thinkpad/x1/13th-gen/default.nix | 12 ++++++++++++ 3 files changed, 14 insertions(+) create mode 100644 lenovo/thinkpad/x1/13th-gen/default.nix diff --git a/README.md b/README.md index 1bf859ab..8d6bcf95 100644 --- a/README.md +++ b/README.md @@ -305,6 +305,7 @@ See code for all available configurations. | [Lenovo ThinkPad X1 (10th Gen)](lenovo/thinkpad/x1/10th-gen) | `` | | [Lenovo ThinkPad X1 (11th Gen)](lenovo/thinkpad/x1/11th-gen) | `` | | [Lenovo ThinkPad X1 (12th Gen)](lenovo/thinkpad/x1/12th-gen) | `` | +| [Lenovo ThinkPad X1 (13th Gen)](lenovo/thinkpad/x1/13th-gen) | `` | | [Lenovo ThinkPad X1 Extreme Gen 2](lenovo/thinkpad/x1-extreme/gen2) | `` | | [Lenovo ThinkPad X1 Extreme Gen 3](lenovo/thinkpad/x1-extreme/gen3) | `` | | [Lenovo ThinkPad X1 Extreme Gen 4](lenovo/thinkpad/x1-extreme/gen4) | `` | diff --git a/flake.nix b/flake.nix index 048a59b7..915d9a78 100644 --- a/flake.nix +++ b/flake.nix @@ -249,6 +249,7 @@ lenovo-thinkpad-x1-10th-gen = import ./lenovo/thinkpad/x1/10th-gen; lenovo-thinkpad-x1-11th-gen = import ./lenovo/thinkpad/x1/11th-gen; lenovo-thinkpad-x1-12th-gen = import ./lenovo/thinkpad/x1/12th-gen; + lenovo-thinkpad-x1-13th-gen = import ./lenovo/thinkpad/x1/13th-gen; lenovo-thinkpad-x1-extreme = import ./lenovo/thinkpad/x1-extreme; lenovo-thinkpad-x1-extreme-gen2 = import ./lenovo/thinkpad/x1-extreme/gen2; lenovo-thinkpad-x1-extreme-gen3 = import ./lenovo/thinkpad/x1-extreme/gen3; diff --git a/lenovo/thinkpad/x1/13th-gen/default.nix b/lenovo/thinkpad/x1/13th-gen/default.nix new file mode 100644 index 00000000..399ea64a --- /dev/null +++ b/lenovo/thinkpad/x1/13th-gen/default.nix @@ -0,0 +1,12 @@ +{lib, ...}: + +{ + imports = [ + ../../../../common/pc/ssd + ../../../../common/cpu/intel/lunar-lake + ]; + + hardware.trackpoint.device = "TPPS/2 Synaptics TrackPoint"; + + services.thermald.enable = lib.mkDefault true; +} From 773b49122afe05a89748f71cff1250e8800e481c Mon Sep 17 00:00:00 2001 From: Keanu Kerr Date: Sun, 1 Jun 2025 07:04:26 -0400 Subject: [PATCH 104/134] Added config file for Lenovo Thinkpad P14s AMD Gen 5 --- README.md | 1 + flake.nix | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 8d6bcf95..8f2c54a3 100644 --- a/README.md +++ b/README.md @@ -256,6 +256,7 @@ See code for all available configurations. | [Lenovo ThinkPad P14s AMD Gen 2](lenovo/thinkpad/p14s/amd/gen2) | `` | | [Lenovo ThinkPad P14s AMD Gen 3](lenovo/thinkpad/p14s/amd/gen3) | `` | | [Lenovo ThinkPad P14s AMD Gen 4](lenovo/thinkpad/p14s/amd/gen4) | `` | +| [Lenovo ThinkPad P14s AMD Gen 5](lenovo/thinkpad/p14s/amd/gen5) | `` | | [Lenovo ThinkPad P14s Intel Gen 3](lenovo/thinkpad/p14s/intel/gen3) | `` | | [Lenovo ThinkPad P14s Intel Gen 5](lenovo/thinkpad/p14s/intel/gen5) | `` | | [Lenovo ThinkPad P16s AMD Gen 1](lenovo/thinkpad/p16s/amd/gen1) | `` | diff --git a/flake.nix b/flake.nix index 915d9a78..f7481983 100644 --- a/flake.nix +++ b/flake.nix @@ -200,6 +200,7 @@ lenovo-thinkpad-p14s-amd-gen2 = import ./lenovo/thinkpad/p14s/amd/gen2; lenovo-thinkpad-p14s-amd-gen3 = import ./lenovo/thinkpad/p14s/amd/gen3; lenovo-thinkpad-p14s-amd-gen4 = import ./lenovo/thinkpad/p14s/amd/gen4; + lenovo-thinkpad-p14s-amd-gen5 = import ./lenovo/thinkpad/p14s/amd/gen5; lenovo-thinkpad-p14s-intel-gen3 = import ./lenovo/thinkpad/p14s/intel/gen3; lenovo-thinkpad-p14s-intel-gen5 = import ./lenovo/thinkpad/p14s/intel/gen5; lenovo-thinkpad-p16s-amd-gen1 = import ./lenovo/thinkpad/p16s/amd/gen1; From e9dcc95a38974bcc05718a08a3a1c1629b0b35c3 Mon Sep 17 00:00:00 2001 From: Keanu Kerr Date: Sun, 1 Jun 2025 07:05:03 -0400 Subject: [PATCH 105/134] Add config file --- lenovo/thinkpad/p14s/amd/gen5/default.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 lenovo/thinkpad/p14s/amd/gen5/default.nix diff --git a/lenovo/thinkpad/p14s/amd/gen5/default.nix b/lenovo/thinkpad/p14s/amd/gen5/default.nix new file mode 100644 index 00000000..f70dde41 --- /dev/null +++ b/lenovo/thinkpad/p14s/amd/gen5/default.nix @@ -0,0 +1,12 @@ +{ lib, pkgs, ... }: + +{ + imports = [ + ../. + ../../../../../common/cpu/amd/pstate.nix + ]; + + # For the Qualcomm NFA-725A (Device 1103) wireless network controller + # See https://bugzilla.redhat.com/show_bug.cgi?id=2047878 + boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.16") pkgs.linuxPackages_latest; +} From 938f82a4a9829b08beba62cfac32b7ad0b8e62da Mon Sep 17 00:00:00 2001 From: Malix Date: Tue, 3 Jun 2025 17:16:00 +0200 Subject: [PATCH 106/134] remove confusing acronym --- lenovo/legion/15ach6h/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lenovo/legion/15ach6h/README.md b/lenovo/legion/15ach6h/README.md index 19f6c247..63f4e97f 100644 --- a/lenovo/legion/15ach6h/README.md +++ b/lenovo/legion/15ach6h/README.md @@ -1,7 +1,7 @@ ## Introduction -Due to the introduction of DDG feature, you may toggle DDG frequently, so for the default settings of this laptop, we use "specialization" feature of Nix so that you can easily select the required graphics card driver in the startup menu. +Due to the introduction of Dual-Direct-GFX-Mode feature, you may toggle Dual-Direct-GFX-Mode frequently, so for the default settings of this laptop, we use "specialization" feature of Nix so that you can easily select the required graphics card driver in the startup menu. **But It will slow down NixOS evaluation by factor 2 and increase memory usage.** -So if you don't need specialization feature, you can just use hybrid only configuration or nvidia only (DDG only) configuration +So if you don't need specialization feature, you can just use hybrid only configuration or nvidia only (Dual-Direct-GFX-Mode only) configuration ## Using multiple drives with this configuration @@ -27,4 +27,4 @@ $ nix-info -m ... 06:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Cezanne (rev c5) ... -``` \ No newline at end of file +``` From 51e51e601448705c0d2f92ef90ec7b680123077c Mon Sep 17 00:00:00 2001 From: Andre Date: Wed, 4 Jun 2025 12:11:03 -0400 Subject: [PATCH 107/134] chore: format repo using treefmt-nix and nixfmt-rfc-style --- airis/n990/default.nix | 6 +- apple/default.nix | 3 +- apple/imac/18-2/default.nix | 10 +- apple/macbook-air/3/default.nix | 2 +- apple/macbook-air/7/default.nix | 7 +- apple/macbook-pro/11-5/default.nix | 3 +- apple/macbook-pro/12-1/default.nix | 9 +- apple/macbook-pro/14-1/default.nix | 10 +- apple/macbook-pro/8-1/default.nix | 7 +- apple/t2/default.nix | 17 +- asus/ally/rc71l/default.nix | 4 +- asus/battery.nix | 17 +- asus/fa507nv/default.nix | 7 +- asus/fa507rm/default.nix | 24 +- asus/flow/gv302x/amdgpu/default.nix | 18 +- asus/flow/gv302x/nvidia/default.nix | 10 +- asus/flow/gv302x/shared.nix | 33 +- asus/fx504gd/default.nix | 2 +- asus/fx506hm/default.nix | 11 +- asus/rog-strix/g513im/default.nix | 28 +- asus/rog-strix/g533zw/default.nix | 2 +- asus/rog-strix/g713ie/default.nix | 22 +- asus/rog-strix/g733qs/default.nix | 4 +- asus/zenbook/ux481/nvidia/default.nix | 12 +- asus/zephyrus/ga402x/amdgpu/default.nix | 18 +- asus/zephyrus/ga402x/nvidia/default.nix | 6 +- asus/zephyrus/ga402x/shared.nix | 32 +- chuwi/minibook-x/default.nix | 9 +- common/cpu/amd/default.nix | 3 +- common/cpu/amd/pstate.nix | 24 +- common/gpu/24.05-compat.nix | 15 +- common/gpu/amd/sea-islands/default.nix | 5 +- common/gpu/amd/southern-islands/default.nix | 5 +- common/gpu/intel/default.nix | 12 +- common/gpu/nvidia/ada-lovelace/default.nix | 2 +- common/gpu/nvidia/ampere/default.nix | 2 +- common/gpu/nvidia/disable.nix | 9 +- common/gpu/nvidia/kepler/default.nix | 2 +- common/gpu/nvidia/maxwell/default.nix | 2 +- common/gpu/nvidia/pascal/default.nix | 2 +- common/gpu/nvidia/prime.nix | 4 +- common/gpu/nvidia/turing/default.nix | 2 +- common/pc/laptop/default.nix | 6 +- default.nix | 2 +- dell/inspiron/14-5420/default.nix | 34 +- dell/inspiron/5515/default.nix | 6 +- dell/inspiron/7405/default.nix | 5 +- dell/inspiron/7559/default.nix | 2 +- dell/latitude/5490/default.nix | 7 +- dell/precision/5490/default.nix | 4 +- dell/precision/5530/default.nix | 2 +- dell/precision/7520/default.nix | 17 +- dell/xps/13-9300/default.nix | 3 +- dell/xps/13-9310/default.nix | 8 +- dell/xps/13-9315/default.nix | 7 +- dell/xps/13-9333/default.nix | 7 +- dell/xps/13-9343/default.nix | 5 +- dell/xps/15-7590/nvidia/default.nix | 2 +- dell/xps/15-9510/default.nix | 3 +- dell/xps/15-9510/nvidia/default.nix | 8 +- dell/xps/15-9530/default.nix | 2 +- dell/xps/15-9560/default.nix | 4 +- dell/xps/15-9560/nvidia/default.nix | 1 - dell/xps/15-9570/nvidia/default.nix | 1 - dell/xps/15-9570/shared.nix | 2 +- dell/xps/17-9700/common.nix | 24 +- dell/xps/17-9710/intel/default.nix | 7 +- dell/xps/sleep-resume/bluetooth/default.nix | 10 +- .../sleep-resume/i2c-designware/default.nix | 13 +- flake.lock | 62 ++ flake.nix | 798 +++++++++--------- focus/m2/gen1/default.nix | 9 +- framework/13-inch/11th-gen-intel/default.nix | 10 +- framework/13-inch/12th-gen-intel/default.nix | 3 +- framework/13-inch/7040-amd/default.nix | 22 +- .../13-inch/amd-ai-300-series/default.nix | 10 +- framework/13-inch/common/amd.nix | 7 +- framework/13-inch/common/audio.nix | 644 +++++++------- framework/13-inch/common/intel.nix | 31 +- .../intel-core-ultra-series1/default.nix | 13 +- framework/16-inch/7040-amd/default.nix | 7 +- framework/16-inch/common/amd.nix | 7 +- framework/bluetooth.nix | 61 +- framework/framework-tool.nix | 3 +- framework/kmod.nix | 55 +- friendlyarm/nanopc-t4/default.nix | 22 +- friendlyarm/nanopi-r5s/default.nix | 5 +- gmktec/nucbox/g3-plus/default.nix | 38 +- gpd/pocket-3/default.nix | 72 +- gpd/pocket-4/default.nix | 6 +- gpd/win-2/default.nix | 10 +- gpd/win-max-2/2023/default.nix | 8 +- gpd/win-max-2/default.nix | 7 +- gpd/win-mini/default.nix | 3 - hardkernel/odroid-hc4/default.nix | 44 +- hp/elitebook/845/g7/default.nix | 19 +- hp/elitebook/845/g8/default.nix | 19 +- hp/elitebook/845/g9/default.nix | 19 +- huawei/machc-wa/default.nix | 3 +- kobol/helios4/modules/fancontrol.nix | 8 +- kobol/helios4/overlay.nix | 2 +- lenovo/ideacentre/k330/default.nix | 27 +- lenovo/legion/15ach6h/nvidia/default.nix | 14 +- lenovo/legion/16ach6h/nvidia/default.nix | 14 +- lenovo/legion/16achg6/nvidia/default.nix | 14 +- lenovo/legion/16aph8/default.nix | 20 +- lenovo/legion/16arh7h/hybrid/default.nix | 7 +- lenovo/legion/16arh7h/igpu-only/default.nix | 3 +- .../audio/lenovo-16ARHA7_speaker-fix.nix | 17 +- lenovo/legion/16arha7/default.nix | 11 +- lenovo/legion/16irx8h/default.nix | 10 +- lenovo/legion/16irx9h/default.nix | 5 +- lenovo/thinkpad/a475/default.nix | 6 +- lenovo/thinkpad/p1/3th-gen/audio.nix | 6 +- lenovo/thinkpad/p14s/amd/gen2/default.nix | 11 +- lenovo/thinkpad/p14s/amd/gen4/default.nix | 7 +- lenovo/thinkpad/p14s/default.nix | 11 +- lenovo/thinkpad/p14s/intel/gen5/default.nix | 2 +- lenovo/thinkpad/p16s/intel/gen2/default.nix | 3 +- lenovo/thinkpad/p43s/default.nix | 3 +- lenovo/thinkpad/p50/default.nix | 17 +- lenovo/thinkpad/p51/default.nix | 17 +- lenovo/thinkpad/p52/default.nix | 17 +- lenovo/thinkpad/t14/amd/gen4/default.nix | 7 +- lenovo/thinkpad/t14/amd/gen5/default.nix | 7 +- lenovo/thinkpad/t410/default.nix | 5 +- lenovo/thinkpad/t490/default.nix | 22 +- lenovo/thinkpad/t490s/default.nix | 3 +- lenovo/thinkpad/x1-nano/default.nix | 3 +- lenovo/thinkpad/x1-nano/gen1/default.nix | 26 +- lenovo/thinkpad/x1/13th-gen/default.nix | 2 +- lenovo/thinkpad/x1/9th-gen/default.nix | 6 +- lenovo/thinkpad/x1/yoga/7th-gen/default.nix | 9 +- lenovo/thinkpad/x1/yoga/default.nix | 3 +- lenovo/thinkpad/x13/amd/default.nix | 3 +- lenovo/thinkpad/x13/common.nix | 3 +- lenovo/thinkpad/x13/intel/default.nix | 3 +- lenovo/thinkpad/x13/yoga/3th-gen/default.nix | 3 +- lenovo/thinkpad/x13/yoga/default.nix | 5 +- lenovo/thinkpad/x13s/default.nix | 11 +- lenovo/thinkpad/x390/default.nix | 1 - lenovo/thinkpad/z/default.nix | 7 +- lenovo/thinkpad/z/gen1/default.nix | 7 +- lenovo/thinkpad/z/gen2/default.nix | 4 +- lenovo/yoga/7/14ARH7/nvidia/default.nix | 3 +- lenovo/yoga/7/14IAH7/hybrid/default.nix | 38 +- lenovo/yoga/7/14IAH7/integrated/default.nix | 42 +- lenovo/yoga/7/14IAH7/shared.nix | 8 +- lenovo/yoga/7/slim/gen8/default.nix | 27 +- .../common/bsp/hss-payload-generator.nix | 2 +- microchip/common/bsp/linux-icicle-kit.nix | 124 +-- microchip/common/bsp/uboot.nix | 17 +- microchip/common/modules.nix | 16 +- microchip/icicle-kit/overlay.nix | 5 +- microsoft/surface-pro/9/default.nix | 2 +- microsoft/surface/common/default.nix | 70 +- .../surface/common/kernel/6.12/patches.nix | 141 ++-- .../surface/common/kernel/6.14/patches.nix | 3 +- .../surface/common/kernel/linux-package.nix | 62 +- microsoft/surface/surface-go/default.nix | 3 +- .../firmware/ath10k/ath10k-replace.nix | 18 +- .../surface-go/firmware/ath10k/default.nix | 29 +- .../surface/surface-pro-intel/default.nix | 2 +- milkv/pioneer/default.nix | 15 +- milkv/pioneer/firmware.nix | 19 +- milkv/pioneer/linux.nix | 86 +- milkv/pioneer/linuxboot-initrd.nix | 13 +- milkv/pioneer/linuxboot-kernel.nix | 8 +- milkv/pioneer/sd-image.nix | 17 +- milkv/pioneer/zsbl.nix | 15 +- minisforum/v3/audio.nix | 2 +- minisforum/v3/sensors.nix | 4 +- morefine/m600/default.nix | 3 +- msi/b350-tomahawk/default.nix | 2 +- msi/b550-a-pro/default.nix | 2 +- nxp/common/bsp/imx-atf.nix | 15 +- nxp/common/bsp/imx-firmware.nix | 26 +- nxp/common/bsp/imx-optee-os.nix | 8 +- nxp/common/bsp/imx-uboot.nix | 32 +- nxp/common/modules.nix | 3 +- nxp/imx8mp-evk/bsp/imx8mp-atf.nix | 16 +- nxp/imx8mp-evk/bsp/imx8mp-boot.nix | 17 +- nxp/imx8mp-evk/bsp/imx8mp-firmware.nix | 30 +- nxp/imx8mp-evk/bsp/imx8mp-optee-os.nix | 109 +-- nxp/imx8mp-evk/bsp/imx8mp-uboot.nix | 147 ++-- nxp/imx8mp-evk/default.nix | 5 +- nxp/imx8mp-evk/modules.nix | 7 +- nxp/imx8mp-evk/overlay.nix | 4 +- nxp/imx8mq-evk/bsp/imx8mq-atf.nix | 16 +- nxp/imx8mq-evk/bsp/imx8mq-boot.nix | 17 +- nxp/imx8mq-evk/bsp/imx8mq-firmware.nix | 30 +- nxp/imx8mq-evk/bsp/imx8mq-linux.nix | 94 ++- nxp/imx8mq-evk/bsp/imx8mq-optee-os.nix | 109 +-- nxp/imx8mq-evk/bsp/imx8mq-uboot.nix | 147 ++-- nxp/imx8mq-evk/default.nix | 5 +- nxp/imx8mq-evk/modules.nix | 7 +- nxp/imx8mq-evk/overlay.nix | 4 +- nxp/imx8qm-mek/default.nix | 4 +- nxp/imx8qm-mek/overlay.nix | 11 +- nxp/imx8qxp-mek/overlay.nix | 11 +- olimex/teres_i/default.nix | 10 +- onenetbook/4/default.nix | 2 +- .../4/goodix-stylus-mastykin/default.nix | 52 +- .../pinebook-pro/keyboard-updater/default.nix | 7 +- pine64/star64/default.nix | 54 +- pine64/star64/firmware.nix | 15 +- pine64/star64/linux-5.15.nix | 470 ++++++----- pine64/star64/opensbi.nix | 26 +- pine64/star64/sd-image.nix | 16 +- pine64/star64/spl-tool.nix | 2 +- purism/librem/5r4/audio.nix | 58 +- purism/librem/5r4/default.nix | 16 +- purism/librem/5r4/kernel.nix | 55 +- purism/librem/5r4/librem5-base/default.nix | 8 +- purism/librem/5r4/lockdown-fix.nix | 19 +- purism/librem/5r4/u-boot/default.nix | 19 +- radxa/default.nix | 12 +- radxa/disko.nix | 13 +- radxa/rock-4c-plus/default.nix | 12 +- radxa/rock-5b/default.nix | 12 +- radxa/rock-pi-4/default.nix | 12 +- radxa/rock-pi-e/default.nix | 12 +- raspberry-pi/2/default.nix | 2 +- raspberry-pi/3/default.nix | 10 +- raspberry-pi/4/apply-overlays-dtmerge.nix | 95 ++- raspberry-pi/4/audio.nix | 16 +- raspberry-pi/4/default.nix | 8 +- raspberry-pi/4/dwc2.nix | 6 +- raspberry-pi/4/gpio.nix | 49 +- raspberry-pi/4/i2c.nix | 63 +- raspberry-pi/4/leds.nix | 86 +- raspberry-pi/4/pkgs-overlays.nix | 3 +- raspberry-pi/4/poe-hat.nix | 3 +- raspberry-pi/4/poe-plus-hat.nix | 3 +- raspberry-pi/4/pwm0.nix | 52 +- raspberry-pi/4/tv-hat.nix | 3 +- raspberry-pi/4/xhci.nix | 6 +- raspberry-pi/5/default.nix | 19 +- rockchip/default.nix | 12 +- rockchip/disko.nix | 12 +- rockchip/rk3328/default.nix | 12 +- rockchip/rk3399/default.nix | 12 +- rockchip/rk3399/disko.nix | 20 +- rockchip/rk3588/default.nix | 12 +- samsung/np900x3c/default.nix | 2 +- starfive/visionfive/v1/default.nix | 21 +- starfive/visionfive/v1/firmware.nix | 52 +- starfive/visionfive/v1/linux.nix | 64 +- starfive/visionfive/v1/sd-image.nix | 10 +- starfive/visionfive/v1/uboot.nix | 10 +- starfive/visionfive/v2/firmware.nix | 27 +- starfive/visionfive/v2/sd-image.nix | 10 +- starfive/visionfive/v2/spl-tool.nix | 2 +- starfive/visionfive/v2/uboot.nix | 5 +- supermicro/default.nix | 5 +- supermicro/x10sll-f/default.nix | 5 +- system76/darp6/default.nix | 15 +- system76/galp5-1650/default.nix | 7 +- system76/gaze18/default.nix | 7 +- tests/build-profile.nix | 31 +- tests/flake.nix | 11 +- toshiba/swanky/default.nix | 14 +- treefmt.nix | 19 + tuxedo/infinitybook/pro14/gen9/default.nix | 8 +- tuxedo/pulse/14/gen3/default.nix | 10 +- tuxedo/pulse/15/gen2/default.nix | 18 +- 266 files changed, 3721 insertions(+), 2733 deletions(-) create mode 100644 flake.lock create mode 100644 treefmt.nix diff --git a/airis/n990/default.nix b/airis/n990/default.nix index e4711419..ab450958 100644 --- a/airis/n990/default.nix +++ b/airis/n990/default.nix @@ -9,10 +9,10 @@ kernelParams = [ "apm=on" "acpi=on" - "vga=0x317" # 1024x768 + "vga=0x317" # 1024x768 "console=tty1" - "video=vesafb:ywrap" # Faster scroll - ]; + "video=vesafb:ywrap" # Faster scroll + ]; }; hardware.firmware = with pkgs; [ intel2200BGFirmware ]; diff --git a/apple/default.nix b/apple/default.nix index a2ee2623..5663cfeb 100644 --- a/apple/default.nix +++ b/apple/default.nix @@ -5,8 +5,7 @@ "hid_apple.iso_layout=0" ]; - hardware.facetimehd.enable = lib.mkDefault - (config.nixpkgs.config.allowUnfree or false); + hardware.facetimehd.enable = lib.mkDefault (config.nixpkgs.config.allowUnfree or false); services.mbpfan.enable = lib.mkDefault true; } diff --git a/apple/imac/18-2/default.nix b/apple/imac/18-2/default.nix index 9d71ba32..6849037d 100644 --- a/apple/imac/18-2/default.nix +++ b/apple/imac/18-2/default.nix @@ -3,7 +3,8 @@ lib, pkgs, ... -}: { +}: +{ imports = [ ../. ../../../common/cpu/intel/kaby-lake @@ -14,7 +15,12 @@ # apple smc (TODO: check spi) boot = { - initrd.kernelModules = ["applespi" "spi_pxa2xx_platform" "intel_lpss_pci" "applesmc" ]; + initrd.kernelModules = [ + "applespi" + "spi_pxa2xx_platform" + "intel_lpss_pci" + "applesmc" + ]; kernelParams = [ "intel_iommu=on" ]; kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.0") pkgs.linuxPackages_latest; }; diff --git a/apple/macbook-air/3/default.nix b/apple/macbook-air/3/default.nix index 9589e762..72fbdb31 100644 --- a/apple/macbook-air/3/default.nix +++ b/apple/macbook-air/3/default.nix @@ -1,7 +1,7 @@ { config, lib, ... }: { - imports = [ + imports = [ ../../. ../../../common/cpu/intel ../../../common/pc/laptop diff --git a/apple/macbook-air/7/default.nix b/apple/macbook-air/7/default.nix index f6c82282..f6dd654a 100644 --- a/apple/macbook-air/7/default.nix +++ b/apple/macbook-air/7/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: { imports = [ diff --git a/apple/macbook-pro/11-5/default.nix b/apple/macbook-pro/11-5/default.nix index 1db2878f..0dcd557f 100644 --- a/apple/macbook-pro/11-5/default.nix +++ b/apple/macbook-pro/11-5/default.nix @@ -18,7 +18,6 @@ in services.udev.extraRules = # Disable XHC1 wakeup signal to avoid resume getting triggered some time # after suspend. Reboot required for this to take effect. - lib.optionalString - (lib.versionAtLeast kernelPackages.kernel.version "3.13") + lib.optionalString (lib.versionAtLeast kernelPackages.kernel.version "3.13") ''SUBSYSTEM=="pci", KERNEL=="0000:00:14.0", ATTR{power/wakeup}="disabled"''; } diff --git a/apple/macbook-pro/12-1/default.nix b/apple/macbook-pro/12-1/default.nix index 6f1bc995..e48dbc24 100644 --- a/apple/macbook-pro/12-1/default.nix +++ b/apple/macbook-pro/12-1/default.nix @@ -1,4 +1,9 @@ -{ lib, pkgs, modulesPath, ... }: +{ + lib, + pkgs, + modulesPath, + ... +}: { imports = [ @@ -19,7 +24,7 @@ powerDownCommands = lib.mkBefore '' ${pkgs.kmod}/bin/rmmod -f -v brcmfmac_wcc 2>/dev/null || true ${pkgs.kmod}/bin/rmmod brcmfmac - ''; + ''; }; # USB subsystem wakes up MBP right after suspend unless we disable it. diff --git a/apple/macbook-pro/14-1/default.nix b/apple/macbook-pro/14-1/default.nix index e7897708..ad8c5d1d 100644 --- a/apple/macbook-pro/14-1/default.nix +++ b/apple/macbook-pro/14-1/default.nix @@ -3,7 +3,8 @@ lib, pkgs, ... -}: { +}: +{ imports = [ ../. ../../../common/cpu/intel/kaby-lake @@ -15,7 +16,12 @@ # https://www.kernelconfig.io/config_keyboard_applespi boot = { - initrd.kernelModules = ["applespi" "spi_pxa2xx_platform" "intel_lpss_pci" "applesmc" ]; + initrd.kernelModules = [ + "applespi" + "spi_pxa2xx_platform" + "intel_lpss_pci" + "applesmc" + ]; kernelParams = [ "intel_iommu=on" ]; kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.0") pkgs.linuxPackages_latest; }; diff --git a/apple/macbook-pro/8-1/default.nix b/apple/macbook-pro/8-1/default.nix index a807da27..0b6eef12 100644 --- a/apple/macbook-pro/8-1/default.nix +++ b/apple/macbook-pro/8-1/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: { imports = [ diff --git a/apple/t2/default.nix b/apple/t2/default.nix index 38115ba2..825a181a 100644 --- a/apple/t2/default.nix +++ b/apple/t2/default.nix @@ -25,7 +25,7 @@ let overrideAudioFiles = package: pluginsPath: package.overrideAttrs ( - new: old: { + _new: old: { preConfigurePhases = old.preConfigurePhases or [ ] ++ [ "postPatchPhase" ]; postPatchPhase = '' cp -r ${audioFiles}/files/{profile-sets,paths} ${pluginsPath}/alsa/mixer/ @@ -106,11 +106,16 @@ in powerManagement.enable = true; } - (if lib.versionAtLeast nixosVersion "25.05" then { - services.pulseaudio.package = overrideAudioFiles pkgs.pulseaudio "src/modules/"; - } else { - hardware.pulseaudio.package = overrideAudioFiles pkgs.pulseaudio "src/modules/"; - }) + ( + if lib.versionAtLeast nixosVersion "25.05" then + { + services.pulseaudio.package = overrideAudioFiles pkgs.pulseaudio "src/modules/"; + } + else + { + hardware.pulseaudio.package = overrideAudioFiles pkgs.pulseaudio "src/modules/"; + } + ) (lib.mkIf t2Cfg.enableIGPU { # Enable the iGPU by default if present diff --git a/asus/ally/rc71l/default.nix b/asus/ally/rc71l/default.nix index 7f2552ec..5d1e58a7 100644 --- a/asus/ally/rc71l/default.nix +++ b/asus/ally/rc71l/default.nix @@ -11,5 +11,7 @@ # 6.5 adds many fixes and improvements for the Ally # This includes for example performance, audio and bluetooth - boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.5") (lib.mkDefault pkgs.linuxPackages_latest); + boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.5") ( + lib.mkDefault pkgs.linuxPackages_latest + ); } diff --git a/asus/battery.nix b/asus/battery.nix index d61e3502..4bdf6b64 100644 --- a/asus/battery.nix +++ b/asus/battery.nix @@ -1,4 +1,9 @@ -{ config, pkgs, lib, ... }: +{ + config, + pkgs, + lib, + ... +}: let p = pkgs.writeScriptBin "charge-upto" '' echo ''${0:-100} > /sys/class/power_supply/BAT?/charge_control_end_threshold @@ -22,8 +27,14 @@ in config = { environment.systemPackages = lib.mkIf cfg.enableChargeUptoScript [ p ]; systemd.services.battery-charge-threshold = { - wantedBy = [ "local-fs.target" "suspend.target" ]; - after = [ "local-fs.target" "suspend.target" ]; + wantedBy = [ + "local-fs.target" + "suspend.target" + ]; + after = [ + "local-fs.target" + "suspend.target" + ]; description = "Set the battery charge threshold to ${toString cfg.chargeUpto}%"; startLimitBurst = 5; startLimitIntervalSec = 1; diff --git a/asus/fa507nv/default.nix b/asus/fa507nv/default.nix index 3a304012..01fafbb2 100644 --- a/asus/fa507nv/default.nix +++ b/asus/fa507nv/default.nix @@ -3,7 +3,8 @@ pkgs, config, ... -}: { +}: +{ imports = [ ../../common/cpu/amd ../../common/cpu/amd/raphael/igpu.nix @@ -20,7 +21,9 @@ # The bottom 2 parts are taken from the framework 16-inch laptops configurations. # Workaround for SuspendThenHibernate: https://lore.kernel.org/linux-kernel/20231106162310.85711-1-mario.limonciello@amd.com/ - boot.kernelParams = lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8") ["rtc_cmos.use_acpi_alarm=1"]; + boot.kernelParams = + lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8") + [ "rtc_cmos.use_acpi_alarm=1" ]; # AMD has better battery life with PPD over TLP: # https://community.frame.work/t/responded-amd-7040-sleep-states/38101/13 diff --git a/asus/fa507rm/default.nix b/asus/fa507rm/default.nix index a07a6413..ffbae513 100644 --- a/asus/fa507rm/default.nix +++ b/asus/fa507rm/default.nix @@ -1,16 +1,16 @@ { ... }: { - imports = [ - ../../common/cpu/amd - ../../common/gpu/nvidia/prime.nix - ../../common/gpu/nvidia/ampere - ../../common/pc/laptop - ../../common/pc/ssd - ]; + imports = [ + ../../common/cpu/amd + ../../common/gpu/nvidia/prime.nix + ../../common/gpu/nvidia/ampere + ../../common/pc/laptop + ../../common/pc/ssd + ]; - hardware.nvidia.prime = { - amdgpuBusId = "PCI:5:0:0"; - nvidiaBusId = "PCI:1:0:0"; - }; - } + hardware.nvidia.prime = { + amdgpuBusId = "PCI:5:0:0"; + nvidiaBusId = "PCI:1:0:0"; + }; +} diff --git a/asus/flow/gv302x/amdgpu/default.nix b/asus/flow/gv302x/amdgpu/default.nix index 833e298f..8cfb2403 100644 --- a/asus/flow/gv302x/amdgpu/default.nix +++ b/asus/flow/gv302x/amdgpu/default.nix @@ -1,4 +1,5 @@ -{ config, +{ + config, lib, ... }: @@ -7,15 +8,22 @@ let inherit (lib) mkEnableOption mkIf mkMerge; cfg = config.hardware.asus.flow.gv302x; -in { +in +{ imports = [ ../shared.nix ]; options.hardware.asus.flow.gv302x.amdgpu = { - recovery.enable = (mkEnableOption "Enable amdgpu.gpu_recovery kernel boot param") // { default = false; }; - sg_display.enable = (mkEnableOption "Enable amdgpu.gpu_recovery kernel boot param") // { default = true; }; - psr.enable = (mkEnableOption "Enable amdgpu.dcdebugmask=0x10 kernel boot param") // { default = true; }; + recovery.enable = (mkEnableOption "Enable amdgpu.gpu_recovery kernel boot param") // { + default = false; + }; + sg_display.enable = (mkEnableOption "Enable amdgpu.gpu_recovery kernel boot param") // { + default = true; + }; + psr.enable = (mkEnableOption "Enable amdgpu.dcdebugmask=0x10 kernel boot param") // { + default = true; + }; }; config = mkMerge [ diff --git a/asus/flow/gv302x/nvidia/default.nix b/asus/flow/gv302x/nvidia/default.nix index 0c490c93..7abfea1d 100644 --- a/asus/flow/gv302x/nvidia/default.nix +++ b/asus/flow/gv302x/nvidia/default.nix @@ -1,4 +1,5 @@ -{ lib, +{ + lib, pkgs, config, ... @@ -7,7 +8,8 @@ let inherit (lib) mkDefault; -in { +in +{ imports = [ ../shared.nix ## "prime.nix" loads this, aleady: @@ -23,8 +25,6 @@ in { blacklistedKernelModules = [ "nouveau" ]; }; - - hardware = { ## Enable the Nvidia card, as well as Prime and Offload: amdgpu.initrd.enable = mkDefault true; @@ -49,7 +49,7 @@ in { }; dynamicBoost.enable = mkDefault true; - + }; }; } diff --git a/asus/flow/gv302x/shared.nix b/asus/flow/gv302x/shared.nix index 474eb584..a556e7d0 100644 --- a/asus/flow/gv302x/shared.nix +++ b/asus/flow/gv302x/shared.nix @@ -1,14 +1,23 @@ -{ config, +{ + config, pkgs, lib, ... }: let - inherit (lib) mkDefault mkEnableOption mkIf mkMerge version versionAtLeast versionOlder; + inherit (lib) + mkDefault + mkEnableOption + mkIf + mkMerge + version + versionAtLeast + ; cfg = config.hardware.asus.flow.gv302x; -in { +in +{ imports = [ ../../../common/cpu/amd @@ -26,12 +35,12 @@ in { # enables it for kernel 6.9.x onwards. # # Note: the device name is "ASUS N-KEY Device". - keyboard.autosuspend.enable = ( - mkEnableOption "Enable auto-suspend on the internal USB keyboard (ASUS N-KEY Device) on Flow GV302X" - ) // { - default = versionAtLeast config.boot.kernelPackages.kernel.version "6.9"; - defaultText = lib.literalExpression "lib.versionAtLeast config.boot.kernelPackages.kernel.version \"6.9\""; - }; + keyboard.autosuspend.enable = + (mkEnableOption "Enable auto-suspend on the internal USB keyboard (ASUS N-KEY Device) on Flow GV302X") + // { + default = versionAtLeast config.boot.kernelPackages.kernel.version "6.9"; + defaultText = lib.literalExpression "lib.versionAtLeast config.boot.kernelPackages.kernel.version \"6.9\""; + }; # The ASUS 8295 ITE device will cause an immediate wake-up when trying to suspend the laptop. # After the first successful hibernate, it will work as expected, however. # NOTE: I'm not actually sure what this device, as neither the touchpad nor the M1-M4 keys cause a wake-up. @@ -63,7 +72,7 @@ in { evdev:name:*:dmi:bvn*:bvr*:bd*:svnASUS*:pn*:* KEYBOARD_KEY_ff31007c=f20 ''; - }; + }; }; #flow devices are 2 in 1 laptops @@ -71,7 +80,7 @@ in { } - (mkIf (! cfg.keyboard.autosuspend.enable) { + (mkIf (!cfg.keyboard.autosuspend.enable) { services.udev.extraRules = '' # Disable power auto-suspend for the ASUS N-KEY device, i.e. USB Keyboard. # Otherwise on certain kernel-versions, it will tend to take 1-2 key-presses to wake-up after the device suspends. @@ -79,7 +88,7 @@ in { ''; }) - (mkIf (! cfg.ite-device.wakeup.enable) { + (mkIf (!cfg.ite-device.wakeup.enable) { services.udev.extraRules = '' # Disable power wakeup for the 8295 ITE device. # Otherwise on certain kernel-versions, it will tend to cause the laptop to immediately wake-up when suspending. diff --git a/asus/fx504gd/default.nix b/asus/fx504gd/default.nix index 45132509..244eaae4 100644 --- a/asus/fx504gd/default.nix +++ b/asus/fx504gd/default.nix @@ -2,7 +2,7 @@ { imports = [ ../../common/cpu/intel - ../../common/pc/laptop + ../../common/pc/laptop ]; #Nouveau doesn't work at all on this model. diff --git a/asus/fx506hm/default.nix b/asus/fx506hm/default.nix index a50ffdf4..6f29a8b8 100644 --- a/asus/fx506hm/default.nix +++ b/asus/fx506hm/default.nix @@ -1,8 +1,7 @@ { config, lib, ... }: { - imports = - [ + imports = [ ../../common/cpu/intel ../../common/gpu/nvidia ../../common/gpu/nvidia/prime.nix @@ -11,14 +10,12 @@ ../battery.nix ]; - hardware.nvidia = - { + hardware.nvidia = { modesetting.enable = lib.mkDefault true; open = lib.mkIf (lib.versionAtLeast config.hardware.nvidia.package.version "555") true; - prime = - { - intelBusId = "PCI:0:2:0"; + prime = { + intelBusId = "PCI:0:2:0"; nvidiaBusId = "PCI:1:0:0"; }; }; diff --git a/asus/rog-strix/g513im/default.nix b/asus/rog-strix/g513im/default.nix index 654cdd14..12320165 100644 --- a/asus/rog-strix/g513im/default.nix +++ b/asus/rog-strix/g513im/default.nix @@ -1,17 +1,17 @@ { - imports = [ - ../../../common/cpu/amd - ../../../common/cpu/amd/pstate.nix - ../../../common/gpu/nvidia - ../../../common/gpu/nvidia/prime.nix - ../../../common/gpu/nvidia/ampere - ../../../common/pc/laptop - ../../../common/pc/ssd - ../../battery.nix - ]; + imports = [ + ../../../common/cpu/amd + ../../../common/cpu/amd/pstate.nix + ../../../common/gpu/nvidia + ../../../common/gpu/nvidia/prime.nix + ../../../common/gpu/nvidia/ampere + ../../../common/pc/laptop + ../../../common/pc/ssd + ../../battery.nix + ]; - hardware.nvidia.prime = { - amdgpuBusId = "PCI:05:00:0"; - nvidiaBusId = "PCI:01:00:0"; - }; + hardware.nvidia.prime = { + amdgpuBusId = "PCI:05:00:0"; + nvidiaBusId = "PCI:01:00:0"; + }; } diff --git a/asus/rog-strix/g533zw/default.nix b/asus/rog-strix/g533zw/default.nix index 635ae559..d93f4f4a 100644 --- a/asus/rog-strix/g533zw/default.nix +++ b/asus/rog-strix/g533zw/default.nix @@ -13,5 +13,5 @@ hardware.nvidia.prime = { intelBusId = "PCI:0:2:0"; nvidiaBusId = "PCI:1:0:0"; - }; + }; } diff --git a/asus/rog-strix/g713ie/default.nix b/asus/rog-strix/g713ie/default.nix index f82ddb9b..3ef4c23f 100644 --- a/asus/rog-strix/g713ie/default.nix +++ b/asus/rog-strix/g713ie/default.nix @@ -1,16 +1,16 @@ { - imports = [ - ../../../common/cpu/amd - ../../../common/cpu/amd/pstate.nix - ../../../common/gpu/nvidia - ../../../common/gpu/nvidia/prime.nix - ../../../common/gpu/nvidia/ampere - ../../../common/pc/laptop - ../../../common/pc/ssd - ../../battery.nix - ]; + imports = [ + ../../../common/cpu/amd + ../../../common/cpu/amd/pstate.nix + ../../../common/gpu/nvidia + ../../../common/gpu/nvidia/prime.nix + ../../../common/gpu/nvidia/ampere + ../../../common/pc/laptop + ../../../common/pc/ssd + ../../battery.nix + ]; - hardware.nvidia.prime = { + hardware.nvidia.prime = { amdgpuBusId = "PCI:5:0:0"; nvidiaBusId = "PCI:1:0:0"; }; diff --git a/asus/rog-strix/g733qs/default.nix b/asus/rog-strix/g733qs/default.nix index b09142af..41fda8ad 100644 --- a/asus/rog-strix/g733qs/default.nix +++ b/asus/rog-strix/g733qs/default.nix @@ -20,7 +20,9 @@ options snd-hda-intel patch=hda-jack-retask.fw ''; # before 5.12 it would interpret every keystroke as the power button - boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.12") (lib.mkDefault pkgs.linuxPackages_latest); + boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.12") ( + lib.mkDefault pkgs.linuxPackages_latest + ); hardware.nvidia.prime = { amdgpuBusId = "PCI:5:0:0"; diff --git a/asus/zenbook/ux481/nvidia/default.nix b/asus/zenbook/ux481/nvidia/default.nix index 359a97d6..e65ed0bc 100644 --- a/asus/zenbook/ux481/nvidia/default.nix +++ b/asus/zenbook/ux481/nvidia/default.nix @@ -1,4 +1,4 @@ -{lib, ...}: +{ lib, ... }: { imports = [ ../shared.nix @@ -7,11 +7,11 @@ ]; hardware.nvidia = { - prime = { - intelBusId = "PCI:0:2:0"; - nvidiaBusId = "PCI:2:0:0"; - }; + prime = { + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:2:0:0"; + }; - dynamicBoost.enable = lib.mkForce false; # Dynamic boost is not supported on Pascal architeture + dynamicBoost.enable = lib.mkForce false; # Dynamic boost is not supported on Pascal architeture }; } diff --git a/asus/zephyrus/ga402x/amdgpu/default.nix b/asus/zephyrus/ga402x/amdgpu/default.nix index 2610db89..09acc327 100644 --- a/asus/zephyrus/ga402x/amdgpu/default.nix +++ b/asus/zephyrus/ga402x/amdgpu/default.nix @@ -1,4 +1,5 @@ -{ config, +{ + config, lib, ... }: @@ -7,15 +8,22 @@ let inherit (lib) mkEnableOption mkIf mkMerge; cfg = config.hardware.asus.zephyrus.ga402x; -in { +in +{ imports = [ ../shared.nix ]; options.hardware.asus.zephyrus.ga402x.amdgpu = { - recovery.enable = (mkEnableOption "Enable amdgpu.gpu_recovery kernel boot param") // { default = false; }; - sg_display.enable = (mkEnableOption "Enable amdgpu.gpu_recovery kernel boot param") // { default = true; }; - psr.enable = (mkEnableOption "Enable amdgpu.dcdebugmask=0x10 kernel boot param") // { default = true; }; + recovery.enable = (mkEnableOption "Enable amdgpu.gpu_recovery kernel boot param") // { + default = false; + }; + sg_display.enable = (mkEnableOption "Enable amdgpu.gpu_recovery kernel boot param") // { + default = true; + }; + psr.enable = (mkEnableOption "Enable amdgpu.dcdebugmask=0x10 kernel boot param") // { + default = true; + }; }; config = mkMerge [ diff --git a/asus/zephyrus/ga402x/nvidia/default.nix b/asus/zephyrus/ga402x/nvidia/default.nix index 7c5b1d7f..c2750490 100644 --- a/asus/zephyrus/ga402x/nvidia/default.nix +++ b/asus/zephyrus/ga402x/nvidia/default.nix @@ -1,4 +1,5 @@ -{ lib, +{ + lib, pkgs, ... }: @@ -6,7 +7,8 @@ let inherit (lib) mkDefault; -in { +in +{ imports = [ ../shared.nix ## "prime.nix" loads this, aleady: diff --git a/asus/zephyrus/ga402x/shared.nix b/asus/zephyrus/ga402x/shared.nix index f1069037..bd0eda35 100644 --- a/asus/zephyrus/ga402x/shared.nix +++ b/asus/zephyrus/ga402x/shared.nix @@ -1,14 +1,24 @@ -{ config, +{ + config, pkgs, lib, ... }: let - inherit (lib) mkDefault mkEnableOption mkIf mkMerge version versionAtLeast versionOlder; + inherit (lib) + mkDefault + mkEnableOption + mkIf + mkMerge + version + versionAtLeast + versionOlder + ; cfg = config.hardware.asus.zephyrus.ga402x; -in { +in +{ imports = [ ../../../common/cpu/amd @@ -26,12 +36,12 @@ in { # enables it for kernel 6.9.x onwards. # # Note: the device name is "ASUS N-KEY Device". - keyboard.autosuspend.enable = ( - mkEnableOption "Enable auto-suspend on the internal USB keyboard (ASUS N-KEY Device) on Zephyrus GA402X" - ) // { - default = versionAtLeast config.boot.kernelPackages.kernel.version "6.9"; - defaultText = lib.literalExpression "lib.versionAtLeast config.boot.kernelPackages.kernel.version \"6.9\""; - }; + keyboard.autosuspend.enable = + (mkEnableOption "Enable auto-suspend on the internal USB keyboard (ASUS N-KEY Device) on Zephyrus GA402X") + // { + default = versionAtLeast config.boot.kernelPackages.kernel.version "6.9"; + defaultText = lib.literalExpression "lib.versionAtLeast config.boot.kernelPackages.kernel.version \"6.9\""; + }; # The ASUS 8295 ITE device will cause an immediate wake-up when trying to suspend the laptop. # After the first successful hibernate, it will work as expected, however. # NOTE: I'm not actually sure what this device, as neither the touchpad nor the M1-M4 keys cause a wake-up. @@ -67,7 +77,7 @@ in { }; } - (mkIf (! cfg.keyboard.autosuspend.enable) { + (mkIf (!cfg.keyboard.autosuspend.enable) { services.udev.extraRules = '' # Disable power auto-suspend for the ASUS N-KEY device, i.e. USB Keyboard. # Otherwise on certain kernel-versions, it will tend to take 1-2 key-presses to wake-up after the device suspends. @@ -75,7 +85,7 @@ in { ''; }) - (mkIf (! cfg.ite-device.wakeup.enable) { + (mkIf (!cfg.ite-device.wakeup.enable) { services.udev.extraRules = '' # Disable power wakeup for the 8295 ITE device. # Otherwise on certain kernel-versions, it will tend to cause the laptop to immediately wake-up when suspending. diff --git a/chuwi/minibook-x/default.nix b/chuwi/minibook-x/default.nix index 0b78d046..480909e2 100644 --- a/chuwi/minibook-x/default.nix +++ b/chuwi/minibook-x/default.nix @@ -1,4 +1,5 @@ -{ ... }: { +{ ... }: +{ imports = [ ../../common/cpu/intel ../../common/pc/laptop @@ -6,6 +7,8 @@ ../../common/hidpi.nix ]; # Fixes the display being rotated 90 degrees. - boot.kernelParams = - [ "fbcon=rotate:1" "video=DSI-1:panel_orientation=right_side_up" ]; + boot.kernelParams = [ + "fbcon=rotate:1" + "video=DSI-1:panel_orientation=right_side_up" + ]; } diff --git a/common/cpu/amd/default.nix b/common/cpu/amd/default.nix index d8c48a26..10ec6fd5 100644 --- a/common/cpu/amd/default.nix +++ b/common/cpu/amd/default.nix @@ -1,6 +1,5 @@ { config, lib, ... }: { - hardware.cpu.amd.updateMicrocode = - lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/common/cpu/amd/pstate.nix b/common/cpu/amd/pstate.nix index 6a84027a..19f1d74f 100644 --- a/common/cpu/amd/pstate.nix +++ b/common/cpu/amd/pstate.nix @@ -8,23 +8,13 @@ in imports = [ ./. ]; boot = lib.mkMerge [ - (lib.mkIf - ( - (lib.versionAtLeast kver "5.17") - && (lib.versionOlder kver "6.1") - ) - { - kernelParams = [ "initcall_blacklist=acpi_cpufreq_init" ]; - kernelModules = [ "amd-pstate" ]; - }) - (lib.mkIf - ( - (lib.versionAtLeast kver "6.1") - && (lib.versionOlder kver "6.3") - ) - { - kernelParams = [ "amd_pstate=passive" ]; - }) + (lib.mkIf ((lib.versionAtLeast kver "5.17") && (lib.versionOlder kver "6.1")) { + kernelParams = [ "initcall_blacklist=acpi_cpufreq_init" ]; + kernelModules = [ "amd-pstate" ]; + }) + (lib.mkIf ((lib.versionAtLeast kver "6.1") && (lib.versionOlder kver "6.3")) { + kernelParams = [ "amd_pstate=passive" ]; + }) (lib.mkIf (lib.versionAtLeast kver "6.3") { kernelParams = [ "amd_pstate=active" ]; }) diff --git a/common/gpu/24.05-compat.nix b/common/gpu/24.05-compat.nix index 17508882..bcccd2ca 100644 --- a/common/gpu/24.05-compat.nix +++ b/common/gpu/24.05-compat.nix @@ -6,9 +6,18 @@ # 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" ]) + (lib.mkAliasOptionModule + [ "hardware" "graphics" "extraPackages" ] + [ "hardware" "opengl" "extraPackages" ] + ) + (lib.mkAliasOptionModule + [ "hardware" "graphics" "extraPackages32" ] + [ "hardware" "opengl" "extraPackages32" ] + ) + (lib.mkAliasOptionModule + [ "hardware" "graphics" "enable32Bit" ] + [ "hardware" "opengl" "driSupport32Bit" ] + ) (lib.mkAliasOptionModule [ "hardware" "graphics" "package" ] [ "hardware" "opengl" "package" ]) (lib.mkAliasOptionModule [ "hardware" "graphics" "package32" ] [ "hardware" "opengl" "package32" ]) ]; diff --git a/common/gpu/amd/sea-islands/default.nix b/common/gpu/amd/sea-islands/default.nix index 697e8250..593d7437 100644 --- a/common/gpu/amd/sea-islands/default.nix +++ b/common/gpu/amd/sea-islands/default.nix @@ -1,5 +1,8 @@ { imports = [ ../. ]; # Explicitly set amdgpu support in place of radeon - boot.kernelParams = [ "radeon.cik_support=0" "amdgpu.cik_support=1" ]; + boot.kernelParams = [ + "radeon.cik_support=0" + "amdgpu.cik_support=1" + ]; } diff --git a/common/gpu/amd/southern-islands/default.nix b/common/gpu/amd/southern-islands/default.nix index 4939117f..fa98cb1a 100644 --- a/common/gpu/amd/southern-islands/default.nix +++ b/common/gpu/amd/southern-islands/default.nix @@ -1,5 +1,8 @@ { imports = [ ../. ]; # Explicitly set amdgpu support in place of radeon - boot.kernelParams = [ "radeon.si_support=0" "amdgpu.si_support=1" ]; + boot.kernelParams = [ + "radeon.si_support=0" + "amdgpu.si_support=1" + ]; } diff --git a/common/gpu/intel/default.nix b/common/gpu/intel/default.nix index 28c6e93e..a8671d41 100644 --- a/common/gpu/intel/default.nix +++ b/common/gpu/intel/default.nix @@ -45,11 +45,15 @@ intel-vaapi-driver = (pkgs.intel-vaapi-driver or pkgs.vaapiIntel).override { enableHybridCodec = cfg.enableHybridCodec; }; - intel-vaapi-driver-32 = (pkgs.driversi686Linux.intel-vaapi-driver or pkgs.driversi686Linux.vaapiIntel).override { - enableHybridCodec = cfg.enableHybridCodec; - }; + intel-vaapi-driver-32 = + (pkgs.driversi686Linux.intel-vaapi-driver or pkgs.driversi686Linux.vaapiIntel).override + { + enableHybridCodec = cfg.enableHybridCodec; + }; - useIntelOcl = useIntelVaapiDriver && (config.hardware.enableAllFirmware or config.nixpkgs.config.allowUnfree or false); + useIntelOcl = + useIntelVaapiDriver + && (config.hardware.enableAllFirmware or config.nixpkgs.config.allowUnfree or false); intel-ocl = pkgs.intel-ocl; useIntelMediaDriver = cfg.vaapiDriver == "intel-media-driver" || cfg.vaapiDriver == null; diff --git a/common/gpu/nvidia/ada-lovelace/default.nix b/common/gpu/nvidia/ada-lovelace/default.nix index 461ae914..5e8d48f6 100644 --- a/common/gpu/nvidia/ada-lovelace/default.nix +++ b/common/gpu/nvidia/ada-lovelace/default.nix @@ -1,4 +1,4 @@ -{lib, config, ...}: +{ lib, config, ... }: let nvidiaPackage = config.hardware.nvidia.package; in diff --git a/common/gpu/nvidia/ampere/default.nix b/common/gpu/nvidia/ampere/default.nix index 461ae914..5e8d48f6 100644 --- a/common/gpu/nvidia/ampere/default.nix +++ b/common/gpu/nvidia/ampere/default.nix @@ -1,4 +1,4 @@ -{lib, config, ...}: +{ lib, config, ... }: let nvidiaPackage = config.hardware.nvidia.package; in diff --git a/common/gpu/nvidia/disable.nix b/common/gpu/nvidia/disable.nix index 6ea07adc..550da56e 100644 --- a/common/gpu/nvidia/disable.nix +++ b/common/gpu/nvidia/disable.nix @@ -8,7 +8,7 @@ blacklist nouveau options nouveau modeset=0 ''; - + services.udev.extraRules = '' # Remove NVIDIA USB xHCI Host Controller devices, if present ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{power/control}="auto", ATTR{remove}="1" @@ -22,5 +22,10 @@ # Remove NVIDIA VGA/3D controller devices ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", ATTR{power/control}="auto", ATTR{remove}="1" ''; - boot.blacklistedKernelModules = [ "nouveau" "nvidia" "nvidia_drm" "nvidia_modeset" ]; + boot.blacklistedKernelModules = [ + "nouveau" + "nvidia" + "nvidia_drm" + "nvidia_modeset" + ]; } diff --git a/common/gpu/nvidia/kepler/default.nix b/common/gpu/nvidia/kepler/default.nix index f8d89a1e..129bcad4 100644 --- a/common/gpu/nvidia/kepler/default.nix +++ b/common/gpu/nvidia/kepler/default.nix @@ -1,4 +1,4 @@ -{lib, ...}: +{ lib, ... }: { imports = [ ../. ]; diff --git a/common/gpu/nvidia/maxwell/default.nix b/common/gpu/nvidia/maxwell/default.nix index 89565090..194f39c9 100644 --- a/common/gpu/nvidia/maxwell/default.nix +++ b/common/gpu/nvidia/maxwell/default.nix @@ -1,4 +1,4 @@ -{lib, ...}: +{ lib, ... }: { imports = [ ../. ]; diff --git a/common/gpu/nvidia/pascal/default.nix b/common/gpu/nvidia/pascal/default.nix index ad3555dc..acd77a2b 100644 --- a/common/gpu/nvidia/pascal/default.nix +++ b/common/gpu/nvidia/pascal/default.nix @@ -1,4 +1,4 @@ -{lib, ...}: +{ lib, ... }: { imports = [ ../. ]; diff --git a/common/gpu/nvidia/prime.nix b/common/gpu/nvidia/prime.nix index cf3e7d45..edfda26d 100644 --- a/common/gpu/nvidia/prime.nix +++ b/common/gpu/nvidia/prime.nix @@ -19,7 +19,7 @@ specialisation = lib.mkIf config.hardware.nvidia.primeBatterySaverSpecialisation { battery-saver.configuration = { - system.nixos.tags = ["battery-saver"]; + system.nixos.tags = [ "battery-saver" ]; imports = [ # Leave only the integrated GPU enabled ./disable.nix @@ -28,7 +28,7 @@ prime.offload.enable = lib.mkForce false; powerManagement = { enable = lib.mkForce false; - finegrained = lib.mkForce false; + finegrained = lib.mkForce false; }; }; }; diff --git a/common/gpu/nvidia/turing/default.nix b/common/gpu/nvidia/turing/default.nix index 461ae914..5e8d48f6 100644 --- a/common/gpu/nvidia/turing/default.nix +++ b/common/gpu/nvidia/turing/default.nix @@ -1,4 +1,4 @@ -{lib, config, ...}: +{ lib, config, ... }: let nvidiaPackage = config.hardware.nvidia.package; in diff --git a/common/pc/laptop/default.nix b/common/pc/laptop/default.nix index 9121b5f0..abc76fa7 100644 --- a/common/pc/laptop/default.nix +++ b/common/pc/laptop/default.nix @@ -6,6 +6,8 @@ # Gnome 40 introduced a new way of managing power, without tlp. # However, these 2 services clash when enabled simultaneously. # https://github.com/NixOS/nixos-hardware/issues/260 - services.tlp.enable = lib.mkDefault ((lib.versionOlder (lib.versions.majorMinor lib.version) "21.05") - || !config.services.power-profiles-daemon.enable); + services.tlp.enable = lib.mkDefault ( + (lib.versionOlder (lib.versions.majorMinor lib.version) "21.05") + || !config.services.power-profiles-daemon.enable + ); } diff --git a/default.nix b/default.nix index fbb5b770..c73bd5ad 100644 --- a/default.nix +++ b/default.nix @@ -1,3 +1,3 @@ # This file is necessary so nix-env -qa does not break, # when nixos-hardware is used as a channel -{} +{ } diff --git a/dell/inspiron/14-5420/default.nix b/dell/inspiron/14-5420/default.nix index 658f0b3b..8958afe6 100644 --- a/dell/inspiron/14-5420/default.nix +++ b/dell/inspiron/14-5420/default.nix @@ -1,22 +1,22 @@ { lib, ... }: - + { - imports = [ - ../../../common/cpu/intel - ../../../common/pc/laptop - ../../../common/pc/ssd - ]; + imports = [ + ../../../common/cpu/intel + ../../../common/pc/laptop + ../../../common/pc/ssd + ]; - hardware = { - enableRedistributableFirmware = lib.mkDefault true; - }; + hardware = { + enableRedistributableFirmware = lib.mkDefault true; + }; - services = { - fwupd = { - enable = lib.mkDefault true; - }; - thermald = { - enable = lib.mkDefault true; - }; - }; + services = { + fwupd = { + enable = lib.mkDefault true; + }; + thermald = { + enable = lib.mkDefault true; + }; + }; } diff --git a/dell/inspiron/5515/default.nix b/dell/inspiron/5515/default.nix index c2e8e310..452e9fae 100644 --- a/dell/inspiron/5515/default.nix +++ b/dell/inspiron/5515/default.nix @@ -16,7 +16,10 @@ serviceConfig.Type = "oneshot"; description = "reload touchpad driver"; # must run at boot (and not too early), and after suspend - wantedBy = [ "display-manager.service" "post-resume.target" ]; + wantedBy = [ + "display-manager.service" + "post-resume.target" + ]; # prevent running before suspend after = [ "post-resume.target" ]; }; @@ -24,7 +27,6 @@ # so that post-resume.service exists powerManagement.enable = true; - # fix suspend # https://bbs.archlinux.org/viewtopic.php?id=266108 says linux >= 5.12 required boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.12") pkgs.linuxPackages_latest; diff --git a/dell/inspiron/7405/default.nix b/dell/inspiron/7405/default.nix index d894e179..8068e8eb 100644 --- a/dell/inspiron/7405/default.nix +++ b/dell/inspiron/7405/default.nix @@ -11,7 +11,10 @@ with lib; ]; # TSC is unstable - boot.kernelParams = [ "notsc" "trace_clock=local" ]; + boot.kernelParams = [ + "notsc" + "trace_clock=local" + ]; hardware.enableRedistributableFirmware = mkDefault true; } diff --git a/dell/inspiron/7559/default.nix b/dell/inspiron/7559/default.nix index da837ba2..d742d249 100644 --- a/dell/inspiron/7559/default.nix +++ b/dell/inspiron/7559/default.nix @@ -17,7 +17,7 @@ enableRedistributableFirmware = lib.mkDefault true; }; - + services = { thermald.enable = lib.mkDefault true; }; diff --git a/dell/latitude/5490/default.nix b/dell/latitude/5490/default.nix index 2cde4ad0..9790967c 100644 --- a/dell/latitude/5490/default.nix +++ b/dell/latitude/5490/default.nix @@ -12,10 +12,13 @@ boot = { # Kernel Panic on suspend fix, taken from ArchLinux wiki. - kernelParams = [ "acpi_enforce_resources=lax" "i915.enable_dc=0" ]; + kernelParams = [ + "acpi_enforce_resources=lax" + "i915.enable_dc=0" + ]; # Audio Mute LED extraModprobeConfig = '' - options snd-hda-intel model=mute-led-gpio + options snd-hda-intel model=mute-led-gpio ''; }; } diff --git a/dell/precision/5490/default.nix b/dell/precision/5490/default.nix index b2cbabe4..d3619547 100644 --- a/dell/precision/5490/default.nix +++ b/dell/precision/5490/default.nix @@ -4,7 +4,9 @@ ../../../common/gpu/nvidia/ada-lovelace ]; - boot.kernelParams = lib.mkIf (lib.versionOlder config.boot.kernelPackages.kernel.version "6.7") [ "i915.force_probe=7d55" ]; + boot.kernelParams = lib.mkIf (lib.versionOlder config.boot.kernelPackages.kernel.version "6.7") [ + "i915.force_probe=7d55" + ]; hardware.nvidia.prime = { intelBusId = "PCI:0:2:0"; diff --git a/dell/precision/5530/default.nix b/dell/precision/5530/default.nix index 1b7007af..38390c8d 100644 --- a/dell/precision/5530/default.nix +++ b/dell/precision/5530/default.nix @@ -39,7 +39,7 @@ }; services = { fwupd.enable = lib.mkDefault true; - # This will save you money and possibly your life! + # This will save you money and possibly your life! thermald.enable = lib.mkDefault true; }; } diff --git a/dell/precision/7520/default.nix b/dell/precision/7520/default.nix index 567aa382..4742afb3 100644 --- a/dell/precision/7520/default.nix +++ b/dell/precision/7520/default.nix @@ -2,7 +2,8 @@ config, lib, ... -}: { +}: +{ imports = [ ../../../common/cpu/intel/kaby-lake ../../../common/pc/laptop @@ -11,13 +12,19 @@ ]; hardware.enableRedistributableFirmware = lib.mkDefault true; - boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"]; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "usb_storage" + "sd_mod" + "rtsx_pci_sdmmc" + ]; boot = { - kernelModules = ["kvm-intel"]; - blacklistedKernelModules = ["nouveau"]; + kernelModules = [ "kvm-intel" ]; + blacklistedKernelModules = [ "nouveau" ]; }; - boot.kernelParams = ["i915.modeset=1"]; + boot.kernelParams = [ "i915.modeset=1" ]; hardware = { graphics = { diff --git a/dell/xps/13-9300/default.nix b/dell/xps/13-9300/default.nix index 53828cfa..046fde85 100644 --- a/dell/xps/13-9300/default.nix +++ b/dell/xps/13-9300/default.nix @@ -3,7 +3,8 @@ let inherit (lib) mkDefault; -in { +in +{ imports = [ ../../../common/cpu/intel ../../../common/pc/laptop diff --git a/dell/xps/13-9310/default.nix b/dell/xps/13-9310/default.nix index d5fcdc62..0f10b25f 100644 --- a/dell/xps/13-9310/default.nix +++ b/dell/xps/13-9310/default.nix @@ -1,16 +1,18 @@ -{ lib, pkgs, ... }: { +{ lib, pkgs, ... }: +{ imports = [ ../../../common/cpu/intel ../../../common/pc/laptop ../../../common/pc/ssd ]; - # Includes the Wi-Fi and Bluetooth firmware for the QCA6390. hardware.enableRedistributableFirmware = true; # Requires at least 5.12 for working wi-fi and bluetooth. - boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.12") (lib.mkDefault pkgs.linuxPackages_latest); + boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.12") ( + lib.mkDefault pkgs.linuxPackages_latest + ); # Touchpad goes over i2c. # Without this we get errors in dmesg on boot and hangs when shutting down. diff --git a/dell/xps/13-9315/default.nix b/dell/xps/13-9315/default.nix index 92ec28ce..c2a696b3 100644 --- a/dell/xps/13-9315/default.nix +++ b/dell/xps/13-9315/default.nix @@ -2,7 +2,8 @@ lib, pkgs, ... -}: { +}: +{ imports = [ ../../../common/cpu/intel ../../../common/pc/laptop @@ -14,7 +15,7 @@ hardware.enableRedistributableFirmware = true; # touchpad uses I²C, so PS/2 is unnecessary - boot.blacklistedKernelModules = ["psmouse"]; + boot.blacklistedKernelModules = [ "psmouse" ]; # enable finger print sensor # configure with `sudo fprintd-enroll ` @@ -29,5 +30,5 @@ services.thermald.enable = lib.mkDefault true; # fix laptop's screen flickering, see https://wiki.archlinux.org/title/Intel_graphics#Screen_flickering - boot.kernelParams = ["i915.enable_psr=0"]; + boot.kernelParams = [ "i915.enable_psr=0" ]; } diff --git a/dell/xps/13-9333/default.nix b/dell/xps/13-9333/default.nix index a17c094d..c848e808 100644 --- a/dell/xps/13-9333/default.nix +++ b/dell/xps/13-9333/default.nix @@ -7,6 +7,9 @@ # Required to allow the touchpad to work boot.kernelParams = [ "i8042.nopnp=1" ]; - boot.blacklistedKernelModules = [ "i2c_hid" "i2c_hid_acpi" ]; - boot.kernelModules = [ "synaptics_i2c"]; + boot.blacklistedKernelModules = [ + "i2c_hid" + "i2c_hid_acpi" + ]; + boot.kernelModules = [ "synaptics_i2c" ]; } diff --git a/dell/xps/13-9343/default.nix b/dell/xps/13-9343/default.nix index 9cab0427..e98bb09b 100644 --- a/dell/xps/13-9343/default.nix +++ b/dell/xps/13-9343/default.nix @@ -14,7 +14,10 @@ boot = { # needs to be explicitly loaded or else bluetooth/wifi won't work - kernelModules = [ "kvm-intel" "wl" ]; + kernelModules = [ + "kvm-intel" + "wl" + ]; extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ]; }; } diff --git a/dell/xps/15-7590/nvidia/default.nix b/dell/xps/15-7590/nvidia/default.nix index 78da989d..dc80a2a3 100644 --- a/dell/xps/15-7590/nvidia/default.nix +++ b/dell/xps/15-7590/nvidia/default.nix @@ -1,4 +1,4 @@ -{lib, ...}: +{ lib, ... }: { imports = [ ../. diff --git a/dell/xps/15-9510/default.nix b/dell/xps/15-9510/default.nix index 12a64450..14779f0f 100644 --- a/dell/xps/15-9510/default.nix +++ b/dell/xps/15-9510/default.nix @@ -1,4 +1,5 @@ -{ lib, ... }: { +{ lib, ... }: +{ imports = [ ../../../common/cpu/intel ../../../common/pc/laptop diff --git a/dell/xps/15-9510/nvidia/default.nix b/dell/xps/15-9510/nvidia/default.nix index 6ca0fd5a..248738a4 100644 --- a/dell/xps/15-9510/nvidia/default.nix +++ b/dell/xps/15-9510/nvidia/default.nix @@ -1,4 +1,5 @@ -{ lib, pkgs, ... }: { +{ lib, pkgs, ... }: +{ imports = [ ../../../../common/gpu/nvidia/prime.nix ../../../../common/gpu/nvidia/ampere @@ -11,7 +12,10 @@ graphics = { enable = lib.mkDefault true; enable32Bit = lib.mkDefault true; - extraPackages = with pkgs; [ intel-media-driver intel-compute-runtime ]; + extraPackages = with pkgs; [ + intel-media-driver + intel-compute-runtime + ]; }; nvidia = { prime = { diff --git a/dell/xps/15-9530/default.nix b/dell/xps/15-9530/default.nix index 99fd8a71..eb7a184b 100644 --- a/dell/xps/15-9530/default.nix +++ b/dell/xps/15-9530/default.nix @@ -14,7 +14,7 @@ # - 00:14.3 Network controller: Intel Corporation Raptor Lake PCH CNVi WiFi (rev 01) # > sudo lspci -vv -s 00:14.3 # 00:14.3 Network controller: Intel Corporation Raptor Lake PCH CNVi WiFi (rev 01) - # Subsystem: Intel Corporation Wi-Fi 6E AX211 160MHz + # Subsystem: Intel Corporation Wi-Fi 6E AX211 160MHz # # WiFi speed is slow and crashes by default (https://bugzilla.kernel.org/show_bug.cgi?id=213381) # disable_11ax - required until ax driver support is fixed diff --git a/dell/xps/15-9560/default.nix b/dell/xps/15-9560/default.nix index bae517d8..a5ffff66 100644 --- a/dell/xps/15-9560/default.nix +++ b/dell/xps/15-9560/default.nix @@ -12,10 +12,10 @@ hardware.nvidia.modesetting.enable = true; hardware.nvidia.prime = { - # integrated + # integrated intelBusId = "PCI:0:2:0"; - # dedicated + # dedicated nvidiaBusId = "PCI:1:0:0"; }; } diff --git a/dell/xps/15-9560/nvidia/default.nix b/dell/xps/15-9560/nvidia/default.nix index 8026a227..46b122b8 100644 --- a/dell/xps/15-9560/nvidia/default.nix +++ b/dell/xps/15-9560/nvidia/default.nix @@ -9,7 +9,6 @@ ../../../../common/gpu/nvidia/pascal ]; - # This runs only nvidia, great for games or heavy use of render applications ##### disable intel, run nvidia only and as default diff --git a/dell/xps/15-9570/nvidia/default.nix b/dell/xps/15-9570/nvidia/default.nix index 7cbb908a..ce1c8e04 100644 --- a/dell/xps/15-9570/nvidia/default.nix +++ b/dell/xps/15-9570/nvidia/default.nix @@ -6,7 +6,6 @@ ../shared.nix ]; - # This runs only nvidia, great for games or heavy use of render applications ##### disable intel, run nvidia only and as default diff --git a/dell/xps/15-9570/shared.nix b/dell/xps/15-9570/shared.nix index 06701e75..dcf9191b 100644 --- a/dell/xps/15-9570/shared.nix +++ b/dell/xps/15-9570/shared.nix @@ -1,7 +1,7 @@ { lib, ... }: { - imports = [ + imports = [ ../../../common/cpu/intel/coffee-lake ../../../common/pc/laptop ]; diff --git a/dell/xps/17-9700/common.nix b/dell/xps/17-9700/common.nix index 04241061..cb130350 100644 --- a/dell/xps/17-9700/common.nix +++ b/dell/xps/17-9700/common.nix @@ -10,17 +10,17 @@ # This will save you money and possibly your life! services.thermald.enable = lib.mkDefault true; - boot.kernelPatches = [{ - name = "enable-soundwire-drivers"; - patch = null; - extraConfig = '' - SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES y - SND_SOC_INTEL_SOUNDWIRE_SOF_MACH m - SND_SOC_RT1308 m - ''; - }]; + boot.kernelPatches = [ + { + name = "enable-soundwire-drivers"; + patch = null; + extraConfig = '' + SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES y + SND_SOC_INTEL_SOUNDWIRE_SOF_MACH m + SND_SOC_RT1308 m + ''; + } + ]; - boot.kernelPackages = - lib.mkIf (lib.versionOlder pkgs.linux.version "5.11") - pkgs.linuxPackages_latest; + boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.11") pkgs.linuxPackages_latest; } diff --git a/dell/xps/17-9710/intel/default.nix b/dell/xps/17-9710/intel/default.nix index b07c6095..3224b51a 100644 --- a/dell/xps/17-9710/intel/default.nix +++ b/dell/xps/17-9710/intel/default.nix @@ -1,4 +1,5 @@ -{ lib, pkgs, ... }: { +{ lib, pkgs, ... }: +{ imports = [ ../../../../common/cpu/intel ../../../../common/pc/laptop @@ -9,5 +10,7 @@ hardware.enableRedistributableFirmware = true; # Requires at least 5.12 for working sound - boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.12") (lib.mkDefault pkgs.linuxPackages_latest); + boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.12") ( + lib.mkDefault pkgs.linuxPackages_latest + ); } diff --git a/dell/xps/sleep-resume/bluetooth/default.nix b/dell/xps/sleep-resume/bluetooth/default.nix index e23e9c66..31731a1c 100644 --- a/dell/xps/sleep-resume/bluetooth/default.nix +++ b/dell/xps/sleep-resume/bluetooth/default.nix @@ -1,4 +1,9 @@ -{config, lib, pkgs, ...}: +{ + config, + lib, + pkgs, + ... +}: let inherit (lib) mkIf mkOption types; @@ -23,7 +28,8 @@ let }; cfg = config.services.sleep-resume.bluetooth; -in { +in +{ options = { services.sleep-resume.bluetooth = { enable = mkOption { diff --git a/dell/xps/sleep-resume/i2c-designware/default.nix b/dell/xps/sleep-resume/i2c-designware/default.nix index 55be5494..418abfb2 100644 --- a/dell/xps/sleep-resume/i2c-designware/default.nix +++ b/dell/xps/sleep-resume/i2c-designware/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let inherit (lib) mkIf mkOption types; @@ -22,7 +27,8 @@ let }; cfg = config.services.sleep-resume.i2c-designware; -in { +in +{ options = { services.sleep-resume.i2c-designware = { enable = mkOption { @@ -37,6 +43,3 @@ in { powerManagement.resumeCommands = "${reloadDesignware}/bin/reload-i2c-designware.sh"; }; } - - - diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..0477b1ca --- /dev/null +++ b/flake.lock @@ -0,0 +1,62 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1748995760, + "narHash": "sha256-f6UIyqm6JZs45pG667YdHOFYgDt+gvxQvt32ZLBp1h4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "26a54a5886c238b5df6f1e9ba0aa713434d73f06", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.05-small", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1747958103, + "narHash": "sha256-qmmFCrfBwSHoWw7cVK4Aj+fns+c54EBP8cGqp/yK410=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "fe51d34885f7b5e3e7b59572796e1bcb427eccb1", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "treefmt-nix": "treefmt-nix" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1748243702, + "narHash": "sha256-9YzfeN8CB6SzNPyPm2XjRRqSixDopTapaRsnTpXUEY8=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "1f3f7b784643d488ba4bf315638b2b0a4c5fb007", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index f7481983..4b2d832f 100644 --- a/flake.nix +++ b/flake.nix @@ -1,391 +1,417 @@ { description = "nixos-hardware"; - outputs = _: { - nixosModules = - let - deprecated = - issue: name: value: - builtins.trace "warning: ${name} flake output is deprecated and will be removed. See https://github.com/NixOS/nixos-hardware/issues/${issue} for more information" value; - import = path: path; # let the module system know what we are exporting - in - { - acer-aspire-4810t = import ./acer/aspire/4810t; - airis-n990 = import ./airis/n990; - aoostar-r1-n100 = import ./aoostar/r1/n100; - apple-imac-14-2 = import ./apple/imac/14-2; - apple-imac-18-2 = import ./apple/imac/18-2; - apple-macbook-air-3 = import ./apple/macbook-air/3; - apple-macbook-air-4 = import ./apple/macbook-air/4; - apple-macbook-air-6 = import ./apple/macbook-air/6; - apple-macbook-air-7 = import ./apple/macbook-air/7; - apple-macbook-pro = import ./apple/macbook-pro; - apple-macbook-pro-8-1 = import ./apple/macbook-pro/8-1; - apple-macbook-pro-10-1 = import ./apple/macbook-pro/10-1; - apple-macbook-pro-11-1 = import ./apple/macbook-pro/11-1; - apple-macbook-pro-11-5 = import ./apple/macbook-pro/11-5; - apple-macbook-pro-12-1 = import ./apple/macbook-pro/12-1; - apple-macbook-pro-14-1 = import ./apple/macbook-pro/14-1; - apple-macmini-4-1 = import ./apple/macmini/4; - apple-t2 = import ./apple/t2; - asus-battery = import ./asus/battery.nix; - asus-ally-rc71l = import ./asus/ally/rc71l; - asus-fx504gd = import ./asus/fx504gd; - asus-fx506hm = import ./asus/fx506hm; - asus-fa506ic = import ./asus/fa506ic; - asus-fa507nv = import ./asus/fa507nv; - asus-fa507rm = import ./asus/fa507rm; - asus-flow-gv302x-amdgpu = import ./asus/flow/gv302x/amdgpu; - asus-flow-gv302x-nvidia = import ./asus/flow/gv302x/nvidia; - asus-pro-ws-x570-ace = import ./asus/pro-ws-x570-ace; - asus-rog-strix-g513im = import ./asus/rog-strix/g513im; - asus-rog-strix-g533zw = import ./asus/rog-strix/g533zw; - asus-rog-strix-g713ie = import ./asus/rog-strix/g713ie; - asus-rog-strix-g733qs = import ./asus/rog-strix/g733qs; - asus-rog-strix-x570e = import ./asus/rog-strix/x570e; - asus-zenbook-ux371 = import ./asus/zenbook/ux371; - asus-zenbook-ux535 = import ./asus/zenbook/ux535; - asus-zenbook-ux481-intelgpu = import ./asus/zenbook/ux481/intelgpu; - asus-zenbook-ux481-nvidia = import ./asus/zenbook/ux481/nvidia; - asus-zephyrus-ga401 = import ./asus/zephyrus/ga401; - asus-zephyrus-ga402 = import ./asus/zephyrus/ga402; - asus-zephyrus-ga402x = import ./asus/zephyrus/ga402x; - asus-zephyrus-ga402x-amdgpu = import ./asus/zephyrus/ga402x/amdgpu; - asus-zephyrus-ga402x-nvidia = import ./asus/zephyrus/ga402x/nvidia; - asus-zephyrus-ga502 = import ./asus/zephyrus/ga502; - asus-zephyrus-ga503 = import ./asus/zephyrus/ga503; - asus-zephyrus-gu603h = import ./asus/zephyrus/gu603h; - asus-zephyrus-gu605my = import ./asus/zephyrus/gu605my; - beagleboard-pocketbeagle = import ./beagleboard/pocketbeagle; - chuwi-minibook-x = import ./chuwi/minibook-x; - deciso-dec = import ./deciso/dec; - dell-e7240 = - deprecated "1326" "dell-e7240" - (import ./dell/e7240); - dell-g3-3779 = import ./dell/g3/3779; - dell-g3-3579 = import ./dell/g3/3579; - dell-inspiron-14-5420 = import ./dell/inspiron/14-5420; - dell-inspiron-5509 = import ./dell/inspiron/5509; - dell-inspiron-5515 = import ./dell/inspiron/5515; - dell-inspiron-7405 = import ./dell/inspiron/7405; - dell-inspiron-7460 = import ./dell/inspiron/7460; - dell-inspiron-7559 = import ./dell/inspiron/7559; - dell-latitude-3340 = import ./dell/latitude/3340; - dell-latitude-3480 = import ./dell/latitude/3480; - dell-latitude-5490 = import ./dell/latitude/5490; - dell-latitude-5520 = import ./dell/latitude/5520; - dell-latitude-7280 = import ./dell/latitude/7280; - dell-latitude-7390 = import ./dell/latitude/7390; - dell-latitude-7420 = import ./dell/latitude/7420; - dell-latitude-7430 = import ./dell/latitude/7430; - dell-latitude-7490 = import ./dell/latitude/7490; - dell-latitude-9430 = import ./dell/latitude/9430; - dell-latitude-e7240 = import ./dell/latitude/e7240; - dell-optiplex-3050 = import ./dell/optiplex/3050; - dell-poweredge-r7515 = import ./dell/poweredge/r7515; - dell-precision-3490 = import ./dell/precision/3490; - dell-precision-3541 = import ./dell/precision/3541; - dell-precision-5490 = import ./dell/precision/5490; - dell-precision-5530 = import ./dell/precision/5530; - dell-precision-5560 = import ./dell/precision/5560; - dell-precision-7520 = import ./dell/precision/7520; - dell-xps-13-7390 = import ./dell/xps/13-7390; - dell-xps-13-9300 = import ./dell/xps/13-9300; - dell-xps-13-9310 = import ./dell/xps/13-9310; - dell-xps-13-9315 = import ./dell/xps/13-9315; - dell-xps-13-9333 = import ./dell/xps/13-9333; - dell-xps-13-9343 = import ./dell/xps/13-9343; - dell-xps-13-9350 = import ./dell/xps/13-9350; - dell-xps-13-9360 = import ./dell/xps/13-9360; - dell-xps-13-9370 = import ./dell/xps/13-9370; - dell-xps-13-9380 = import ./dell/xps/13-9380; - dell-xps-15-7590 = import ./dell/xps/15-7590; - dell-xps-15-7590-nvidia = import ./dell/xps/15-7590/nvidia; - dell-xps-15-9500 = import ./dell/xps/15-9500; - dell-xps-15-9500-nvidia = import ./dell/xps/15-9500/nvidia; - dell-xps-15-9510 = import ./dell/xps/15-9510; - dell-xps-15-9510-nvidia = import ./dell/xps/15-9510/nvidia; - dell-xps-15-9520 = import ./dell/xps/15-9520; - dell-xps-15-9520-nvidia = import ./dell/xps/15-9520/nvidia; - dell-xps-15-9530 = import ./dell/xps/15-9530; - dell-xps-15-9530-nvidia = import ./dell/xps/15-9530/nvidia; - dell-xps-15-9550 = import ./dell/xps/15-9550; - dell-xps-15-9550-nvidia = import ./dell/xps/15-9550/nvidia; - dell-xps-15-9560 = import ./dell/xps/15-9560; - dell-xps-15-9560-intel = import ./dell/xps/15-9560/intel; - dell-xps-15-9560-nvidia = import ./dell/xps/15-9560/nvidia; - dell-xps-15-9570 = import ./dell/xps/15-9570; - dell-xps-15-9570-intel = import ./dell/xps/15-9570/intel; - dell-xps-15-9570-nvidia = import ./dell/xps/15-9570/nvidia; - dell-xps-17-9700-intel = import ./dell/xps/17-9700/intel; - dell-xps-17-9700-nvidia = import ./dell/xps/17-9700/nvidia; - dell-xps-17-9710-intel = import ./dell/xps/17-9710/intel; - framework = import ./framework; - framework-11th-gen-intel = import ./framework/13-inch/11th-gen-intel; - framework-12th-gen-intel = import ./framework/13-inch/12th-gen-intel; - framework-13th-gen-intel = import ./framework/13-inch/13th-gen-intel; - framework-12-13th-gen-intel = import ./framework/12-inch/13th-gen-intel; - framework-intel-core-ultra-series1 = import ./framework/13-inch/intel-core-ultra-series1; - framework-13-7040-amd = import ./framework/13-inch/7040-amd; - framework-amd-ai-300-series = import ./framework/13-inch/amd-ai-300-series; - framework-16-7040-amd = import ./framework/16-inch/7040-amd; - friendlyarm-nanopc-t4 = import ./friendlyarm/nanopc-t4; - friendlyarm-nanopi-r5s = import ./friendlyarm/nanopi-r5s; - focus-m2-gen1 = import ./focus/m2/gen1; - gigabyte-b550 = import ./gigabyte/b550; - gigabyte-b650 = import ./gigabyte/b650; - gmktec-nucbox-g3-plus = import ./gmktec/nucbox/g3-plus; - google-pixelbook = import ./google/pixelbook; - gpd-micropc = import ./gpd/micropc; - gpd-p2-max = import ./gpd/p2-max; - gpd-pocket-3 = import ./gpd/pocket-3; - gpd-pocket-4 = import ./gpd/pocket-4; - gpd-win-2 = import ./gpd/win-2; - gpd-win-max-2-2023 = import ./gpd/win-max-2/2023; - gpd-win-mini-2024 = import ./gpd/win-mini/2024; - hp-elitebook-2560p = import ./hp/elitebook/2560p; - hp-elitebook-830g6 = import ./hp/elitebook/830/g6; - hp-elitebook-845g7 = import ./hp/elitebook/845/g7; - hp-elitebook-845g8 = import ./hp/elitebook/845/g8; - hp-elitebook-845g9 = import ./hp/elitebook/845/g9; - hp-probook-440G5 = import ./hp/probook/440G5; - hp-laptop-14s-dq2024nf = import ./hp/laptop/14s-dq2024nf; - huawei-machc-wa = import ./huawei/machc-wa; - hp-notebook-14-df0023 = import ./hp/notebook/14-df0023; - intel-nuc-8i7beh = import ./intel/nuc/8i7beh; - lenovo-ideacentre-k330 = import ./lenovo/ideacentre/k330; - lenovo-ideapad-14imh9 = import ./lenovo/ideapad/14imh9; - lenovo-ideapad-15alc6 = import ./lenovo/ideapad/15alc6; - lenovo-ideapad-15arh05 = import ./lenovo/ideapad/15arh05; - lenovo-ideapad-15ach6 = import ./lenovo/ideapad/15ach6; - lenovo-ideapad-16ach6 = import ./lenovo/ideapad/16ach6; - lenovo-ideapad-16ahp9 = import ./lenovo/ideapad/16ahp9; - lenovo-ideapad-z510 = import ./lenovo/ideapad/z510; - lenovo-ideapad-slim-5 = import ./lenovo/ideapad/slim-5; - lenovo-ideapad-s145-15api = import ./lenovo/ideapad/s145-15api; - lenovo-legion-15ach6 = import ./lenovo/legion/15ach6; - lenovo-legion-15ach6h = import ./lenovo/legion/15ach6h; - lenovo-legion-15arh05h = import ./lenovo/legion/15arh05h; - lenovo-legion-16ach6h = import ./lenovo/legion/16ach6h; - lenovo-legion-16ach6h-hybrid = import ./lenovo/legion/16ach6h/hybrid; - lenovo-legion-16ach6h-nvidia = import ./lenovo/legion/16ach6h/nvidia; - lenovo-legion-16arh7h-igpu-only = import ./lenovo/legion/16arh7h/igpu-only; - lenovo-legion-16arh7h-hybrid = import ./lenovo/legion/16arh7h/hybrid; - lenovo-legion-16achg6-hybrid = import ./lenovo/legion/16achg6/hybrid; - lenovo-legion-16achg6-nvidia = import ./lenovo/legion/16achg6/nvidia; - lenovo-legion-16aph8 = import ./lenovo/legion/16aph8; - lenovo-legion-16arha7 = import ./lenovo/legion/16arha7; - lenovo-legion-16ithg6 = import ./lenovo/legion/16ithg6; - lenovo-legion-16irx8h = import ./lenovo/legion/16irx8h; - lenovo-legion-16irx9h = import ./lenovo/legion/16irx9h; - lenovo-legion-t526amr5 = import ./lenovo/legion/t526amr5; - lenovo-legion-y530-15ich = import ./lenovo/legion/15ich; - lenovo-thinkpad = import ./lenovo/thinkpad; - lenovo-thinkpad-a475 = import ./lenovo/thinkpad/a475; - lenovo-thinkpad-e14-amd = import ./lenovo/thinkpad/e14/amd; - lenovo-thinkpad-e14-intel = import ./lenovo/thinkpad/e14/intel; - lenovo-thinkpad-e14-intel-gen4 = import ./lenovo/thinkpad/e14/intel/gen4; - lenovo-thinkpad-e14-intel-gen6 = import ./lenovo/thinkpad/e14/intel/gen6; - lenovo-thinkpad-e15-intel = import ./lenovo/thinkpad/e15/intel; - lenovo-thinkpad-e470 = import ./lenovo/thinkpad/e470; - lenovo-thinkpad-e495 = import ./lenovo/thinkpad/e495; - lenovo-thinkpad-l13 = import ./lenovo/thinkpad/l13; - lenovo-thinkpad-l13-yoga = import ./lenovo/thinkpad/l13/yoga; - lenovo-thinkpad-l14-amd = import ./lenovo/thinkpad/l14/amd; - lenovo-thinkpad-l14-intel = import ./lenovo/thinkpad/l14/intel; - lenovo-thinkpad-l480 = import ./lenovo/thinkpad/l480; - lenovo-thinkpad-p1 = import ./lenovo/thinkpad/p1; - lenovo-thinkpad-p1-gen3 = import ./lenovo/thinkpad/p1/3th-gen; - lenovo-thinkpad-p14s-amd-gen1 = import ./lenovo/thinkpad/p14s/amd/gen1; - lenovo-thinkpad-p14s-amd-gen2 = import ./lenovo/thinkpad/p14s/amd/gen2; - lenovo-thinkpad-p14s-amd-gen3 = import ./lenovo/thinkpad/p14s/amd/gen3; - lenovo-thinkpad-p14s-amd-gen4 = import ./lenovo/thinkpad/p14s/amd/gen4; - lenovo-thinkpad-p14s-amd-gen5 = import ./lenovo/thinkpad/p14s/amd/gen5; - lenovo-thinkpad-p14s-intel-gen3 = import ./lenovo/thinkpad/p14s/intel/gen3; - lenovo-thinkpad-p14s-intel-gen5 = import ./lenovo/thinkpad/p14s/intel/gen5; - lenovo-thinkpad-p16s-amd-gen1 = import ./lenovo/thinkpad/p16s/amd/gen1; - lenovo-thinkpad-p16s-amd-gen2 = import ./lenovo/thinkpad/p16s/amd/gen2; - lenovo-thinkpad-p16s-intel-gen2 = import ./lenovo/thinkpad/p16s/intel/gen2; - lenovo-thinkpad-p43s = import ./lenovo/thinkpad/p43s; - lenovo-thinkpad-p50 = import ./lenovo/thinkpad/p50; - lenovo-thinkpad-p51 = import ./lenovo/thinkpad/p51; - lenovo-thinkpad-p52 = import ./lenovo/thinkpad/p52; - lenovo-thinkpad-p53 = import ./lenovo/thinkpad/p53; - lenovo-thinkpad-t14 = import ./lenovo/thinkpad/t14; - lenovo-thinkpad-t14-amd-gen1 = import ./lenovo/thinkpad/t14/amd/gen1; - lenovo-thinkpad-t14-amd-gen2 = import ./lenovo/thinkpad/t14/amd/gen2; - lenovo-thinkpad-t14-amd-gen3 = import ./lenovo/thinkpad/t14/amd/gen3; - lenovo-thinkpad-t14-amd-gen4 = import ./lenovo/thinkpad/t14/amd/gen4; - lenovo-thinkpad-t14-amd-gen5 = import ./lenovo/thinkpad/t14/amd/gen5; - lenovo-thinkpad-t14s = import ./lenovo/thinkpad/t14s; - lenovo-thinkpad-t14s-amd-gen1 = import ./lenovo/thinkpad/t14s/amd/gen1; - lenovo-thinkpad-t14s-amd-gen4 = import ./lenovo/thinkpad/t14s/amd/gen4; - lenovo-thinkpad-t410 = import ./lenovo/thinkpad/t410; - lenovo-thinkpad-t420 = import ./lenovo/thinkpad/t420; - lenovo-thinkpad-t430 = import ./lenovo/thinkpad/t430; - lenovo-thinkpad-t440p = import ./lenovo/thinkpad/t440p; - lenovo-thinkpad-t440s = import ./lenovo/thinkpad/t440s; - lenovo-thinkpad-t450s = import ./lenovo/thinkpad/t450s; - lenovo-thinkpad-t460 = import ./lenovo/thinkpad/t460; - lenovo-thinkpad-t460p = import ./lenovo/thinkpad/t460p; - lenovo-thinkpad-t460s = import ./lenovo/thinkpad/t460s; - lenovo-thinkpad-t470s = import ./lenovo/thinkpad/t470s; - lenovo-thinkpad-t480 = import ./lenovo/thinkpad/t480; - lenovo-thinkpad-t480s = import ./lenovo/thinkpad/t480s; - lenovo-thinkpad-t490 = import ./lenovo/thinkpad/t490; - lenovo-thinkpad-t490s = import ./lenovo/thinkpad/t490s; - lenovo-thinkpad-t495 = import ./lenovo/thinkpad/t495; - lenovo-thinkpad-t520 = import ./lenovo/thinkpad/t520; - lenovo-thinkpad-w520 = import ./lenovo/thinkpad/w520; - lenovo-thinkpad-t550 = import ./lenovo/thinkpad/t550; - lenovo-thinkpad-t590 = import ./lenovo/thinkpad/t590; - lenovo-thinkpad-x1 = import ./lenovo/thinkpad/x1; - lenovo-thinkpad-x1-yoga = import ./lenovo/thinkpad/x1/yoga; - lenovo-thinkpad-x1-yoga-7th-gen = import ./lenovo/thinkpad/x1/yoga/7th-gen; - lenovo-thinkpad-x1-yoga-8th-gen = import ./lenovo/thinkpad/x1/yoga/8th-gen; - lenovo-thinkpad-x1-2nd-gen = import ./lenovo/thinkpad/x1/2nd-gen; - lenovo-thinkpad-x1-6th-gen = import ./lenovo/thinkpad/x1/6th-gen; - lenovo-thinkpad-x1-7th-gen = import ./lenovo/thinkpad/x1/7th-gen; - lenovo-thinkpad-x1-9th-gen = import ./lenovo/thinkpad/x1/9th-gen; - lenovo-thinkpad-x1-10th-gen = import ./lenovo/thinkpad/x1/10th-gen; - lenovo-thinkpad-x1-11th-gen = import ./lenovo/thinkpad/x1/11th-gen; - lenovo-thinkpad-x1-12th-gen = import ./lenovo/thinkpad/x1/12th-gen; - lenovo-thinkpad-x1-13th-gen = import ./lenovo/thinkpad/x1/13th-gen; - lenovo-thinkpad-x1-extreme = import ./lenovo/thinkpad/x1-extreme; - lenovo-thinkpad-x1-extreme-gen2 = import ./lenovo/thinkpad/x1-extreme/gen2; - lenovo-thinkpad-x1-extreme-gen3 = import ./lenovo/thinkpad/x1-extreme/gen3; - lenovo-thinkpad-x1-extreme-gen4 = import ./lenovo/thinkpad/x1-extreme/gen4; - lenovo-thinkpad-x1-nano = import ./lenovo/thinkpad/x1-nano; - lenovo-thinkpad-x1-nano-gen1 = import ./lenovo/thinkpad/x1-nano/gen1; - lenovo-thinkpad-x13 = import ./lenovo/thinkpad/x13/intel; - lenovo-thinkpad-x13-amd = import ./lenovo/thinkpad/x13/amd; - lenovo-thinkpad-x13-yoga = import ./lenovo/thinkpad/x13/yoga; - lenovo-thinkpad-x13-yoga-3th-gen = import ./lenovo/thinkpad/x13/yoga/3th-gen; - lenovo-thinkpad-x13s = import ./lenovo/thinkpad/x13s; - lenovo-thinkpad-x140e = import ./lenovo/thinkpad/x140e; - lenovo-thinkpad-x200s = import ./lenovo/thinkpad/x200s; - lenovo-thinkpad-x220 = import ./lenovo/thinkpad/x220; - lenovo-thinkpad-x230 = import ./lenovo/thinkpad/x230; - lenovo-thinkpad-x250 = import ./lenovo/thinkpad/x250; - lenovo-thinkpad-x260 = import ./lenovo/thinkpad/x260; - lenovo-thinkpad-x270 = import ./lenovo/thinkpad/x270; - lenovo-thinkpad-x280 = import ./lenovo/thinkpad/x280; - lenovo-thinkpad-x390 = import ./lenovo/thinkpad/x390; - lenovo-thinkpad-z = import ./lenovo/thinkpad/z; - lenovo-thinkpad-z13-gen1 = import ./lenovo/thinkpad/z/gen1/z13; - lenovo-thinkpad-z13-gen2 = import ./lenovo/thinkpad/z/gen2/z13; - lenovo-yoga-6-13ALC6 = import ./lenovo/yoga/6/13ALC6; - lenovo-yoga-7-14ARH7 = import ./lenovo/yoga/7/14ARH7; - lenovo-yoga-7-14ARH7-amdgpu = import ./lenovo/yoga/7/14ARH7/amdgpu; - lenovo-yoga-7-14ARH7-nvidia = import ./lenovo/yoga/7/14ARH7/nvidia; - lenovo-yoga-7-14IAH7-integrated = import ./lenovo/yoga/7/14IAH7/integrated; - lenovo-yoga-7-14IAH7-hybrid = import ./lenovo/yoga/7/14IAH7/hybrid; - lenovo-yoga-7-14ILL10 = import ./lenovo/yoga/7/14ILL10; - lenovo-yoga-7-slim-gen8 = import ./lenovo/yoga/7/slim/gen8; - letsnote-cf-lx4 = import ./panasonic/letsnote/cf-lx4; - malibal-aon-s1-intel = import ./malibal/aon/s1; - microchip-icicle-kit = import ./microchip/icicle-kit; - microsoft-surface-go = import ./microsoft/surface/surface-go; - microsoft-surface-pro-intel = import ./microsoft/surface/surface-pro-intel; - microsoft-surface-laptop-amd = import ./microsoft/surface/surface-laptop-amd; - microsoft-surface-common = import ./microsoft/surface/common; - microsoft-surface-pro-3 = import ./microsoft/surface-pro/3; - microsoft-surface-pro-9 = import ./microsoft/surface-pro/9; - milkv-pioneer = import ./milkv/pioneer; - minisforum-v3 = import ./minisforum/v3; - morefine-m600 = import ./morefine/m600; - msi-b350-tomahawk = import ./msi/b350-tomahawk; - msi-b550-a-pro = import ./msi/b550-a-pro; - msi-gs60 = import ./msi/gs60; - msi-gl62 = import ./msi/gl62; - msi-gl65-10SDR-492 = import ./msi/gl65/10SDR-492; - nxp-imx8mp-evk = import ./nxp/imx8mp-evk; - nxp-imx8mq-evk = import ./nxp/imx8mq-evk; - nxp-imx8qm-mek = import ./nxp/imx8qm-mek; - hardkernel-odroid-hc4 = import ./hardkernel/odroid-hc4; - hardkernel-odroid-h3 = import ./hardkernel/odroid-h3; - hardkernel-odroid-h4 = import ./hardkernel/odroid-h4; - omen-14-fb0798ng = import ./omen/14-fb0798ng; - omen-15-ce002ns = import ./omen/15-ce002ns; - omen-15-en0010ca = import ./omen/15-en0010ca; - omen-16-n0005ne = import ./omen/16-n0005ne; - omen-16-n0280nd = import ./omen/16-n0280nd; - omen-15-en1007sa = import ./omen/15-en1007sa; - omen-15-en0002np = import ./omen/15-en0002np; - onenetbook-4 = import ./onenetbook/4; - olimex-teres_i = import ./olimex/teres_i; - pcengines-apu = import ./pcengines/apu; - pine64-pinebook-pro = import ./pine64/pinebook-pro; - pine64-rockpro64 = import ./pine64/rockpro64; - pine64-star64 = import ./pine64/star64; - protectli-vp4670 = import ./protectli/vp4670; - purism-librem-13v3 = import ./purism/librem/13v3; - purism-librem-15v3 = import ./purism/librem/15v3; - purism-librem-5r4 = import ./purism/librem/5r4; - raspberry-pi-2 = import ./raspberry-pi/2; - raspberry-pi-3 = import ./raspberry-pi/3; - raspberry-pi-4 = import ./raspberry-pi/4; - raspberry-pi-5 = import ./raspberry-pi/5; - rock-4c-plus = import ./radxa/rock-4c-plus; - rock-5b = import ./radxa/rock-5b; - rock-pi-4 = import ./radxa/rock-pi-4; - rock-pi-e = import ./radxa/rock-pi-e; - kobol-helios4 = import ./kobol/helios4; - samsung-np900x3c = import ./samsung/np900x3c; - slimbook-hero-rpl-rtx = import ./slimbook/hero/rpl-rtx; - starfive-visionfive-v1 = import ./starfive/visionfive/v1; - starfive-visionfive-2 = import ./starfive/visionfive/v2; - starlabs-starlite-i5 = import ./starlabs/starlite/i5; - supermicro = import ./supermicro; - supermicro-a1sri-2758f = import ./supermicro/a1sri-2758f; - supermicro-m11sdv-8c-ln4f = import ./supermicro/m11sdv-8c-ln4f; - supermicro-x10sll-f = import ./supermicro/x10sll-f; - supermicro-x12scz-tln4f = import ./supermicro/x12scz-tln4f; - system76 = import ./system76; - system76-gaze18 = import ./system76/gaze18; - system76-galp5-1650 = import ./system76/galp5-1650; - system76-darp6 = import ./system76/darp6; - toshiba-swanky = import ./toshiba/swanky; - tuxedo-aura-15-gen1 = import ./tuxedo/aura/15/gen1; - tuxedo-infinitybook-v4 = import ./tuxedo/infinitybook/v4; - tuxedo-infinitybook-pro14-gen7 = import ./tuxedo/infinitybook/pro14/gen7; - tuxedo-infinitybook-pro14-gen9-intel = import ./tuxedo/infinitybook/pro14/gen9/intel; - tuxedo-pulse-14-gen3 = import ./tuxedo/pulse/14/gen3; - tuxedo-pulse-15-gen2 = import ./tuxedo/pulse/15/gen2; - xiaomi-redmibook-16-pro-2024 = import ./xiaomi/redmibook/16-pro-2024; - - common-cpu-amd = import ./common/cpu/amd; - common-cpu-amd-pstate = import ./common/cpu/amd/pstate.nix; - common-cpu-amd-zenpower = import ./common/cpu/amd/zenpower.nix; - common-cpu-amd-raphael-igpu = import ./common/cpu/amd/raphael/igpu.nix; - common-cpu-intel = import ./common/cpu/intel; - common-gpu-intel-comet-lake = - deprecated "992" "common-gpu-intel-comet-lake" - (import ./common/gpu/intel/comet-lake); - common-cpu-intel-cpu-only = import ./common/cpu/intel/cpu-only.nix; - common-gpu-intel-kaby-lake = - deprecated "992" "common-gpu-intel-kaby-lake" - (import ./common/gpu/intel/kaby-lake); - common-gpu-intel-sandy-bridge = - deprecated "992" "common-gpu-intel-sandy-bridge" - (import ./common/gpu/intel/sandy-bridge); - common-gpu-amd = import ./common/gpu/amd; - common-gpu-amd-sea-islands = import ./common/gpu/amd/sea-islands; - common-gpu-amd-southern-islands = import ./common/gpu/amd/southern-islands; - common-gpu-intel = import ./common/gpu/intel; - common-gpu-intel-disable = import ./common/gpu/intel/disable.nix; - common-gpu-nvidia = import ./common/gpu/nvidia/prime.nix; - common-gpu-nvidia-sync = import ./common/gpu/nvidia/prime-sync.nix; - common-gpu-nvidia-nonprime = import ./common/gpu/nvidia; - common-gpu-nvidia-disable = import ./common/gpu/nvidia/disable.nix; - common-hidpi = import ./common/hidpi.nix; - common-pc = import ./common/pc; - common-pc-hdd = import ./common/pc/hdd; - common-pc-laptop = import ./common/pc/laptop; - common-pc-laptop-acpi_call = throw "common-pc-laptop-acpi_call has been removed because it is obsolete: https://github.com/NixOS/nixos-hardware/issues/1114"; - common-pc-laptop-hdd = import ./common/pc/laptop/hdd; - common-pc-laptop-ssd = import ./common/pc/ssd; - common-pc-ssd = import ./common/pc/ssd; - }; + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05-small"; + treefmt-nix.url = "github:numtide/treefmt-nix"; }; + + outputs = + { + nixpkgs, + self, + treefmt-nix, + }: + let + systems = [ + "aarch64-darwin" + "aarch64-linux" + "x86_64-darwin" + "x86_64-linux" + ]; + forEachSystem = + function: nixpkgs.lib.genAttrs (systems) (system: function nixpkgs.legacyPackages.${system}); + + treefmtEval = forEachSystem (pkgs: treefmt-nix.lib.evalModule pkgs ./treefmt.nix); + in + { + checks = forEachSystem (pkgs: { + formatting = treefmtEval.${pkgs.system}.config.build.check self; + }); + formatter = forEachSystem (pkgs: treefmtEval.${pkgs.system}.config.build.wrapper); + + nixosModules = + let + deprecated = + issue: name: value: + builtins.trace "warning: ${name} flake output is deprecated and will be removed. See https://github.com/NixOS/nixos-hardware/issues/${issue} for more information" value; + import = path: path; # let the module system know what we are exporting + in + { + acer-aspire-4810t = import ./acer/aspire/4810t; + airis-n990 = import ./airis/n990; + aoostar-r1-n100 = import ./aoostar/r1/n100; + apple-imac-14-2 = import ./apple/imac/14-2; + apple-imac-18-2 = import ./apple/imac/18-2; + apple-macbook-air-3 = import ./apple/macbook-air/3; + apple-macbook-air-4 = import ./apple/macbook-air/4; + apple-macbook-air-6 = import ./apple/macbook-air/6; + apple-macbook-air-7 = import ./apple/macbook-air/7; + apple-macbook-pro = import ./apple/macbook-pro; + apple-macbook-pro-8-1 = import ./apple/macbook-pro/8-1; + apple-macbook-pro-10-1 = import ./apple/macbook-pro/10-1; + apple-macbook-pro-11-1 = import ./apple/macbook-pro/11-1; + apple-macbook-pro-11-5 = import ./apple/macbook-pro/11-5; + apple-macbook-pro-12-1 = import ./apple/macbook-pro/12-1; + apple-macbook-pro-14-1 = import ./apple/macbook-pro/14-1; + apple-macmini-4-1 = import ./apple/macmini/4; + apple-t2 = import ./apple/t2; + asus-battery = import ./asus/battery.nix; + asus-ally-rc71l = import ./asus/ally/rc71l; + asus-fx504gd = import ./asus/fx504gd; + asus-fx506hm = import ./asus/fx506hm; + asus-fa506ic = import ./asus/fa506ic; + asus-fa507nv = import ./asus/fa507nv; + asus-fa507rm = import ./asus/fa507rm; + asus-flow-gv302x-amdgpu = import ./asus/flow/gv302x/amdgpu; + asus-flow-gv302x-nvidia = import ./asus/flow/gv302x/nvidia; + asus-pro-ws-x570-ace = import ./asus/pro-ws-x570-ace; + asus-rog-strix-g513im = import ./asus/rog-strix/g513im; + asus-rog-strix-g533zw = import ./asus/rog-strix/g533zw; + asus-rog-strix-g713ie = import ./asus/rog-strix/g713ie; + asus-rog-strix-g733qs = import ./asus/rog-strix/g733qs; + asus-rog-strix-x570e = import ./asus/rog-strix/x570e; + asus-zenbook-ux371 = import ./asus/zenbook/ux371; + asus-zenbook-ux535 = import ./asus/zenbook/ux535; + asus-zenbook-ux481-intelgpu = import ./asus/zenbook/ux481/intelgpu; + asus-zenbook-ux481-nvidia = import ./asus/zenbook/ux481/nvidia; + asus-zephyrus-ga401 = import ./asus/zephyrus/ga401; + asus-zephyrus-ga402 = import ./asus/zephyrus/ga402; + asus-zephyrus-ga402x = import ./asus/zephyrus/ga402x; + asus-zephyrus-ga402x-amdgpu = import ./asus/zephyrus/ga402x/amdgpu; + asus-zephyrus-ga402x-nvidia = import ./asus/zephyrus/ga402x/nvidia; + asus-zephyrus-ga502 = import ./asus/zephyrus/ga502; + asus-zephyrus-ga503 = import ./asus/zephyrus/ga503; + asus-zephyrus-gu603h = import ./asus/zephyrus/gu603h; + asus-zephyrus-gu605my = import ./asus/zephyrus/gu605my; + beagleboard-pocketbeagle = import ./beagleboard/pocketbeagle; + chuwi-minibook-x = import ./chuwi/minibook-x; + deciso-dec = import ./deciso/dec; + dell-e7240 = deprecated "1326" "dell-e7240" (import ./dell/e7240); + dell-g3-3779 = import ./dell/g3/3779; + dell-g3-3579 = import ./dell/g3/3579; + dell-inspiron-14-5420 = import ./dell/inspiron/14-5420; + dell-inspiron-5509 = import ./dell/inspiron/5509; + dell-inspiron-5515 = import ./dell/inspiron/5515; + dell-inspiron-7405 = import ./dell/inspiron/7405; + dell-inspiron-7460 = import ./dell/inspiron/7460; + dell-inspiron-7559 = import ./dell/inspiron/7559; + dell-latitude-3340 = import ./dell/latitude/3340; + dell-latitude-3480 = import ./dell/latitude/3480; + dell-latitude-5490 = import ./dell/latitude/5490; + dell-latitude-5520 = import ./dell/latitude/5520; + dell-latitude-7280 = import ./dell/latitude/7280; + dell-latitude-7390 = import ./dell/latitude/7390; + dell-latitude-7420 = import ./dell/latitude/7420; + dell-latitude-7430 = import ./dell/latitude/7430; + dell-latitude-7490 = import ./dell/latitude/7490; + dell-latitude-9430 = import ./dell/latitude/9430; + dell-latitude-e7240 = import ./dell/latitude/e7240; + dell-optiplex-3050 = import ./dell/optiplex/3050; + dell-poweredge-r7515 = import ./dell/poweredge/r7515; + dell-precision-3490 = import ./dell/precision/3490; + dell-precision-3541 = import ./dell/precision/3541; + dell-precision-5490 = import ./dell/precision/5490; + dell-precision-5530 = import ./dell/precision/5530; + dell-precision-5560 = import ./dell/precision/5560; + dell-precision-7520 = import ./dell/precision/7520; + dell-xps-13-7390 = import ./dell/xps/13-7390; + dell-xps-13-9300 = import ./dell/xps/13-9300; + dell-xps-13-9310 = import ./dell/xps/13-9310; + dell-xps-13-9315 = import ./dell/xps/13-9315; + dell-xps-13-9333 = import ./dell/xps/13-9333; + dell-xps-13-9343 = import ./dell/xps/13-9343; + dell-xps-13-9350 = import ./dell/xps/13-9350; + dell-xps-13-9360 = import ./dell/xps/13-9360; + dell-xps-13-9370 = import ./dell/xps/13-9370; + dell-xps-13-9380 = import ./dell/xps/13-9380; + dell-xps-15-7590 = import ./dell/xps/15-7590; + dell-xps-15-7590-nvidia = import ./dell/xps/15-7590/nvidia; + dell-xps-15-9500 = import ./dell/xps/15-9500; + dell-xps-15-9500-nvidia = import ./dell/xps/15-9500/nvidia; + dell-xps-15-9510 = import ./dell/xps/15-9510; + dell-xps-15-9510-nvidia = import ./dell/xps/15-9510/nvidia; + dell-xps-15-9520 = import ./dell/xps/15-9520; + dell-xps-15-9520-nvidia = import ./dell/xps/15-9520/nvidia; + dell-xps-15-9530 = import ./dell/xps/15-9530; + dell-xps-15-9530-nvidia = import ./dell/xps/15-9530/nvidia; + dell-xps-15-9550 = import ./dell/xps/15-9550; + dell-xps-15-9550-nvidia = import ./dell/xps/15-9550/nvidia; + dell-xps-15-9560 = import ./dell/xps/15-9560; + dell-xps-15-9560-intel = import ./dell/xps/15-9560/intel; + dell-xps-15-9560-nvidia = import ./dell/xps/15-9560/nvidia; + dell-xps-15-9570 = import ./dell/xps/15-9570; + dell-xps-15-9570-intel = import ./dell/xps/15-9570/intel; + dell-xps-15-9570-nvidia = import ./dell/xps/15-9570/nvidia; + dell-xps-17-9700-intel = import ./dell/xps/17-9700/intel; + dell-xps-17-9700-nvidia = import ./dell/xps/17-9700/nvidia; + dell-xps-17-9710-intel = import ./dell/xps/17-9710/intel; + framework = import ./framework; + framework-11th-gen-intel = import ./framework/13-inch/11th-gen-intel; + framework-12th-gen-intel = import ./framework/13-inch/12th-gen-intel; + framework-13th-gen-intel = import ./framework/13-inch/13th-gen-intel; + framework-12-13th-gen-intel = import ./framework/12-inch/13th-gen-intel; + framework-intel-core-ultra-series1 = import ./framework/13-inch/intel-core-ultra-series1; + framework-13-7040-amd = import ./framework/13-inch/7040-amd; + framework-amd-ai-300-series = import ./framework/13-inch/amd-ai-300-series; + framework-16-7040-amd = import ./framework/16-inch/7040-amd; + friendlyarm-nanopc-t4 = import ./friendlyarm/nanopc-t4; + friendlyarm-nanopi-r5s = import ./friendlyarm/nanopi-r5s; + focus-m2-gen1 = import ./focus/m2/gen1; + gigabyte-b550 = import ./gigabyte/b550; + gigabyte-b650 = import ./gigabyte/b650; + gmktec-nucbox-g3-plus = import ./gmktec/nucbox/g3-plus; + google-pixelbook = import ./google/pixelbook; + gpd-micropc = import ./gpd/micropc; + gpd-p2-max = import ./gpd/p2-max; + gpd-pocket-3 = import ./gpd/pocket-3; + gpd-pocket-4 = import ./gpd/pocket-4; + gpd-win-2 = import ./gpd/win-2; + gpd-win-max-2-2023 = import ./gpd/win-max-2/2023; + gpd-win-mini-2024 = import ./gpd/win-mini/2024; + hp-elitebook-2560p = import ./hp/elitebook/2560p; + hp-elitebook-830g6 = import ./hp/elitebook/830/g6; + hp-elitebook-845g7 = import ./hp/elitebook/845/g7; + hp-elitebook-845g8 = import ./hp/elitebook/845/g8; + hp-elitebook-845g9 = import ./hp/elitebook/845/g9; + hp-probook-440G5 = import ./hp/probook/440G5; + hp-laptop-14s-dq2024nf = import ./hp/laptop/14s-dq2024nf; + huawei-machc-wa = import ./huawei/machc-wa; + hp-notebook-14-df0023 = import ./hp/notebook/14-df0023; + intel-nuc-8i7beh = import ./intel/nuc/8i7beh; + lenovo-ideacentre-k330 = import ./lenovo/ideacentre/k330; + lenovo-ideapad-14imh9 = import ./lenovo/ideapad/14imh9; + lenovo-ideapad-15alc6 = import ./lenovo/ideapad/15alc6; + lenovo-ideapad-15arh05 = import ./lenovo/ideapad/15arh05; + lenovo-ideapad-15ach6 = import ./lenovo/ideapad/15ach6; + lenovo-ideapad-16ach6 = import ./lenovo/ideapad/16ach6; + lenovo-ideapad-16ahp9 = import ./lenovo/ideapad/16ahp9; + lenovo-ideapad-z510 = import ./lenovo/ideapad/z510; + lenovo-ideapad-slim-5 = import ./lenovo/ideapad/slim-5; + lenovo-ideapad-s145-15api = import ./lenovo/ideapad/s145-15api; + lenovo-legion-15ach6 = import ./lenovo/legion/15ach6; + lenovo-legion-15ach6h = import ./lenovo/legion/15ach6h; + lenovo-legion-15arh05h = import ./lenovo/legion/15arh05h; + lenovo-legion-16ach6h = import ./lenovo/legion/16ach6h; + lenovo-legion-16ach6h-hybrid = import ./lenovo/legion/16ach6h/hybrid; + lenovo-legion-16ach6h-nvidia = import ./lenovo/legion/16ach6h/nvidia; + lenovo-legion-16arh7h-igpu-only = import ./lenovo/legion/16arh7h/igpu-only; + lenovo-legion-16arh7h-hybrid = import ./lenovo/legion/16arh7h/hybrid; + lenovo-legion-16achg6-hybrid = import ./lenovo/legion/16achg6/hybrid; + lenovo-legion-16achg6-nvidia = import ./lenovo/legion/16achg6/nvidia; + lenovo-legion-16aph8 = import ./lenovo/legion/16aph8; + lenovo-legion-16arha7 = import ./lenovo/legion/16arha7; + lenovo-legion-16ithg6 = import ./lenovo/legion/16ithg6; + lenovo-legion-16irx8h = import ./lenovo/legion/16irx8h; + lenovo-legion-16irx9h = import ./lenovo/legion/16irx9h; + lenovo-legion-t526amr5 = import ./lenovo/legion/t526amr5; + lenovo-legion-y530-15ich = import ./lenovo/legion/15ich; + lenovo-thinkpad = import ./lenovo/thinkpad; + lenovo-thinkpad-a475 = import ./lenovo/thinkpad/a475; + lenovo-thinkpad-e14-amd = import ./lenovo/thinkpad/e14/amd; + lenovo-thinkpad-e14-intel = import ./lenovo/thinkpad/e14/intel; + lenovo-thinkpad-e14-intel-gen4 = import ./lenovo/thinkpad/e14/intel/gen4; + lenovo-thinkpad-e14-intel-gen6 = import ./lenovo/thinkpad/e14/intel/gen6; + lenovo-thinkpad-e15-intel = import ./lenovo/thinkpad/e15/intel; + lenovo-thinkpad-e470 = import ./lenovo/thinkpad/e470; + lenovo-thinkpad-e495 = import ./lenovo/thinkpad/e495; + lenovo-thinkpad-l13 = import ./lenovo/thinkpad/l13; + lenovo-thinkpad-l13-yoga = import ./lenovo/thinkpad/l13/yoga; + lenovo-thinkpad-l14-amd = import ./lenovo/thinkpad/l14/amd; + lenovo-thinkpad-l14-intel = import ./lenovo/thinkpad/l14/intel; + lenovo-thinkpad-l480 = import ./lenovo/thinkpad/l480; + lenovo-thinkpad-p1 = import ./lenovo/thinkpad/p1; + lenovo-thinkpad-p1-gen3 = import ./lenovo/thinkpad/p1/3th-gen; + lenovo-thinkpad-p14s-amd-gen1 = import ./lenovo/thinkpad/p14s/amd/gen1; + lenovo-thinkpad-p14s-amd-gen2 = import ./lenovo/thinkpad/p14s/amd/gen2; + lenovo-thinkpad-p14s-amd-gen3 = import ./lenovo/thinkpad/p14s/amd/gen3; + lenovo-thinkpad-p14s-amd-gen4 = import ./lenovo/thinkpad/p14s/amd/gen4; + lenovo-thinkpad-p14s-amd-gen5 = import ./lenovo/thinkpad/p14s/amd/gen5; + lenovo-thinkpad-p14s-intel-gen3 = import ./lenovo/thinkpad/p14s/intel/gen3; + lenovo-thinkpad-p14s-intel-gen5 = import ./lenovo/thinkpad/p14s/intel/gen5; + lenovo-thinkpad-p16s-amd-gen1 = import ./lenovo/thinkpad/p16s/amd/gen1; + lenovo-thinkpad-p16s-amd-gen2 = import ./lenovo/thinkpad/p16s/amd/gen2; + lenovo-thinkpad-p16s-intel-gen2 = import ./lenovo/thinkpad/p16s/intel/gen2; + lenovo-thinkpad-p43s = import ./lenovo/thinkpad/p43s; + lenovo-thinkpad-p50 = import ./lenovo/thinkpad/p50; + lenovo-thinkpad-p51 = import ./lenovo/thinkpad/p51; + lenovo-thinkpad-p52 = import ./lenovo/thinkpad/p52; + lenovo-thinkpad-p53 = import ./lenovo/thinkpad/p53; + lenovo-thinkpad-t14 = import ./lenovo/thinkpad/t14; + lenovo-thinkpad-t14-amd-gen1 = import ./lenovo/thinkpad/t14/amd/gen1; + lenovo-thinkpad-t14-amd-gen2 = import ./lenovo/thinkpad/t14/amd/gen2; + lenovo-thinkpad-t14-amd-gen3 = import ./lenovo/thinkpad/t14/amd/gen3; + lenovo-thinkpad-t14-amd-gen4 = import ./lenovo/thinkpad/t14/amd/gen4; + lenovo-thinkpad-t14-amd-gen5 = import ./lenovo/thinkpad/t14/amd/gen5; + lenovo-thinkpad-t14s = import ./lenovo/thinkpad/t14s; + lenovo-thinkpad-t14s-amd-gen1 = import ./lenovo/thinkpad/t14s/amd/gen1; + lenovo-thinkpad-t14s-amd-gen4 = import ./lenovo/thinkpad/t14s/amd/gen4; + lenovo-thinkpad-t410 = import ./lenovo/thinkpad/t410; + lenovo-thinkpad-t420 = import ./lenovo/thinkpad/t420; + lenovo-thinkpad-t430 = import ./lenovo/thinkpad/t430; + lenovo-thinkpad-t440p = import ./lenovo/thinkpad/t440p; + lenovo-thinkpad-t440s = import ./lenovo/thinkpad/t440s; + lenovo-thinkpad-t450s = import ./lenovo/thinkpad/t450s; + lenovo-thinkpad-t460 = import ./lenovo/thinkpad/t460; + lenovo-thinkpad-t460p = import ./lenovo/thinkpad/t460p; + lenovo-thinkpad-t460s = import ./lenovo/thinkpad/t460s; + lenovo-thinkpad-t470s = import ./lenovo/thinkpad/t470s; + lenovo-thinkpad-t480 = import ./lenovo/thinkpad/t480; + lenovo-thinkpad-t480s = import ./lenovo/thinkpad/t480s; + lenovo-thinkpad-t490 = import ./lenovo/thinkpad/t490; + lenovo-thinkpad-t490s = import ./lenovo/thinkpad/t490s; + lenovo-thinkpad-t495 = import ./lenovo/thinkpad/t495; + lenovo-thinkpad-t520 = import ./lenovo/thinkpad/t520; + lenovo-thinkpad-w520 = import ./lenovo/thinkpad/w520; + lenovo-thinkpad-t550 = import ./lenovo/thinkpad/t550; + lenovo-thinkpad-t590 = import ./lenovo/thinkpad/t590; + lenovo-thinkpad-x1 = import ./lenovo/thinkpad/x1; + lenovo-thinkpad-x1-yoga = import ./lenovo/thinkpad/x1/yoga; + lenovo-thinkpad-x1-yoga-7th-gen = import ./lenovo/thinkpad/x1/yoga/7th-gen; + lenovo-thinkpad-x1-yoga-8th-gen = import ./lenovo/thinkpad/x1/yoga/8th-gen; + lenovo-thinkpad-x1-2nd-gen = import ./lenovo/thinkpad/x1/2nd-gen; + lenovo-thinkpad-x1-6th-gen = import ./lenovo/thinkpad/x1/6th-gen; + lenovo-thinkpad-x1-7th-gen = import ./lenovo/thinkpad/x1/7th-gen; + lenovo-thinkpad-x1-9th-gen = import ./lenovo/thinkpad/x1/9th-gen; + lenovo-thinkpad-x1-10th-gen = import ./lenovo/thinkpad/x1/10th-gen; + lenovo-thinkpad-x1-11th-gen = import ./lenovo/thinkpad/x1/11th-gen; + lenovo-thinkpad-x1-12th-gen = import ./lenovo/thinkpad/x1/12th-gen; + lenovo-thinkpad-x1-13th-gen = import ./lenovo/thinkpad/x1/13th-gen; + lenovo-thinkpad-x1-extreme = import ./lenovo/thinkpad/x1-extreme; + lenovo-thinkpad-x1-extreme-gen2 = import ./lenovo/thinkpad/x1-extreme/gen2; + lenovo-thinkpad-x1-extreme-gen3 = import ./lenovo/thinkpad/x1-extreme/gen3; + lenovo-thinkpad-x1-extreme-gen4 = import ./lenovo/thinkpad/x1-extreme/gen4; + lenovo-thinkpad-x1-nano = import ./lenovo/thinkpad/x1-nano; + lenovo-thinkpad-x1-nano-gen1 = import ./lenovo/thinkpad/x1-nano/gen1; + lenovo-thinkpad-x13 = import ./lenovo/thinkpad/x13/intel; + lenovo-thinkpad-x13-amd = import ./lenovo/thinkpad/x13/amd; + lenovo-thinkpad-x13-yoga = import ./lenovo/thinkpad/x13/yoga; + lenovo-thinkpad-x13-yoga-3th-gen = import ./lenovo/thinkpad/x13/yoga/3th-gen; + lenovo-thinkpad-x13s = import ./lenovo/thinkpad/x13s; + lenovo-thinkpad-x140e = import ./lenovo/thinkpad/x140e; + lenovo-thinkpad-x200s = import ./lenovo/thinkpad/x200s; + lenovo-thinkpad-x220 = import ./lenovo/thinkpad/x220; + lenovo-thinkpad-x230 = import ./lenovo/thinkpad/x230; + lenovo-thinkpad-x250 = import ./lenovo/thinkpad/x250; + lenovo-thinkpad-x260 = import ./lenovo/thinkpad/x260; + lenovo-thinkpad-x270 = import ./lenovo/thinkpad/x270; + lenovo-thinkpad-x280 = import ./lenovo/thinkpad/x280; + lenovo-thinkpad-x390 = import ./lenovo/thinkpad/x390; + lenovo-thinkpad-z = import ./lenovo/thinkpad/z; + lenovo-thinkpad-z13-gen1 = import ./lenovo/thinkpad/z/gen1/z13; + lenovo-thinkpad-z13-gen2 = import ./lenovo/thinkpad/z/gen2/z13; + lenovo-yoga-6-13ALC6 = import ./lenovo/yoga/6/13ALC6; + lenovo-yoga-7-14ARH7 = import ./lenovo/yoga/7/14ARH7; + lenovo-yoga-7-14ARH7-amdgpu = import ./lenovo/yoga/7/14ARH7/amdgpu; + lenovo-yoga-7-14ARH7-nvidia = import ./lenovo/yoga/7/14ARH7/nvidia; + lenovo-yoga-7-14IAH7-integrated = import ./lenovo/yoga/7/14IAH7/integrated; + lenovo-yoga-7-14IAH7-hybrid = import ./lenovo/yoga/7/14IAH7/hybrid; + lenovo-yoga-7-14ILL10 = import ./lenovo/yoga/7/14ILL10; + lenovo-yoga-7-slim-gen8 = import ./lenovo/yoga/7/slim/gen8; + letsnote-cf-lx4 = import ./panasonic/letsnote/cf-lx4; + malibal-aon-s1-intel = import ./malibal/aon/s1; + microchip-icicle-kit = import ./microchip/icicle-kit; + microsoft-surface-go = import ./microsoft/surface/surface-go; + microsoft-surface-pro-intel = import ./microsoft/surface/surface-pro-intel; + microsoft-surface-laptop-amd = import ./microsoft/surface/surface-laptop-amd; + microsoft-surface-common = import ./microsoft/surface/common; + microsoft-surface-pro-3 = import ./microsoft/surface-pro/3; + microsoft-surface-pro-9 = import ./microsoft/surface-pro/9; + milkv-pioneer = import ./milkv/pioneer; + minisforum-v3 = import ./minisforum/v3; + morefine-m600 = import ./morefine/m600; + msi-b350-tomahawk = import ./msi/b350-tomahawk; + msi-b550-a-pro = import ./msi/b550-a-pro; + msi-gs60 = import ./msi/gs60; + msi-gl62 = import ./msi/gl62; + msi-gl65-10SDR-492 = import ./msi/gl65/10SDR-492; + nxp-imx8mp-evk = import ./nxp/imx8mp-evk; + nxp-imx8mq-evk = import ./nxp/imx8mq-evk; + nxp-imx8qm-mek = import ./nxp/imx8qm-mek; + hardkernel-odroid-hc4 = import ./hardkernel/odroid-hc4; + hardkernel-odroid-h3 = import ./hardkernel/odroid-h3; + hardkernel-odroid-h4 = import ./hardkernel/odroid-h4; + omen-14-fb0798ng = import ./omen/14-fb0798ng; + omen-15-ce002ns = import ./omen/15-ce002ns; + omen-15-en0010ca = import ./omen/15-en0010ca; + omen-16-n0005ne = import ./omen/16-n0005ne; + omen-16-n0280nd = import ./omen/16-n0280nd; + omen-15-en1007sa = import ./omen/15-en1007sa; + omen-15-en0002np = import ./omen/15-en0002np; + onenetbook-4 = import ./onenetbook/4; + olimex-teres_i = import ./olimex/teres_i; + pcengines-apu = import ./pcengines/apu; + pine64-pinebook-pro = import ./pine64/pinebook-pro; + pine64-rockpro64 = import ./pine64/rockpro64; + pine64-star64 = import ./pine64/star64; + protectli-vp4670 = import ./protectli/vp4670; + purism-librem-13v3 = import ./purism/librem/13v3; + purism-librem-15v3 = import ./purism/librem/15v3; + purism-librem-5r4 = import ./purism/librem/5r4; + raspberry-pi-2 = import ./raspberry-pi/2; + raspberry-pi-3 = import ./raspberry-pi/3; + raspberry-pi-4 = import ./raspberry-pi/4; + raspberry-pi-5 = import ./raspberry-pi/5; + rock-4c-plus = import ./radxa/rock-4c-plus; + rock-5b = import ./radxa/rock-5b; + rock-pi-4 = import ./radxa/rock-pi-4; + rock-pi-e = import ./radxa/rock-pi-e; + kobol-helios4 = import ./kobol/helios4; + samsung-np900x3c = import ./samsung/np900x3c; + slimbook-hero-rpl-rtx = import ./slimbook/hero/rpl-rtx; + starfive-visionfive-v1 = import ./starfive/visionfive/v1; + starfive-visionfive-2 = import ./starfive/visionfive/v2; + starlabs-starlite-i5 = import ./starlabs/starlite/i5; + supermicro = import ./supermicro; + supermicro-a1sri-2758f = import ./supermicro/a1sri-2758f; + supermicro-m11sdv-8c-ln4f = import ./supermicro/m11sdv-8c-ln4f; + supermicro-x10sll-f = import ./supermicro/x10sll-f; + supermicro-x12scz-tln4f = import ./supermicro/x12scz-tln4f; + system76 = import ./system76; + system76-gaze18 = import ./system76/gaze18; + system76-galp5-1650 = import ./system76/galp5-1650; + system76-darp6 = import ./system76/darp6; + toshiba-swanky = import ./toshiba/swanky; + tuxedo-aura-15-gen1 = import ./tuxedo/aura/15/gen1; + tuxedo-infinitybook-v4 = import ./tuxedo/infinitybook/v4; + tuxedo-infinitybook-pro14-gen7 = import ./tuxedo/infinitybook/pro14/gen7; + tuxedo-infinitybook-pro14-gen9-intel = import ./tuxedo/infinitybook/pro14/gen9/intel; + tuxedo-pulse-14-gen3 = import ./tuxedo/pulse/14/gen3; + tuxedo-pulse-15-gen2 = import ./tuxedo/pulse/15/gen2; + xiaomi-redmibook-16-pro-2024 = import ./xiaomi/redmibook/16-pro-2024; + + common-cpu-amd = import ./common/cpu/amd; + common-cpu-amd-pstate = import ./common/cpu/amd/pstate.nix; + common-cpu-amd-zenpower = import ./common/cpu/amd/zenpower.nix; + common-cpu-amd-raphael-igpu = import ./common/cpu/amd/raphael/igpu.nix; + common-cpu-intel = import ./common/cpu/intel; + common-gpu-intel-comet-lake = + deprecated "992" "common-gpu-intel-comet-lake" + (import ./common/gpu/intel/comet-lake); + common-cpu-intel-cpu-only = import ./common/cpu/intel/cpu-only.nix; + common-gpu-intel-kaby-lake = + deprecated "992" "common-gpu-intel-kaby-lake" + (import ./common/gpu/intel/kaby-lake); + common-gpu-intel-sandy-bridge = + deprecated "992" "common-gpu-intel-sandy-bridge" + (import ./common/gpu/intel/sandy-bridge); + common-gpu-amd = import ./common/gpu/amd; + common-gpu-amd-sea-islands = import ./common/gpu/amd/sea-islands; + common-gpu-amd-southern-islands = import ./common/gpu/amd/southern-islands; + common-gpu-intel = import ./common/gpu/intel; + common-gpu-intel-disable = import ./common/gpu/intel/disable.nix; + common-gpu-nvidia = import ./common/gpu/nvidia/prime.nix; + common-gpu-nvidia-sync = import ./common/gpu/nvidia/prime-sync.nix; + common-gpu-nvidia-nonprime = import ./common/gpu/nvidia; + common-gpu-nvidia-disable = import ./common/gpu/nvidia/disable.nix; + common-hidpi = import ./common/hidpi.nix; + common-pc = import ./common/pc; + common-pc-hdd = import ./common/pc/hdd; + common-pc-laptop = import ./common/pc/laptop; + common-pc-laptop-acpi_call = throw "common-pc-laptop-acpi_call has been removed because it is obsolete: https://github.com/NixOS/nixos-hardware/issues/1114"; + common-pc-laptop-hdd = import ./common/pc/laptop/hdd; + common-pc-laptop-ssd = import ./common/pc/ssd; + common-pc-ssd = import ./common/pc/ssd; + }; + }; } diff --git a/focus/m2/gen1/default.nix b/focus/m2/gen1/default.nix index 2b8e5e7c..34996510 100644 --- a/focus/m2/gen1/default.nix +++ b/focus/m2/gen1/default.nix @@ -9,7 +9,14 @@ ../../../common/pc/ssd ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "nvme" + "usb_storage" + "sd_mod" + "rtsx_pci_sdmmc" + ]; boot.kernelModules = [ "kvm-intel" ]; boot.kernelParams = [ "tpm_tis.interrupts=0" # Upstream bug: https://bugzilla.kernel.org/show_bug.cgi?id=204121 diff --git a/framework/13-inch/11th-gen-intel/default.nix b/framework/13-inch/11th-gen-intel/default.nix index 2ea33969..4a24c4cb 100644 --- a/framework/13-inch/11th-gen-intel/default.nix +++ b/framework/13-inch/11th-gen-intel/default.nix @@ -1,4 +1,5 @@ -{ lib, pkgs, ...}: { +{ lib, pkgs, ... }: +{ imports = [ ../common ../common/intel.nix @@ -6,7 +7,10 @@ # Requires at least 5.16 for working wi-fi and bluetooth. # https://community.frame.work/t/using-the-ax210-with-linux-on-the-framework-laptop/1844/89 - boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.16") (lib.mkDefault pkgs.linuxPackages_latest); + boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.16") ( + lib.mkDefault pkgs.linuxPackages_latest + ); - hardware.framework.laptop13.audioEnhancement.rawDeviceName = lib.mkDefault "alsa_output.pci-0000_00_1f.3.analog-stereo"; + hardware.framework.laptop13.audioEnhancement.rawDeviceName = + lib.mkDefault "alsa_output.pci-0000_00_1f.3.analog-stereo"; } diff --git a/framework/13-inch/12th-gen-intel/default.nix b/framework/13-inch/12th-gen-intel/default.nix index 4cce4446..f8ff0c01 100644 --- a/framework/13-inch/12th-gen-intel/default.nix +++ b/framework/13-inch/12th-gen-intel/default.nix @@ -9,7 +9,8 @@ { hardware.intelgpu.loadInInitrd = lib.versionOlder config.boot.kernelPackages.kernel.version "6.2"; # same as 13th gen framework 13-inch - hardware.framework.laptop13.audioEnhancement.rawDeviceName = lib.mkDefault "alsa_output.pci-0000_00_1f.3.analog-stereo"; + hardware.framework.laptop13.audioEnhancement.rawDeviceName = + lib.mkDefault "alsa_output.pci-0000_00_1f.3.analog-stereo"; } # https://community.frame.work/t/tracking-hard-freezing-on-fedora-36-with-the-new-12th-gen-system/20675/391 (lib.mkIf (lib.versionOlder config.boot.kernelPackages.kernel.version "6.2") { diff --git a/framework/13-inch/7040-amd/default.nix b/framework/13-inch/7040-amd/default.nix index 9ec5e728..2cd21f60 100644 --- a/framework/13-inch/7040-amd/default.nix +++ b/framework/13-inch/7040-amd/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let cfg = config.hardware.framework.amd-7040; @@ -27,12 +32,15 @@ in config = { # Workaround applied upstream in Linux >=6.7 (on BIOS 03.03) # https://github.com/torvalds/linux/commit/a55bdad5dfd1efd4ed9ffe518897a21ca8e4e193 - services.udev.extraRules = lib.mkIf (lib.versionOlder config.boot.kernelPackages.kernel.version "6.7" && cfg.preventWakeOnAC) '' - # Prevent wake when plugging in AC during suspend. Trade-off: keyboard wake disabled. See: - # https://community.frame.work/t/tracking-framework-amd-ryzen-7040-series-lid-wakeup-behavior-feedback/39128/45 - ACTION=="add", SUBSYSTEM=="serio", DRIVERS=="atkbd", ATTR{power/wakeup}="disabled" - ''; + services.udev.extraRules = + lib.mkIf (lib.versionOlder config.boot.kernelPackages.kernel.version "6.7" && cfg.preventWakeOnAC) + '' + # Prevent wake when plugging in AC during suspend. Trade-off: keyboard wake disabled. See: + # https://community.frame.work/t/tracking-framework-amd-ryzen-7040-series-lid-wakeup-behavior-feedback/39128/45 + ACTION=="add", SUBSYSTEM=="serio", DRIVERS=="atkbd", ATTR{power/wakeup}="disabled" + ''; - hardware.framework.laptop13.audioEnhancement.rawDeviceName = lib.mkDefault "alsa_output.pci-0000_c1_00.6.analog-stereo"; + hardware.framework.laptop13.audioEnhancement.rawDeviceName = + lib.mkDefault "alsa_output.pci-0000_c1_00.6.analog-stereo"; }; } diff --git a/framework/13-inch/amd-ai-300-series/default.nix b/framework/13-inch/amd-ai-300-series/default.nix index 33c5ec67..5eecb38b 100644 --- a/framework/13-inch/amd-ai-300-series/default.nix +++ b/framework/13-inch/amd-ai-300-series/default.nix @@ -1,9 +1,15 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: { imports = [ ../common ../common/amd.nix ]; - config.hardware.framework.laptop13.audioEnhancement.rawDeviceName = lib.mkDefault "alsa_output.pci-0000_c1_00.6.analog-stereo"; + config.hardware.framework.laptop13.audioEnhancement.rawDeviceName = + lib.mkDefault "alsa_output.pci-0000_c1_00.6.analog-stereo"; } diff --git a/framework/13-inch/common/amd.nix b/framework/13-inch/common/amd.nix index 20d9d235..ae35fffe 100644 --- a/framework/13-inch/common/amd.nix +++ b/framework/13-inch/common/amd.nix @@ -1,4 +1,5 @@ -{ lib, config, ... }: { +{ lib, config, ... }: +{ imports = [ ../../../common/cpu/amd ../../../common/cpu/amd/pstate.nix @@ -15,7 +16,9 @@ "amdgpu.dcdebugmask=0x10" ] # Workaround for SuspendThenHibernate: https://lore.kernel.org/linux-kernel/20231106162310.85711-1-mario.limonciello@amd.com/ - ++ lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8") ["rtc_cmos.use_acpi_alarm=1"]; + ++ lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8") [ + "rtc_cmos.use_acpi_alarm=1" + ]; # AMD has better battery life with PPD over TLP: # https://community.frame.work/t/responded-amd-7040-sleep-states/38101/13 diff --git a/framework/13-inch/common/audio.nix b/framework/13-inch/common/audio.nix index 8133ab88..7010c35a 100644 --- a/framework/13-inch/common/audio.nix +++ b/framework/13-inch/common/audio.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let cfg = config.hardware.framework.laptop13.audioEnhancement; in @@ -51,332 +56,335 @@ in }; }; - config = lib.mkIf cfg.enable (let - outputName = cfg.rawDeviceName; - prettyName = "Framework Speakers"; + config = lib.mkIf cfg.enable ( + let + outputName = cfg.rawDeviceName; + prettyName = "Framework Speakers"; - # These are pre-made decibel to linear value conversions, since Nix doesn't have pow(). - # Use the formula `10 ** (db / 20)` to calculate. - db = { - "-18.1" = 0.1244514611771385; - "-5.48" = 0.5321082592667942; - "-4.76" = 0.5780960474057181; - "8.1" = 2.5409727055493048; - "-36" = 1.5848931924611134e-2; - }; - - json = pkgs.formats.json { }; - - # The filter chain, heavily inspired by the asahi-audio project: https://github.com/AsahiLinux/asahi-audio - filter-chain = json.generate "filter-chain.json" { - "node.description" = prettyName; - "media.name" = prettyName; - "filter.graph" = { - nodes = [ - # Psychoacoustic bass extension, - # it creates harmonics of the missing bass to fool our ears into hearing it. - { - type = "lv2"; - plugin = "https://chadmed.au/bankstown"; - name = "bassex"; - control = { - bypass = 0; - amt = 1.2; - sat_second = 1.3; - sat_third = 2.5; - blend = 1.0; - ceil = 200.0; - floor = 20.0; - }; - } - # Loudness compensation, - # it ensures that the sound profile stays consistent across different volumes. - { - type = "lv2"; - plugin = "http://lsp-plug.in/plugins/lv2/loud_comp_stereo"; - name = "el"; - control = { - enabled = 1; - input = 1.0; - fft = 4; - }; - } - # 8-band equalizer, - # it tries to lessen frequencies where the laptop might resonate, - # and tries to make the frequency curve more pleasing; - # this is the "Lappy McTopface" profile (https://github.com/ceiphr/ee-framework-presets) - # further tuned for the Framework Laptop 13 AMD 7040 series - # and might need some tuning on other models. - { - type = "lv2"; - plugin = "http://lsp-plug.in/plugins/lv2/para_equalizer_x8_lr"; - name = "fw13eq"; - control = { - mode = 0; - react = 0.2; - zoom = db."-36"; - - fl_0 = 101.0; - fml_0 = 0; - ftl_0 = 5; - gl_0 = db."-18.1"; - huel_0 = 0.0; - ql_0 = 4.36; - sl_0 = 0; - wl_0 = 4.0; - - fl_1 = 451.0; - fml_1 = 0; - ftl_1 = 1; - gl_1 = db."-5.48"; - huel_1 = 3.125e-2; - ql_1 = 2.46; - sl_1 = 0; - wl_1 = 4.0; - - fl_2 = 918.0; - fml_2 = 0; - ftl_2 = 1; - gl_2 = db."-4.76"; - huel_2 = 6.25e-2; - ql_2 = 2.44; - sl_2 = 0; - wl_2 = 4.0; - - fl_3 = 9700.0; - fml_3 = 0; - ftl_3 = 1; - gl_3 = db."8.1"; - huel_3 = 9.375e-2; - ql_3 = 2.0; - sl_3 = 0; - wl_3 = 4.0; - - fr_0 = 101.0; - fmr_0 = 0; - ftr_0 = 5; - gr_0 = db."-18.1"; - huer_0 = 0.0; - qr_0 = 4.36; - sr_0 = 0; - wr_0 = 4.0; - - fr_1 = 451.0; - fmr_1 = 0; - ftr_1 = 1; - gr_1 = db."-5.48"; - huer_1 = 3.125e-2; - qr_1 = 2.46; - sr_1 = 0; - wr_1 = 4.0; - - fr_2 = 918.0; - fmr_2 = 0; - ftr_2 = 1; - gr_2 = db."-4.76"; - huer_2 = 6.25e-2; - qr_2 = 2.44; - sr_2 = 0; - wr_2 = 4.0; - - fr_3 = 9700.0; - fmr_3 = 0; - ftr_3 = 1; - gr_3 = db."8.1"; - huer_3 = 9.375e-2; - qr_3 = 2.0; - sr_3 = 0; - wr_3 = 4.0; - }; - } - # Compressors. The settings were taken from the asahi-audio project. - { - type = "lv2"; - plugin = "http://lsp-plug.in/plugins/lv2/mb_compressor_stereo"; - name = "woofer_bp"; - control = { - mode = 0; - ce_0 = 1; - sla_0 = 5.0; - cr_0 = 1.75; - al_0 = 0.725; - at_0 = 1.0; - rt_0 = 100; - kn_0 = 0.125; - cbe_1 = 1; - sf_1 = 200.0; - ce_1 = 0; - cbe_2 = 0; - ce_2 = 0; - cbe_3 = 0; - ce_3 = 0; - cbe_4 = 0; - ce_4 = 0; - cbe_5 = 0; - ce_5 = 0; - cbe_6 = 0; - ce_6 = 0; - }; - } - { - type = "lv2"; - plugin = "http://lsp-plug.in/plugins/lv2/compressor_stereo"; - name = "woofer_lim"; - control = { - sla = 5.0; - al = 1.0; - at = 1.0; - rt = 100.0; - cr = 15.0; - kn = 0.5; - }; - } - ]; - - # Now, we're chaining together the modules instantiated above. - links = [ - { - output = "bassex:out_l"; - input = "el:in_l"; - } - { - output = "bassex:out_r"; - input = "el:in_r"; - } - - { - output = "el:out_l"; - input = "fw13eq:in_l"; - } - { - output = "el:out_r"; - input = "fw13eq:in_r"; - } - { - output = "fw13eq:out_l"; - input = "woofer_bp:in_l"; - } - { - output = "fw13eq:out_r"; - input = "woofer_bp:in_r"; - } - { - output = "woofer_bp:out_l"; - input = "woofer_lim:in_l"; - } - { - output = "woofer_bp:out_r"; - input = "woofer_lim:in_r"; - } - ]; - - inputs = [ - "bassex:in_l" - "bassex:in_r" - ]; - outputs = [ - "woofer_lim:out_l" - "woofer_lim:out_r" - ]; - - # This makes pipewire's volume control actually control the loudness comp module - "capture.volumes" = [ - { - control = "el:volume"; - min = -47.5; - max = 0.0; - scale = "cubic"; - } - ]; + # These are pre-made decibel to linear value conversions, since Nix doesn't have pow(). + # Use the formula `10 ** (db / 20)` to calculate. + db = { + "-18.1" = 0.1244514611771385; + "-5.48" = 0.5321082592667942; + "-4.76" = 0.5780960474057181; + "8.1" = 2.5409727055493048; + "-36" = 1.5848931924611134e-2; }; - "capture.props" = { - "node.name" = "audio_effect.laptop-convolver"; - "media.class" = "Audio/Sink"; - "audio.channels" = "2"; - "audio.position" = [ - "FL" - "FR" - ]; - "audio.allowed-rates" = [ - 44100 - 48000 - 88200 - 96000 - 176400 - 192000 - ]; - "device.api" = "dsp"; - "node.virtual" = "false"; - # Lower seems to mean "more preferred", - # bluetooth devices seem to be ~1000, speakers seem to be ~2000 - # since this is between the two, bluetooth devices take over when they connect, - # and hand over to this instead of the speakers when they disconnect. - "priority.session" = 1500; - "priority.driver" = 1500; - "state.default-volume" = 0.343; - "device.icon-name" = "audio-card-analog-pci"; - }; - "playback.props" = { - "node.name" = "audio_effect.laptop-convolver"; - "target.object" = outputName; - "node.passive" = "true"; - "audio.channels" = "2"; - "audio.allowed-rates" = [ - 44100 - 48000 - 88200 - 96000 - 176400 - 192000 - ]; - "audio.position" = [ - "FL" - "FR" - ]; - "device.icon-name" = "audio-card-analog-pci"; - }; - }; + json = pkgs.formats.json { }; - configPackage = - (pkgs.writeTextDir "share/wireplumber/wireplumber.conf.d/99-laptop.conf" '' - monitor.alsa.rules = [ - { - matches = [{ node.name = "${outputName}" }] - actions = { - update-props = { - audio.allowed-rates = [44100, 48000, 88200, 96000, 176400, 192000] + # The filter chain, heavily inspired by the asahi-audio project: https://github.com/AsahiLinux/asahi-audio + filter-chain = json.generate "filter-chain.json" { + "node.description" = prettyName; + "media.name" = prettyName; + "filter.graph" = { + nodes = [ + # Psychoacoustic bass extension, + # it creates harmonics of the missing bass to fool our ears into hearing it. + { + type = "lv2"; + plugin = "https://chadmed.au/bankstown"; + name = "bassex"; + control = { + bypass = 0; + amt = 1.2; + sat_second = 1.3; + sat_third = 2.5; + blend = 1.0; + ceil = 200.0; + floor = 20.0; + }; + } + # Loudness compensation, + # it ensures that the sound profile stays consistent across different volumes. + { + type = "lv2"; + plugin = "http://lsp-plug.in/plugins/lv2/loud_comp_stereo"; + name = "el"; + control = { + enabled = 1; + input = 1.0; + fft = 4; + }; + } + # 8-band equalizer, + # it tries to lessen frequencies where the laptop might resonate, + # and tries to make the frequency curve more pleasing; + # this is the "Lappy McTopface" profile (https://github.com/ceiphr/ee-framework-presets) + # further tuned for the Framework Laptop 13 AMD 7040 series + # and might need some tuning on other models. + { + type = "lv2"; + plugin = "http://lsp-plug.in/plugins/lv2/para_equalizer_x8_lr"; + name = "fw13eq"; + control = { + mode = 0; + react = 0.2; + zoom = db."-36"; + + fl_0 = 101.0; + fml_0 = 0; + ftl_0 = 5; + gl_0 = db."-18.1"; + huel_0 = 0.0; + ql_0 = 4.36; + sl_0 = 0; + wl_0 = 4.0; + + fl_1 = 451.0; + fml_1 = 0; + ftl_1 = 1; + gl_1 = db."-5.48"; + huel_1 = 3.125e-2; + ql_1 = 2.46; + sl_1 = 0; + wl_1 = 4.0; + + fl_2 = 918.0; + fml_2 = 0; + ftl_2 = 1; + gl_2 = db."-4.76"; + huel_2 = 6.25e-2; + ql_2 = 2.44; + sl_2 = 0; + wl_2 = 4.0; + + fl_3 = 9700.0; + fml_3 = 0; + ftl_3 = 1; + gl_3 = db."8.1"; + huel_3 = 9.375e-2; + ql_3 = 2.0; + sl_3 = 0; + wl_3 = 4.0; + + fr_0 = 101.0; + fmr_0 = 0; + ftr_0 = 5; + gr_0 = db."-18.1"; + huer_0 = 0.0; + qr_0 = 4.36; + sr_0 = 0; + wr_0 = 4.0; + + fr_1 = 451.0; + fmr_1 = 0; + ftr_1 = 1; + gr_1 = db."-5.48"; + huer_1 = 3.125e-2; + qr_1 = 2.46; + sr_1 = 0; + wr_1 = 4.0; + + fr_2 = 918.0; + fmr_2 = 0; + ftr_2 = 1; + gr_2 = db."-4.76"; + huer_2 = 6.25e-2; + qr_2 = 2.44; + sr_2 = 0; + wr_2 = 4.0; + + fr_3 = 9700.0; + fmr_3 = 0; + ftr_3 = 1; + gr_3 = db."8.1"; + huer_3 = 9.375e-2; + qr_3 = 2.0; + sr_3 = 0; + wr_3 = 4.0; + }; + } + # Compressors. The settings were taken from the asahi-audio project. + { + type = "lv2"; + plugin = "http://lsp-plug.in/plugins/lv2/mb_compressor_stereo"; + name = "woofer_bp"; + control = { + mode = 0; + ce_0 = 1; + sla_0 = 5.0; + cr_0 = 1.75; + al_0 = 0.725; + at_0 = 1.0; + rt_0 = 100; + kn_0 = 0.125; + cbe_1 = 1; + sf_1 = 200.0; + ce_1 = 0; + cbe_2 = 0; + ce_2 = 0; + cbe_3 = 0; + ce_3 = 0; + cbe_4 = 0; + ce_4 = 0; + cbe_5 = 0; + ce_5 = 0; + cbe_6 = 0; + ce_6 = 0; + }; + } + { + type = "lv2"; + plugin = "http://lsp-plug.in/plugins/lv2/compressor_stereo"; + name = "woofer_lim"; + control = { + sla = 5.0; + al = 1.0; + at = 1.0; + rt = 100.0; + cr = 15.0; + kn = 0.5; + }; + } + ]; + + # Now, we're chaining together the modules instantiated above. + links = [ + { + output = "bassex:out_l"; + input = "el:in_l"; + } + { + output = "bassex:out_r"; + input = "el:in_r"; + } + + { + output = "el:out_l"; + input = "fw13eq:in_l"; + } + { + output = "el:out_r"; + input = "fw13eq:in_r"; + } + { + output = "fw13eq:out_l"; + input = "woofer_bp:in_l"; + } + { + output = "fw13eq:out_r"; + input = "woofer_bp:in_r"; + } + { + output = "woofer_bp:out_l"; + input = "woofer_lim:in_l"; + } + { + output = "woofer_bp:out_r"; + input = "woofer_lim:in_r"; + } + ]; + + inputs = [ + "bassex:in_l" + "bassex:in_r" + ]; + outputs = [ + "woofer_lim:out_l" + "woofer_lim:out_r" + ]; + + # This makes pipewire's volume control actually control the loudness comp module + "capture.volumes" = [ + { + control = "el:volume"; + min = -47.5; + max = 0.0; + scale = "cubic"; + } + ]; + }; + "capture.props" = { + "node.name" = "audio_effect.laptop-convolver"; + "media.class" = "Audio/Sink"; + "audio.channels" = "2"; + "audio.position" = [ + "FL" + "FR" + ]; + "audio.allowed-rates" = [ + 44100 + 48000 + 88200 + 96000 + 176400 + 192000 + ]; + "device.api" = "dsp"; + "node.virtual" = "false"; + + # Lower seems to mean "more preferred", + # bluetooth devices seem to be ~1000, speakers seem to be ~2000 + # since this is between the two, bluetooth devices take over when they connect, + # and hand over to this instead of the speakers when they disconnect. + "priority.session" = 1500; + "priority.driver" = 1500; + "state.default-volume" = 0.343; + "device.icon-name" = "audio-card-analog-pci"; + }; + "playback.props" = { + "node.name" = "audio_effect.laptop-convolver"; + "target.object" = outputName; + "node.passive" = "true"; + "audio.channels" = "2"; + "audio.allowed-rates" = [ + 44100 + 48000 + 88200 + 96000 + 176400 + 192000 + ]; + "audio.position" = [ + "FL" + "FR" + ]; + "device.icon-name" = "audio-card-analog-pci"; + }; + }; + + configPackage = + (pkgs.writeTextDir "share/wireplumber/wireplumber.conf.d/99-laptop.conf" '' + monitor.alsa.rules = [ + { + matches = [{ node.name = "${outputName}" }] + actions = { + update-props = { + audio.allowed-rates = [44100, 48000, 88200, 96000, 176400, 192000] + } } } - } - ] + ] - node.software-dsp.rules = [ - { - matches = [{ node.name = "${outputName}" }] - actions = { - create-filter = { - filter-path = "${filter-chain}" - hide-parent = ${lib.boolToString cfg.hideRawDevice} + node.software-dsp.rules = [ + { + matches = [{ node.name = "${outputName}" }] + actions = { + create-filter = { + filter-path = "${filter-chain}" + hide-parent = ${lib.boolToString cfg.hideRawDevice} + } } } + ] + + wireplumber.profiles = { + main = { node.software-dsp = "required" } } - ] + '') + // { + passthru.requiredLv2Packages = with pkgs; [ + lsp-plugins + bankstown-lv2 + ]; + }; + in + { + services.pipewire.wireplumber.configPackages = [ configPackage ]; - wireplumber.profiles = { - main = { node.software-dsp = "required" } - } - '') - // { - passthru.requiredLv2Packages = with pkgs; [ - lsp-plugins - bankstown-lv2 - ]; - }; - in { - services.pipewire.wireplumber.configPackages = [ configPackage ]; - - # Pipewire is needed for this. - services.pipewire.enable = lib.mkDefault true; - }); + # Pipewire is needed for this. + services.pipewire.enable = lib.mkDefault true; + } + ); } diff --git a/framework/13-inch/common/intel.nix b/framework/13-inch/common/intel.nix index 96bbec97..6248e75f 100644 --- a/framework/13-inch/common/intel.nix +++ b/framework/13-inch/common/intel.nix @@ -1,21 +1,30 @@ -{ config, lib, pkgs, ... }: { +{ + config, + lib, + pkgs, + ... +}: +{ imports = [ ../../../common/cpu/intel ]; - boot.kernelParams = [ - # For Power consumption - # https://community.frame.work/t/linux-battery-life-tuning/6665/156 - "nvme.noacpi=1" - ] - # Fixes a regression in s2idle, making it more power efficient than deep sleep - # Update 04/2024: It appears that s2idle-regression got fixed in newer kernel-versions (SebTM) - # (see: https://github.com/NixOS/nixos-hardware/pull/903#discussion_r1556096657) - ++ lib.lists.optional (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8") "acpi_osi=\"!Windows 2020\""; + boot.kernelParams = + [ + # For Power consumption + # https://community.frame.work/t/linux-battery-life-tuning/6665/156 + "nvme.noacpi=1" + ] + # Fixes a regression in s2idle, making it more power efficient than deep sleep + # Update 04/2024: It appears that s2idle-regression got fixed in newer kernel-versions (SebTM) + # (see: https://github.com/NixOS/nixos-hardware/pull/903#discussion_r1556096657) + ++ lib.lists.optional (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8") "acpi_osi=\"!Windows 2020\""; # Requires at least 5.16 for working wi-fi and bluetooth. # https://community.frame.work/t/using-the-ax210-with-linux-on-the-framework-laptop/1844/89 - boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.16") (lib.mkDefault pkgs.linuxPackages_latest); + boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.16") ( + lib.mkDefault pkgs.linuxPackages_latest + ); # Module is not used for Framework EC but causes boot time error log. boot.blacklistedKernelModules = [ "cros-usbpd-charger" ]; diff --git a/framework/13-inch/intel-core-ultra-series1/default.nix b/framework/13-inch/intel-core-ultra-series1/default.nix index 7ac20d6e..4851d54f 100644 --- a/framework/13-inch/intel-core-ultra-series1/default.nix +++ b/framework/13-inch/intel-core-ultra-series1/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: { imports = [ @@ -8,7 +13,9 @@ # Need at least 6.9 to make suspend properly # Specifically this patch: https://github.com/torvalds/linux/commit/073237281a508ac80ec025872ad7de50cfb5a28a - boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.9") (lib.mkDefault pkgs.linuxPackages_latest); + boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.9") ( + lib.mkDefault pkgs.linuxPackages_latest + ); # Intel NPU Driver # https://discourse.nixos.org/t/new-installation-on-asus-zenbook-ux5406-intel-vpu-firmware-error-2/58732/2 @@ -32,6 +39,6 @@ warnings = lib.mkIf (!config.hardware.enableRedistributableFirmware) [ ''For Intel NPU support, set the option: hardware.enableRedistributableFirmware = true;'' - ]; + ]; } diff --git a/framework/16-inch/7040-amd/default.nix b/framework/16-inch/7040-amd/default.nix index 6c02455a..70275e69 100644 --- a/framework/16-inch/7040-amd/default.nix +++ b/framework/16-inch/7040-amd/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: { imports = [ diff --git a/framework/16-inch/common/amd.nix b/framework/16-inch/common/amd.nix index 20d9d235..ae35fffe 100644 --- a/framework/16-inch/common/amd.nix +++ b/framework/16-inch/common/amd.nix @@ -1,4 +1,5 @@ -{ lib, config, ... }: { +{ lib, config, ... }: +{ imports = [ ../../../common/cpu/amd ../../../common/cpu/amd/pstate.nix @@ -15,7 +16,9 @@ "amdgpu.dcdebugmask=0x10" ] # Workaround for SuspendThenHibernate: https://lore.kernel.org/linux-kernel/20231106162310.85711-1-mario.limonciello@amd.com/ - ++ lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8") ["rtc_cmos.use_acpi_alarm=1"]; + ++ lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8") [ + "rtc_cmos.use_acpi_alarm=1" + ]; # AMD has better battery life with PPD over TLP: # https://community.frame.work/t/responded-amd-7040-sleep-states/38101/13 diff --git a/framework/bluetooth.nix b/framework/bluetooth.nix index ba76081c..0e08adb7 100644 --- a/framework/bluetooth.nix +++ b/framework/bluetooth.nix @@ -10,29 +10,46 @@ pkgs, ... # TODO: drop this if linux 6.11 goes EOL -}: lib.mkIf ((config.boot.kernelPackages.kernelAtLeast "6.11") && (config.boot.kernelPackages.kernelOlder "6.12")) { - systemd.services = { - bluetooth-rfkill-suspend = { - description = "Soft block Bluetooth on suspend/hibernate"; - before = ["sleep.target"]; - unitConfig.StopWhenUnneeded = true; - serviceConfig = { - Type = "oneshot"; - ExecStart = "${pkgs.util-linux}/bin/rfkill block bluetooth"; - ExecStartPost = "${pkgs.coreutils}/bin/sleep 3"; - RemainAfterExit = true; +}: +lib.mkIf + ( + (config.boot.kernelPackages.kernelAtLeast "6.11") && (config.boot.kernelPackages.kernelOlder "6.12") + ) + { + systemd.services = { + bluetooth-rfkill-suspend = { + description = "Soft block Bluetooth on suspend/hibernate"; + before = [ "sleep.target" ]; + unitConfig.StopWhenUnneeded = true; + serviceConfig = { + Type = "oneshot"; + ExecStart = "${pkgs.util-linux}/bin/rfkill block bluetooth"; + ExecStartPost = "${pkgs.coreutils}/bin/sleep 3"; + RemainAfterExit = true; + }; + wantedBy = [ + "suspend.target" + "hibernate.target" + "suspend-then-hibernate.target" + ]; }; - wantedBy = ["suspend.target" "hibernate.target" "suspend-then-hibernate.target"]; - }; - bluetooth-rfkill-resume = { - description = "Unblock Bluetooth on resume"; - after = ["suspend.target" "hibernate.target" "suspend-then-hibernate.target"]; - serviceConfig = { - Type = "oneshot"; - ExecStart = "${pkgs.util-linux}/bin/rfkill unblock bluetooth"; + bluetooth-rfkill-resume = { + description = "Unblock Bluetooth on resume"; + after = [ + "suspend.target" + "hibernate.target" + "suspend-then-hibernate.target" + ]; + serviceConfig = { + Type = "oneshot"; + ExecStart = "${pkgs.util-linux}/bin/rfkill unblock bluetooth"; + }; + wantedBy = [ + "suspend.target" + "hibernate.target" + "suspend-then-hibernate.target" + ]; }; - wantedBy = ["suspend.target" "hibernate.target" "suspend-then-hibernate.target"]; }; - }; -} + } diff --git a/framework/framework-tool.nix b/framework/framework-tool.nix index 4effcca8..4c70193e 100644 --- a/framework/framework-tool.nix +++ b/framework/framework-tool.nix @@ -1,3 +1,4 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ environment.systemPackages = [ pkgs.framework-tool ]; } diff --git a/framework/kmod.nix b/framework/kmod.nix index 6ed05b9a..7cb53746 100644 --- a/framework/kmod.nix +++ b/framework/kmod.nix @@ -1,17 +1,20 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let kernel_version_compatible = lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.10"; -in { - options.hardware.framework.enableKmod = (lib.mkEnableOption - "Enable the community created Framework kernel module that allows interacting with the embedded controller from sysfs." - ) // { - # enable by default on NixOS >= 24.05 and kernel >= 6.10 - default = lib.and - (lib.versionAtLeast (lib.versions.majorMinor lib.version) "24.05") - kernel_version_compatible; - defaultText = "enabled by default on NixOS >= 24.05 and kernel >= 6.10"; - }; - +in +{ + options.hardware.framework.enableKmod = + (lib.mkEnableOption "Enable the community created Framework kernel module that allows interacting with the embedded controller from sysfs.") + // { + # enable by default on NixOS >= 24.05 and kernel >= 6.10 + default = lib.and (lib.versionAtLeast (lib.versions.majorMinor lib.version) "24.05") kernel_version_compatible; + defaultText = "enabled by default on NixOS >= 24.05 and kernel >= 6.10"; + }; config.boot = lib.mkIf config.hardware.framework.enableKmod { extraModulePackages = with config.boot.kernelPackages; [ @@ -19,7 +22,10 @@ in { ]; # https://github.com/DHowett/framework-laptop-kmod?tab=readme-ov-file#usage - kernelModules = [ "cros_ec" "cros_ec_lpcs" ]; + kernelModules = [ + "cros_ec" + "cros_ec_lpcs" + ]; # add required patch if enabled on kernel <6.10 kernelPatches = lib.mkIf (!kernel_version_compatible) [ @@ -28,15 +34,22 @@ in { msgid = "20240403004713.130365-1-dustin@howett.net"; version = "3"; hash = "sha256-aQSyys8CMzlj9EdNhg8vtp76fg1qEwUVeJL0E+8w5HU="; - patch = pkgs.runCommandLocal "patch-${msgid}" { - nativeBuildInputs = with pkgs; [ b4 git cacert ]; - SSL_CERT_FILE = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"; + patch = + pkgs.runCommandLocal "patch-${msgid}" + { + nativeBuildInputs = with pkgs; [ + b4 + git + cacert + ]; + SSL_CERT_FILE = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"; - outputHash = hash; - } '' - export HOME="$TMP" - PYTHONHASHSEED=0 ${pkgs.b4}/bin/b4 -n am -C -T -v ${version} -o- "${msgid}" > "$out" - ''; + outputHash = hash; + } + '' + export HOME="$TMP" + PYTHONHASHSEED=0 ${pkgs.b4}/bin/b4 -n am -C -T -v ${version} -o- "${msgid}" > "$out" + ''; } ]; }; diff --git a/friendlyarm/nanopc-t4/default.nix b/friendlyarm/nanopc-t4/default.nix index 61b86576..55bbf6b4 100644 --- a/friendlyarm/nanopc-t4/default.nix +++ b/friendlyarm/nanopc-t4/default.nix @@ -14,13 +14,17 @@ hardware.enableRedistributableFirmware = lib.mkDefault true; # Fix for not detecting the M.2 NVMe SSD. Will cause recompilation. - boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.10") (lib.mkDefault pkgs.linuxPackages_latest); - boot.kernelPatches = lib.mkDefault [{ - name = "pcie-rockchip-config.patch"; - patch = null; - extraConfig = '' - PHY_ROCKCHIP_PCIE y - PCIE_ROCKCHIP_HOST y - ''; - }]; + boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.10") ( + lib.mkDefault pkgs.linuxPackages_latest + ); + boot.kernelPatches = lib.mkDefault [ + { + name = "pcie-rockchip-config.patch"; + patch = null; + extraConfig = '' + PHY_ROCKCHIP_PCIE y + PCIE_ROCKCHIP_HOST y + ''; + } + ]; } diff --git a/friendlyarm/nanopi-r5s/default.nix b/friendlyarm/nanopi-r5s/default.nix index b7ecb916..ba018200 100644 --- a/friendlyarm/nanopi-r5s/default.nix +++ b/friendlyarm/nanopi-r5s/default.nix @@ -1,5 +1,6 @@ -{ lib -, ... +{ + lib, + ... }: { diff --git a/gmktec/nucbox/g3-plus/default.nix b/gmktec/nucbox/g3-plus/default.nix index 7cd7d6f3..1396aa71 100644 --- a/gmktec/nucbox/g3-plus/default.nix +++ b/gmktec/nucbox/g3-plus/default.nix @@ -1,23 +1,23 @@ /* - * `gmktec-nucbox-g3-plus`: - * - * Product page: - * - * - * This profile just configures the Intel - * Twin Lake N150 CPU and integrated - * graphics for this mini-PC. fstrim is also - * enabled for the SSD. That's all this seemed - * to need to function properly. As is now - * expected from Intel NUC systems, it provides - * a solid "out-of-the-box" experience. No - * special quirks are apparent. - * - * We import the Alder Lake modules since Twin - * Lake is just a refreshed version of the - * Alder Lake-N series. Re-using those seems - * to be fine for this purpose. - */ + `gmktec-nucbox-g3-plus`: + + Product page: + + + This profile just configures the Intel + Twin Lake N150 CPU and integrated + graphics for this mini-PC. fstrim is also + enabled for the SSD. That's all this seemed + to need to function properly. As is now + expected from Intel NUC systems, it provides + a solid "out-of-the-box" experience. No + special quirks are apparent. + + We import the Alder Lake modules since Twin + Lake is just a refreshed version of the + Alder Lake-N series. Re-using those seems + to be fine for this purpose. +*/ { imports = [ ../../../common/cpu/intel/alder-lake diff --git a/gpd/pocket-3/default.nix b/gpd/pocket-3/default.nix index a271a644..730249be 100644 --- a/gpd/pocket-3/default.nix +++ b/gpd/pocket-3/default.nix @@ -1,44 +1,56 @@ { lib, pkgs, ... }: -let inherit (lib) mkDefault mkIf; +let + inherit (lib) mkDefault mkIf; in { - imports = [ - ../../common/pc/laptop - ../../common/pc/ssd + imports = [ + ../../common/pc/laptop + ../../common/pc/ssd ../../common/hidpi.nix ../../common/gpu/24.05-compat.nix - ]; + ]; # Necessary kernel modules - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "thunderbolt" ]; + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "usbhid" + "thunderbolt" + ]; - # 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 - hardware.graphics.extraPackages = with pkgs; [ - intel-media-driver - (if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then vaapiIntel else intel-vaapi-driver) - ]; + # 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 + hardware.graphics.extraPackages = with pkgs; [ + intel-media-driver + ( + if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then + vaapiIntel + else + intel-vaapi-driver + ) + ]; - boot.kernelParams = [ - # The GPD Pocket3 uses a tablet OLED display, that is mounted rotated 90° counter-clockwise - "fbcon=rotate:1" "video=DSI-1:panel_orientation=right_side_up" - ]; + boot.kernelParams = [ + # The GPD Pocket3 uses a tablet OLED display, that is mounted rotated 90° counter-clockwise + "fbcon=rotate:1" + "video=DSI-1:panel_orientation=right_side_up" + ]; - fonts.fontconfig = { - subpixel.rgba = "vbgr"; # Pixel order for rotated screen + fonts.fontconfig = { + subpixel.rgba = "vbgr"; # Pixel order for rotated screen - # The OLED display has √(1920² + 1200²) px / 8in ≃ 283 dpi - # Per the documentation, antialiasing, hinting, etc. have no visible effect at such high pixel densities anyhow. - # Set manually, as the hiDPI module had incorrect settings prior to NixOS 22.11; see nixpkgs#194594. - hinting.enable = mkDefault false; - antialias = mkIf (lib.versionOlder (lib.versions.majorMinor lib.version) "22.11") false; - }; + # The OLED display has √(1920² + 1200²) px / 8in ≃ 283 dpi + # Per the documentation, antialiasing, hinting, etc. have no visible effect at such high pixel densities anyhow. + # Set manually, as the hiDPI module had incorrect settings prior to NixOS 22.11; see nixpkgs#194594. + hinting.enable = mkDefault false; + antialias = mkIf (lib.versionOlder (lib.versions.majorMinor lib.version) "22.11") false; + }; - # More HiDPI settings - services.xserver.dpi = 280; + # More HiDPI settings + services.xserver.dpi = 280; - # Necessary for audio support on the 1195G7 model - boot.extraModprobeConfig = '' - options snd-intel-dspcfg dsp_driver=1 - ''; + # Necessary for audio support on the 1195G7 model + boot.extraModprobeConfig = '' + options snd-intel-dspcfg dsp_driver=1 + ''; } diff --git a/gpd/pocket-4/default.nix b/gpd/pocket-4/default.nix index 4ec54b63..8d08b2e8 100644 --- a/gpd/pocket-4/default.nix +++ b/gpd/pocket-4/default.nix @@ -1,5 +1,6 @@ { lib, pkgs, ... }: -let inherit (lib) mkIf mkDefault; +let + inherit (lib) mkIf mkDefault; in { imports = [ @@ -17,7 +18,8 @@ in kernelParams = [ # The GPD Pocket 4 uses a tablet LTPS display, that is mounted rotated 90° counter-clockwise - "fbcon=rotate:1" "video=eDP-1:panel_orientation=right_side_up" + "fbcon=rotate:1" + "video=eDP-1:panel_orientation=right_side_up" ]; }; diff --git a/gpd/win-2/default.nix b/gpd/win-2/default.nix index aaaba374..e7247534 100644 --- a/gpd/win-2/default.nix +++ b/gpd/win-2/default.nix @@ -1,17 +1,19 @@ -{ config, lib, ...}: +{ config, lib, ... }: { imports = [ ../../common/cpu/intel ../../common/pc/ssd - ]; + ]; boot.kernelParams = [ "fbcon=rotate:1" "video=eDP-1:panel_orientation=right_side_up" ]; - services.tlp.enable = lib.mkDefault ((lib.versionOlder (lib.versions.majorMinor lib.version) "21.05") - || !config.services.power-profiles-daemon.enable); + services.tlp.enable = lib.mkDefault ( + (lib.versionOlder (lib.versions.majorMinor lib.version) "21.05") + || !config.services.power-profiles-daemon.enable + ); # Required for grub to properly display the boot menu. boot.loader.grub.gfxmodeEfi = lib.mkDefault "720x1280x32"; diff --git a/gpd/win-max-2/2023/default.nix b/gpd/win-max-2/2023/default.nix index b20f2ca3..1338c843 100644 --- a/gpd/win-max-2/2023/default.nix +++ b/gpd/win-max-2/2023/default.nix @@ -1,4 +1,4 @@ -{ config, lib, ...}: +{ config, lib, ... }: with lib; { imports = [ @@ -12,6 +12,10 @@ with lib; hardware.sensor.iio.bmi260.enable = lib.mkDefault true; #see README - boot.blacklistedKernelModules = mkIf config.hardware.sensor.iio.bmi260.enable [ "bmi160_spi" "bmi160_i2c" "bmi160_core" ]; + boot.blacklistedKernelModules = mkIf config.hardware.sensor.iio.bmi260.enable [ + "bmi160_spi" + "bmi160_i2c" + "bmi160_core" + ]; hardware.sensor.iio.enable = mkIf config.hardware.sensor.iio.bmi260.enable true; } diff --git a/gpd/win-max-2/default.nix b/gpd/win-max-2/default.nix index d7ff52d6..c9762cd6 100644 --- a/gpd/win-max-2/default.nix +++ b/gpd/win-max-2/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; let cfg = config.hardware.gpd.ppt; diff --git a/gpd/win-mini/default.nix b/gpd/win-mini/default.nix index 6361d576..f0d23926 100644 --- a/gpd/win-mini/default.nix +++ b/gpd/win-mini/default.nix @@ -5,9 +5,6 @@ ... }: with lib; -let - cfg = config.hardware.gpd.ppt; -in { imports = [ ../../common/pc/laptop diff --git a/hardkernel/odroid-hc4/default.nix b/hardkernel/odroid-hc4/default.nix index e591a871..a6442aba 100644 --- a/hardkernel/odroid-hc4/default.nix +++ b/hardkernel/odroid-hc4/default.nix @@ -4,25 +4,31 @@ # Based on the config from https://www.armbian.com/odroid-hc4/ hardware.fancontrol = { enable = lib.mkDefault true; - config = let - # According to https://www.armbian.com/odroid-hc4/ the FCFANS line should be removed on kernel 5.15. - kernelVersion = config.boot.kernelPackages.kernel.version; - needFcFans = lib.versions.majorMinor kernelVersion != "5.15"; - in lib.mkDefault ('' - INTERVAL=10 - DEVPATH=hwmon0=devices/virtual/thermal/thermal_zone0 hwmon2=devices/platform/pwm-fan - DEVNAME=hwmon0=cpu_thermal hwmon2=pwmfan - FCTEMPS=hwmon2/pwm1=hwmon0/temp1_input - '' + lib.optionalString needFcFans '' - FCFANS= hwmon2/pwm1=hwmon2/fan1_input - '' + '' - MINTEMP=hwmon2/pwm1=50 - MAXTEMP=hwmon2/pwm1=60 - MINSTART=hwmon2/pwm1=20 - MINSTOP=hwmon2/pwm1=28 - MINPWM=hwmon2/pwm1=0 - MAXPWM=hwmon2/pwm1=255 - ''); + config = + let + # According to https://www.armbian.com/odroid-hc4/ the FCFANS line should be removed on kernel 5.15. + kernelVersion = config.boot.kernelPackages.kernel.version; + needFcFans = lib.versions.majorMinor kernelVersion != "5.15"; + in + lib.mkDefault ( + '' + INTERVAL=10 + DEVPATH=hwmon0=devices/virtual/thermal/thermal_zone0 hwmon2=devices/platform/pwm-fan + DEVNAME=hwmon0=cpu_thermal hwmon2=pwmfan + FCTEMPS=hwmon2/pwm1=hwmon0/temp1_input + '' + + lib.optionalString needFcFans '' + FCFANS= hwmon2/pwm1=hwmon2/fan1_input + '' + + '' + MINTEMP=hwmon2/pwm1=50 + MAXTEMP=hwmon2/pwm1=60 + MINSTART=hwmon2/pwm1=20 + MINSTOP=hwmon2/pwm1=28 + MINPWM=hwmon2/pwm1=0 + MAXPWM=hwmon2/pwm1=255 + '' + ); }; # Linux 5.15 sometimes crash under heavy network usage diff --git a/hp/elitebook/845/g7/default.nix b/hp/elitebook/845/g7/default.nix index d18ef3cf..542921e0 100644 --- a/hp/elitebook/845/g7/default.nix +++ b/hp/elitebook/845/g7/default.nix @@ -1,18 +1,19 @@ { pkgs, lib, ... }: { - imports = - [ - ../../../../common/cpu/amd - ../../../../common/cpu/amd/pstate.nix - ../../../../common/gpu/amd - ../../../../common/pc/laptop - ../../../../common/pc/ssd - ]; + imports = [ + ../../../../common/cpu/amd + ../../../../common/cpu/amd/pstate.nix + ../../../../common/gpu/amd + ../../../../common/pc/laptop + ../../../../common/pc/ssd + ]; hardware.enableRedistributableFirmware = lib.mkDefault true; boot.kernelModules = [ "synaptics_usb" ]; - boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.3") (lib.mkDefault pkgs.linuxPackages_latest); + boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.3") ( + lib.mkDefault pkgs.linuxPackages_latest + ); # disable Scatter/Gather APU recently enabled by default, # which results in white screen after display reconfiguration diff --git a/hp/elitebook/845/g8/default.nix b/hp/elitebook/845/g8/default.nix index d18ef3cf..542921e0 100644 --- a/hp/elitebook/845/g8/default.nix +++ b/hp/elitebook/845/g8/default.nix @@ -1,18 +1,19 @@ { pkgs, lib, ... }: { - imports = - [ - ../../../../common/cpu/amd - ../../../../common/cpu/amd/pstate.nix - ../../../../common/gpu/amd - ../../../../common/pc/laptop - ../../../../common/pc/ssd - ]; + imports = [ + ../../../../common/cpu/amd + ../../../../common/cpu/amd/pstate.nix + ../../../../common/gpu/amd + ../../../../common/pc/laptop + ../../../../common/pc/ssd + ]; hardware.enableRedistributableFirmware = lib.mkDefault true; boot.kernelModules = [ "synaptics_usb" ]; - boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.3") (lib.mkDefault pkgs.linuxPackages_latest); + boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.3") ( + lib.mkDefault pkgs.linuxPackages_latest + ); # disable Scatter/Gather APU recently enabled by default, # which results in white screen after display reconfiguration diff --git a/hp/elitebook/845/g9/default.nix b/hp/elitebook/845/g9/default.nix index d18ef3cf..542921e0 100644 --- a/hp/elitebook/845/g9/default.nix +++ b/hp/elitebook/845/g9/default.nix @@ -1,18 +1,19 @@ { pkgs, lib, ... }: { - imports = - [ - ../../../../common/cpu/amd - ../../../../common/cpu/amd/pstate.nix - ../../../../common/gpu/amd - ../../../../common/pc/laptop - ../../../../common/pc/ssd - ]; + imports = [ + ../../../../common/cpu/amd + ../../../../common/cpu/amd/pstate.nix + ../../../../common/gpu/amd + ../../../../common/pc/laptop + ../../../../common/pc/ssd + ]; hardware.enableRedistributableFirmware = lib.mkDefault true; boot.kernelModules = [ "synaptics_usb" ]; - boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.3") (lib.mkDefault pkgs.linuxPackages_latest); + boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.3") ( + lib.mkDefault pkgs.linuxPackages_latest + ); # disable Scatter/Gather APU recently enabled by default, # which results in white screen after display reconfiguration diff --git a/huawei/machc-wa/default.nix b/huawei/machc-wa/default.nix index 9e3259d8..6279843d 100644 --- a/huawei/machc-wa/default.nix +++ b/huawei/machc-wa/default.nix @@ -3,7 +3,8 @@ pkgs, config, ... -}: { +}: +{ imports = [ ../../common/cpu/intel/comet-lake ../../common/gpu/nvidia diff --git a/kobol/helios4/modules/fancontrol.nix b/kobol/helios4/modules/fancontrol.nix index 27722765..3ab73a9d 100644 --- a/kobol/helios4/modules/fancontrol.nix +++ b/kobol/helios4/modules/fancontrol.nix @@ -19,7 +19,11 @@ services.udev.packages = [ # Fan control (pkgs.callPackage ( - { stdenv, lib, coreutils }: + { + stdenv, + lib, + coreutils, + }: stdenv.mkDerivation { name = "helios4-udev-fancontrol"; @@ -39,6 +43,6 @@ platforms = platforms.linux; }; } - ) {}) + ) { }) ]; } diff --git a/kobol/helios4/overlay.nix b/kobol/helios4/overlay.nix index 32262c56..1ffd02ff 100644 --- a/kobol/helios4/overlay.nix +++ b/kobol/helios4/overlay.nix @@ -11,6 +11,6 @@ final: _prev: { rev = "v${version}"; sha256 = "sha256-QxrTPcx0n0NWUJ990EuIWyOBtknW/fHDRcrYP0yQzTo="; }; - patches = []; + patches = [ ]; }; } diff --git a/lenovo/ideacentre/k330/default.nix b/lenovo/ideacentre/k330/default.nix index ff5cf3c4..9639b738 100644 --- a/lenovo/ideacentre/k330/default.nix +++ b/lenovo/ideacentre/k330/default.nix @@ -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" + ); } diff --git a/lenovo/legion/15ach6h/nvidia/default.nix b/lenovo/legion/15ach6h/nvidia/default.nix index 33f32652..37dd1148 100644 --- a/lenovo/legion/15ach6h/nvidia/default.nix +++ b/lenovo/legion/15ach6h/nvidia/default.nix @@ -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; + }; } diff --git a/lenovo/legion/16ach6h/nvidia/default.nix b/lenovo/legion/16ach6h/nvidia/default.nix index 33f32652..37dd1148 100644 --- a/lenovo/legion/16ach6h/nvidia/default.nix +++ b/lenovo/legion/16ach6h/nvidia/default.nix @@ -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; + }; } diff --git a/lenovo/legion/16achg6/nvidia/default.nix b/lenovo/legion/16achg6/nvidia/default.nix index 5c933fad..d279b6a2 100644 --- a/lenovo/legion/16achg6/nvidia/default.nix +++ b/lenovo/legion/16achg6/nvidia/default.nix @@ -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; + }; } diff --git a/lenovo/legion/16aph8/default.nix b/lenovo/legion/16aph8/default.nix index e44329fa..5771d65b 100644 --- a/lenovo/legion/16aph8/default.nix +++ b/lenovo/legion/16aph8/default.nix @@ -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 diff --git a/lenovo/legion/16arh7h/hybrid/default.nix b/lenovo/legion/16arh7h/hybrid/default.nix index 1654e23c..8dcfb46d 100644 --- a/lenovo/legion/16arh7h/hybrid/default.nix +++ b/lenovo/legion/16arh7h/hybrid/default.nix @@ -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; diff --git a/lenovo/legion/16arh7h/igpu-only/default.nix b/lenovo/legion/16arh7h/igpu-only/default.nix index bd61814f..24de7ddf 100644 --- a/lenovo/legion/16arh7h/igpu-only/default.nix +++ b/lenovo/legion/16arh7h/igpu-only/default.nix @@ -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 diff --git a/lenovo/legion/16arha7/audio/lenovo-16ARHA7_speaker-fix.nix b/lenovo/legion/16arha7/audio/lenovo-16ARHA7_speaker-fix.nix index 3e163b6b..40843b0d 100644 --- a/lenovo/legion/16arha7/audio/lenovo-16ARHA7_speaker-fix.nix +++ b/lenovo/legion/16arha7/audio/lenovo-16ARHA7_speaker-fix.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; }; -} \ No newline at end of file +} diff --git a/lenovo/legion/16arha7/default.nix b/lenovo/legion/16arha7/default.nix index c6e3a8c4..39fcc6be 100644 --- a/lenovo/legion/16arha7/default.nix +++ b/lenovo/legion/16arha7/default.nix @@ -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; diff --git a/lenovo/legion/16irx8h/default.nix b/lenovo/legion/16irx8h/default.nix index e4b6ca86..c39d8d46 100644 --- a/lenovo/legion/16irx8h/default.nix +++ b/lenovo/legion/16irx8h/default.nix @@ -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 = { diff --git a/lenovo/legion/16irx9h/default.nix b/lenovo/legion/16irx9h/default.nix index 6a8077d8..877d31f7 100644 --- a/lenovo/legion/16irx9h/default.nix +++ b/lenovo/legion/16irx9h/default.nix @@ -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 = { diff --git a/lenovo/thinkpad/a475/default.nix b/lenovo/thinkpad/a475/default.nix index dc89dc12..7a4f68cc 100644 --- a/lenovo/thinkpad/a475/default.nix +++ b/lenovo/thinkpad/a475/default.nix @@ -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 } - diff --git a/lenovo/thinkpad/p1/3th-gen/audio.nix b/lenovo/thinkpad/p1/3th-gen/audio.nix index 8b6c854f..25baf545 100644 --- a/lenovo/thinkpad/p1/3th-gen/audio.nix +++ b/lenovo/thinkpad/p1/3th-gen/audio.nix @@ -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 + ); } diff --git a/lenovo/thinkpad/p14s/amd/gen2/default.nix b/lenovo/thinkpad/p14s/amd/gen2/default.nix index 7c496f6e..b79e1cf3 100644 --- a/lenovo/thinkpad/p14s/amd/gen2/default.nix +++ b/lenovo/thinkpad/p14s/amd/gen2/default.nix @@ -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; diff --git a/lenovo/thinkpad/p14s/amd/gen4/default.nix b/lenovo/thinkpad/p14s/amd/gen4/default.nix index cc6244e7..1e9182b7 100644 --- a/lenovo/thinkpad/p14s/amd/gen4/default.nix +++ b/lenovo/thinkpad/p14s/amd/gen4/default.nix @@ -1,4 +1,9 @@ -{ lib, pkgs, config, ... }: +{ + lib, + pkgs, + config, + ... +}: { imports = [ ../. diff --git a/lenovo/thinkpad/p14s/default.nix b/lenovo/thinkpad/p14s/default.nix index 3a19fc1c..78396d32 100644 --- a/lenovo/thinkpad/p14s/default.nix +++ b/lenovo/thinkpad/p14s/default.nix @@ -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; diff --git a/lenovo/thinkpad/p14s/intel/gen5/default.nix b/lenovo/thinkpad/p14s/intel/gen5/default.nix index 919df030..49c3fc7c 100644 --- a/lenovo/thinkpad/p14s/intel/gen5/default.nix +++ b/lenovo/thinkpad/p14s/intel/gen5/default.nix @@ -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"; diff --git a/lenovo/thinkpad/p16s/intel/gen2/default.nix b/lenovo/thinkpad/p16s/intel/gen2/default.nix index 39940255..299f07a3 100644 --- a/lenovo/thinkpad/p16s/intel/gen2/default.nix +++ b/lenovo/thinkpad/p16s/intel/gen2/default.nix @@ -1,4 +1,5 @@ -{lib, ...}: { +{ lib, ... }: +{ imports = [ ../. ../../../../../common/cpu/intel/raptor-lake diff --git a/lenovo/thinkpad/p43s/default.nix b/lenovo/thinkpad/p43s/default.nix index c5e34ff0..9a05aeeb 100644 --- a/lenovo/thinkpad/p43s/default.nix +++ b/lenovo/thinkpad/p43s/default.nix @@ -1,4 +1,5 @@ -{ lib, config, ... }: { +{ lib, config, ... }: +{ imports = [ ../. ../../../common/cpu/intel/whiskey-lake diff --git a/lenovo/thinkpad/p50/default.nix b/lenovo/thinkpad/p50/default.nix index 62edb254..1deaddd1 100644 --- a/lenovo/thinkpad/p50/default.nix +++ b/lenovo/thinkpad/p50/default.nix @@ -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 diff --git a/lenovo/thinkpad/p51/default.nix b/lenovo/thinkpad/p51/default.nix index 38f5614d..da133e49 100644 --- a/lenovo/thinkpad/p51/default.nix +++ b/lenovo/thinkpad/p51/default.nix @@ -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 diff --git a/lenovo/thinkpad/p52/default.nix b/lenovo/thinkpad/p52/default.nix index 6c9ea67b..fc8811f6 100644 --- a/lenovo/thinkpad/p52/default.nix +++ b/lenovo/thinkpad/p52/default.nix @@ -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 diff --git a/lenovo/thinkpad/t14/amd/gen4/default.nix b/lenovo/thinkpad/t14/amd/gen4/default.nix index e61a3a0d..6ca06529 100644 --- a/lenovo/thinkpad/t14/amd/gen4/default.nix +++ b/lenovo/thinkpad/t14/amd/gen4/default.nix @@ -1,4 +1,9 @@ -{ lib, pkgs, config, ... }: +{ + lib, + pkgs, + config, + ... +}: { imports = [ diff --git a/lenovo/thinkpad/t14/amd/gen5/default.nix b/lenovo/thinkpad/t14/amd/gen5/default.nix index 917da63f..a092523c 100644 --- a/lenovo/thinkpad/t14/amd/gen5/default.nix +++ b/lenovo/thinkpad/t14/amd/gen5/default.nix @@ -1,4 +1,9 @@ -{ lib, pkgs, config, ... }: +{ + lib, + pkgs, + config, + ... +}: { imports = [ diff --git a/lenovo/thinkpad/t410/default.nix b/lenovo/thinkpad/t410/default.nix index 9cb15b3d..cd77abaf 100644 --- a/lenovo/thinkpad/t410/default.nix +++ b/lenovo/thinkpad/t410/default.nix @@ -28,7 +28,10 @@ "i915.i915_enable_rc6=1" ]; blacklistedKernelModules = [ - "sierra_net" "cdc_mbim" "cdc_ncm" "btusb" + "sierra_net" + "cdc_mbim" + "cdc_ncm" + "btusb" ]; }; } diff --git a/lenovo/thinkpad/t490/default.nix b/lenovo/thinkpad/t490/default.nix index f524223d..cc6bfc55 100644 --- a/lenovo/thinkpad/t490/default.nix +++ b/lenovo/thinkpad/t490/default.nix @@ -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; }; diff --git a/lenovo/thinkpad/t490s/default.nix b/lenovo/thinkpad/t490s/default.nix index 35a0055b..2ee6567a 100644 --- a/lenovo/thinkpad/t490s/default.nix +++ b/lenovo/thinkpad/t490s/default.nix @@ -1,4 +1,5 @@ -{lib, ...}: { +{ lib, ... }: +{ imports = [ ../../../common/cpu/intel ../../../common/pc/ssd diff --git a/lenovo/thinkpad/x1-nano/default.nix b/lenovo/thinkpad/x1-nano/default.nix index b67595c3..fdbf9f32 100644 --- a/lenovo/thinkpad/x1-nano/default.nix +++ b/lenovo/thinkpad/x1-nano/default.nix @@ -1,4 +1,5 @@ -{ ... }: { +{ ... }: +{ # Reference to hardware: https://ubuntu.com/certified/202012-28574 imports = [ ../. diff --git a/lenovo/thinkpad/x1-nano/gen1/default.nix b/lenovo/thinkpad/x1-nano/gen1/default.nix index 22c4019f..5ce106c1 100644 --- a/lenovo/thinkpad/x1-nano/gen1/default.nix +++ b/lenovo/thinkpad/x1-nano/gen1/default.nix @@ -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" ]; + }; } diff --git a/lenovo/thinkpad/x1/13th-gen/default.nix b/lenovo/thinkpad/x1/13th-gen/default.nix index 399ea64a..a2caba51 100644 --- a/lenovo/thinkpad/x1/13th-gen/default.nix +++ b/lenovo/thinkpad/x1/13th-gen/default.nix @@ -1,4 +1,4 @@ -{lib, ...}: +{ lib, ... }: { imports = [ diff --git a/lenovo/thinkpad/x1/9th-gen/default.nix b/lenovo/thinkpad/x1/9th-gen/default.nix index ef8bd9f1..cb2f5b80 100644 --- a/lenovo/thinkpad/x1/9th-gen/default.nix +++ b/lenovo/thinkpad/x1/9th-gen/default.nix @@ -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 + ); } diff --git a/lenovo/thinkpad/x1/yoga/7th-gen/default.nix b/lenovo/thinkpad/x1/yoga/7th-gen/default.nix index ed1a747f..8f5365a7 100644 --- a/lenovo/thinkpad/x1/yoga/7th-gen/default.nix +++ b/lenovo/thinkpad/x1/yoga/7th-gen/default.nix @@ -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 + ); } diff --git a/lenovo/thinkpad/x1/yoga/default.nix b/lenovo/thinkpad/x1/yoga/default.nix index 2b13440f..25b85378 100644 --- a/lenovo/thinkpad/x1/yoga/default.nix +++ b/lenovo/thinkpad/x1/yoga/default.nix @@ -1,4 +1,5 @@ -{ config, lib, ... }: { +{ config, lib, ... }: +{ imports = [ ../. ../../yoga.nix diff --git a/lenovo/thinkpad/x13/amd/default.nix b/lenovo/thinkpad/x13/amd/default.nix index 61ca7b75..4543132d 100644 --- a/lenovo/thinkpad/x13/amd/default.nix +++ b/lenovo/thinkpad/x13/amd/default.nix @@ -1,4 +1,5 @@ -{ ... }: { +{ ... }: +{ imports = [ ../common.nix ../../../../common/cpu/amd diff --git a/lenovo/thinkpad/x13/common.nix b/lenovo/thinkpad/x13/common.nix index 131f468c..1b9a75cf 100644 --- a/lenovo/thinkpad/x13/common.nix +++ b/lenovo/thinkpad/x13/common.nix @@ -1,4 +1,5 @@ -{ ... }: { +{ ... }: +{ imports = [ ../. ../../../common/pc/ssd diff --git a/lenovo/thinkpad/x13/intel/default.nix b/lenovo/thinkpad/x13/intel/default.nix index ed4771fd..71d0324a 100644 --- a/lenovo/thinkpad/x13/intel/default.nix +++ b/lenovo/thinkpad/x13/intel/default.nix @@ -1,4 +1,5 @@ -{ ... }: { +{ ... }: +{ # Reference to hardware: https://certification.ubuntu.com/hardware/202004-27844 imports = [ ../common.nix diff --git a/lenovo/thinkpad/x13/yoga/3th-gen/default.nix b/lenovo/thinkpad/x13/yoga/3th-gen/default.nix index 1b02f61f..971b925f 100644 --- a/lenovo/thinkpad/x13/yoga/3th-gen/default.nix +++ b/lenovo/thinkpad/x13/yoga/3th-gen/default.nix @@ -1,4 +1,5 @@ -{ lib, ... }: { +{ lib, ... }: +{ imports = [ ../. ]; diff --git a/lenovo/thinkpad/x13/yoga/default.nix b/lenovo/thinkpad/x13/yoga/default.nix index b7ff8778..7719520a 100644 --- a/lenovo/thinkpad/x13/yoga/default.nix +++ b/lenovo/thinkpad/x13/yoga/default.nix @@ -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; } diff --git a/lenovo/thinkpad/x13s/default.nix b/lenovo/thinkpad/x13s/default.nix index dd9159dc..59cf01b4 100644 --- a/lenovo/thinkpad/x13s/default.nix +++ b/lenovo/thinkpad/x13s/default.nix @@ -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 diff --git a/lenovo/thinkpad/x390/default.nix b/lenovo/thinkpad/x390/default.nix index 80c893ba..7a3b5508 100644 --- a/lenovo/thinkpad/x390/default.nix +++ b/lenovo/thinkpad/x390/default.nix @@ -9,4 +9,3 @@ services.throttled.enable = lib.mkDefault true; } - diff --git a/lenovo/thinkpad/z/default.nix b/lenovo/thinkpad/z/default.nix index 11dda086..d3af3e5f 100644 --- a/lenovo/thinkpad/z/default.nix +++ b/lenovo/thinkpad/z/default.nix @@ -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" + ); } diff --git a/lenovo/thinkpad/z/gen1/default.nix b/lenovo/thinkpad/z/gen1/default.nix index b51da6e8..22d49544 100644 --- a/lenovo/thinkpad/z/gen1/default.nix +++ b/lenovo/thinkpad/z/gen1/default.nix @@ -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 + ); } diff --git a/lenovo/thinkpad/z/gen2/default.nix b/lenovo/thinkpad/z/gen2/default.nix index cb7e05c2..a91581d8 100644 --- a/lenovo/thinkpad/z/gen2/default.nix +++ b/lenovo/thinkpad/z/gen2/default.nix @@ -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 diff --git a/lenovo/yoga/7/14ARH7/nvidia/default.nix b/lenovo/yoga/7/14ARH7/nvidia/default.nix index cf7aedc9..71b7e00b 100644 --- a/lenovo/yoga/7/14ARH7/nvidia/default.nix +++ b/lenovo/yoga/7/14ARH7/nvidia/default.nix @@ -5,7 +5,8 @@ let inherit (lib) mkDefault; -in { +in +{ imports = [ ../shared.nix ## "prime.nix" loads this, aleady: diff --git a/lenovo/yoga/7/14IAH7/hybrid/default.nix b/lenovo/yoga/7/14IAH7/hybrid/default.nix index d202352c..0a46b053 100644 --- a/lenovo/yoga/7/14IAH7/hybrid/default.nix +++ b/lenovo/yoga/7/14IAH7/hybrid/default.nix @@ -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: - * - * - * 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: - * - */ + `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: + + + 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: + +*/ { lib, ... }: { imports = [ diff --git a/lenovo/yoga/7/14IAH7/integrated/default.nix b/lenovo/yoga/7/14IAH7/integrated/default.nix index 6ba257b0..3a3ce89a 100644 --- a/lenovo/yoga/7/14IAH7/integrated/default.nix +++ b/lenovo/yoga/7/14IAH7/integrated/default.nix @@ -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: - * - */ + `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: + +*/ { imports = [ ../shared.nix diff --git a/lenovo/yoga/7/14IAH7/shared.nix b/lenovo/yoga/7/14IAH7/shared.nix index 91220cd7..22f868e0 100644 --- a/lenovo/yoga/7/14IAH7/shared.nix +++ b/lenovo/yoga/7/14IAH7/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 diff --git a/lenovo/yoga/7/slim/gen8/default.nix b/lenovo/yoga/7/slim/gen8/default.nix index 5f87802d..7e3099c4 100644 --- a/lenovo/yoga/7/slim/gen8/default.nix +++ b/lenovo/yoga/7/slim/gen8/default.nix @@ -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"; + }}" + ]; } - diff --git a/microchip/common/bsp/hss-payload-generator.nix b/microchip/common/bsp/hss-payload-generator.nix index 4044d51f..74bbe07b 100644 --- a/microchip/common/bsp/hss-payload-generator.nix +++ b/microchip/common/bsp/hss-payload-generator.nix @@ -1,4 +1,4 @@ -{ pkgs, ...}: +{ pkgs, ... }: with pkgs; stdenv.mkDerivation rec { pname = "hss"; diff --git a/microchip/common/bsp/linux-icicle-kit.nix b/microchip/common/bsp/linux-icicle-kit.nix index 6ac1eb14..13d4f34f 100644 --- a/microchip/common/bsp/linux-icicle-kit.nix +++ b/microchip/common/bsp/linux-icicle-kit.nix @@ -1,65 +1,77 @@ -{ lib, buildLinux, fetchFromGitHub -, kernelPatches ? [] -, structuredExtraConfig ? {} -, extraMeta ? {} -, argsOverride ? {} -, ... } @ args: +{ + lib, + buildLinux, + fetchFromGitHub, + kernelPatches ? [ ], + structuredExtraConfig ? { }, + extraMeta ? { }, + argsOverride ? { }, + ... +}@args: let version = "6.1.43-linux4microchip+fpga-2023.09"; -in buildLinux (args // { - inherit version kernelPatches extraMeta; +in +buildLinux ( + args + // { + inherit version kernelPatches extraMeta; - # modDirVersion needs to be x.y.z, will automatically add .0 if needed - modDirVersion = version; + # modDirVersion needs to be x.y.z, will automatically add .0 if needed + modDirVersion = version; - defconfig = "mpfs_defconfig"; + defconfig = "mpfs_defconfig"; - autoModules = false; + autoModules = false; - structuredExtraConfig = with lib.kernel; { - OF_OVERLAY = yes; - OF_CONFIGFS = yes; - MFD_SENSEHAT_CORE = module; - INPUT_JOYDEV = module; - INPUT_JOYSTICK = yes; - JOYSTICK_SENSEHAT = module; - AUXDISPLAY = yes; - SENSEHAT_DISPLAY = module; - HTS221 = module; - IIO_ST_PRESS = module; - IIO_ST_LSM6DSX = module; - IIO_ST_MAGN_3AXIS = module; - POLARFIRE_SOC_DMA_NONCOHERENT = yes; - MTD_SPI_NOR_USE_4K_SECTORS = no; - MTD_UBI = yes; - MTD_CMDLINE_PARTS = yes; - UBIFS_FS = yes; - USB_UAS = module; - EFI_STUB = yes; - EFI = yes; - USBIP_CORE = module; - USBIP_VHCI_HCD = module; - USBIP_HOST = module; - USBIP_VUDC = module; - CRYPTO_TLS = module; - MD = yes; - BLK_DEV_MD = module; - MD_LINEAR = module; - MD_RAID0 = module; - MD_RAID1 = module; - MD_RAID10 = module; - MD_RAID456 = module; + structuredExtraConfig = + with lib.kernel; + { + OF_OVERLAY = yes; + OF_CONFIGFS = yes; + MFD_SENSEHAT_CORE = module; + INPUT_JOYDEV = module; + INPUT_JOYSTICK = yes; + JOYSTICK_SENSEHAT = module; + AUXDISPLAY = yes; + SENSEHAT_DISPLAY = module; + HTS221 = module; + IIO_ST_PRESS = module; + IIO_ST_LSM6DSX = module; + IIO_ST_MAGN_3AXIS = module; + POLARFIRE_SOC_DMA_NONCOHERENT = yes; + MTD_SPI_NOR_USE_4K_SECTORS = no; + MTD_UBI = yes; + MTD_CMDLINE_PARTS = yes; + UBIFS_FS = yes; + USB_UAS = module; + EFI_STUB = yes; + EFI = yes; + USBIP_CORE = module; + USBIP_VHCI_HCD = module; + USBIP_HOST = module; + USBIP_VUDC = module; + CRYPTO_TLS = module; + MD = yes; + BLK_DEV_MD = module; + MD_LINEAR = module; + MD_RAID0 = module; + MD_RAID1 = module; + MD_RAID10 = module; + MD_RAID456 = module; - # This device doesn't have any kind of display output at all - FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER = lib.mkForce no; - FB_EFI = lib.mkForce no; - } // structuredExtraConfig; + # This device doesn't have any kind of display output at all + FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER = lib.mkForce no; + FB_EFI = lib.mkForce no; + } + // structuredExtraConfig; - src = fetchFromGitHub { - owner = "linux4microchip"; - repo = "linux"; - rev = "25e35c7c54ad853d03c14a02b189b408cb5b5eb3"; - sha256 = "sha256-wj7lz247MkhxmhSHUcNeWmcZK+DL+5PAnLwTmALD97M="; - }; -} // argsOverride) + src = fetchFromGitHub { + owner = "linux4microchip"; + repo = "linux"; + rev = "25e35c7c54ad853d03c14a02b189b408cb5b5eb3"; + sha256 = "sha256-wj7lz247MkhxmhSHUcNeWmcZK+DL+5PAnLwTmALD97M="; + }; + } + // argsOverride +) diff --git a/microchip/common/bsp/uboot.nix b/microchip/common/bsp/uboot.nix index 2db04d56..22be6d0b 100644 --- a/microchip/common/bsp/uboot.nix +++ b/microchip/common/bsp/uboot.nix @@ -1,9 +1,12 @@ { - pkgs, targetBoard, ... + pkgs, + targetBoard, + ... }: -with pkgs; let - payload-generator = pkgs.callPackage ./hss-payload-generator.nix {}; +with pkgs; +let + payload-generator = pkgs.callPackage ./hss-payload-generator.nix { }; payload_config = ./uboot.yaml; in buildUBoot rec { @@ -19,7 +22,7 @@ buildUBoot rec { }; extraMakeFlags = [ - "OPENSBI=${opensbi}/share/opensbi/lp64/generic/firmware/fw_dynamic.bin" + "OPENSBI=${opensbi}/share/opensbi/lp64/generic/firmware/fw_dynamic.bin" ]; patches = [ @@ -27,9 +30,9 @@ buildUBoot rec { ]; defconfig = "${targetBoard}_defconfig"; enableParallelBuilding = true; - extraMeta.platforms = ["riscv64-linux"]; + extraMeta.platforms = [ "riscv64-linux" ]; postBuild = '' - ${payload-generator}/hss-payload-generator -c ${payload_config} payload.bin - ''; + ${payload-generator}/hss-payload-generator -c ${payload_config} payload.bin + ''; filesToInstall = [ "payload.bin" ]; } diff --git a/microchip/common/modules.nix b/microchip/common/modules.nix index c6a75198..34874aac 100644 --- a/microchip/common/modules.nix +++ b/microchip/common/modules.nix @@ -1,8 +1,16 @@ -{ pkgs, lib, config, ... }: { +{ + pkgs, + lib, + config, + ... +}: +{ boot = { - kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/linux-icicle-kit.nix { - inherit (config.boot) kernelPatches; - }); + kernelPackages = pkgs.linuxPackagesFor ( + pkgs.callPackage ./bsp/linux-icicle-kit.nix { + inherit (config.boot) kernelPatches; + } + ); initrd.includeDefaultModules = lib.mkDefault false; }; } diff --git a/microchip/icicle-kit/overlay.nix b/microchip/icicle-kit/overlay.nix index f145dcf6..86b60d93 100644 --- a/microchip/icicle-kit/overlay.nix +++ b/microchip/icicle-kit/overlay.nix @@ -1,3 +1,6 @@ final: _prev: { - uboot-icicle-kit = final.callPackage ./../common/bsp/uboot.nix { pkgs = final; targetBoard = "microchip_mpfs_icicle";}; + uboot-icicle-kit = final.callPackage ./../common/bsp/uboot.nix { + pkgs = final; + targetBoard = "microchip_mpfs_icicle"; + }; } diff --git a/microsoft/surface-pro/9/default.nix b/microsoft/surface-pro/9/default.nix index 60b82ad3..b8334cac 100644 --- a/microsoft/surface-pro/9/default.nix +++ b/microsoft/surface-pro/9/default.nix @@ -2,4 +2,4 @@ imports = [ ../../surface/surface-pro-intel ]; boot.kernelParams = [ "i915.enable_psr=0" ]; # Disable Intel Panel Self Refresh -} \ No newline at end of file +} diff --git a/microsoft/surface/common/default.nix b/microsoft/surface/common/default.nix index 5d9d7d98..236ddc4b 100644 --- a/microsoft/surface/common/default.nix +++ b/microsoft/surface/common/default.nix @@ -1,10 +1,21 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let - inherit (lib) mkDefault mkOption types versions; + inherit (lib) + mkDefault + mkOption + types + versions + ; # Set the version and hash for the kernel sources - srcVersion = with config.hardware.microsoft-surface; + srcVersion = + with config.hardware.microsoft-surface; if kernelVersion == "longterm" then "6.12.19" else if kernelVersion == "stable" then @@ -12,7 +23,8 @@ let else abort "Invalid kernel version: ${kernelVersion}"; - srcHash = with config.hardware.microsoft-surface; + srcHash = + with config.hardware.microsoft-surface; if kernelVersion == "longterm" then "sha256-1zvwV77ARDSxadG2FkGTb30Ml865I6KB8y413U3MZTE=" else if kernelVersion == "stable" then @@ -21,15 +33,17 @@ let abort "Invalid kernel version: ${kernelVersion}"; # Set the version and hash for the linux-surface releases - pkgVersion = with config.hardware.microsoft-surface; + pkgVersion = + with config.hardware.microsoft-surface; if kernelVersion == "longterm" then "6.12.7" else if kernelVersion == "stable" then "6.14.2" else abort "Invalid kernel version: ${kernelVersion}"; - - pkgHash = with config.hardware.microsoft-surface; + + pkgHash = + with config.hardware.microsoft-surface; if kernelVersion == "longterm" then "sha256-Pv7O8D8ma+MPLhYP3HSGQki+Yczp8b7d63qMb6l4+mY=" else if kernelVersion == "stable" then @@ -38,28 +52,46 @@ let abort "Invalid kernel version: ${kernelVersion}"; # Fetch the linux-surface package - repos = pkgs.callPackage ({ fetchFromGitHub, rev, hash }: { - linux-surface = fetchFromGitHub { - owner = "linux-surface"; - repo = "linux-surface"; - rev = rev; - hash = hash; - }; - }) { hash = pkgHash; rev = "arch-${pkgVersion}-1"; }; + repos = + pkgs.callPackage + ( + { + fetchFromGitHub, + rev, + hash, + }: + { + linux-surface = fetchFromGitHub { + owner = "linux-surface"; + repo = "linux-surface"; + rev = rev; + hash = hash; + }; + } + ) + { + hash = pkgHash; + rev = "arch-${pkgVersion}-1"; + }; # Fetch and build the kernel package - inherit (pkgs.callPackage ./kernel/linux-package.nix { inherit repos; }) linuxPackage surfacePatches; + inherit (pkgs.callPackage ./kernel/linux-package.nix { inherit repos; }) + linuxPackage + surfacePatches + ; kernelPatches = surfacePatches { version = pkgVersion; patchFn = ./kernel/${versions.majorMinor pkgVersion}/patches.nix; }; kernelPackages = linuxPackage { - inherit kernelPatches; version = srcVersion; + inherit kernelPatches; + version = srcVersion; sha256 = srcHash; - ignoreConfigErrors=true; + ignoreConfigErrors = true; }; -in { +in +{ options.hardware.microsoft-surface.kernelVersion = mkOption { description = "Kernel Version to use (patched for MS Surface)"; type = types.enum [ diff --git a/microsoft/surface/common/kernel/6.12/patches.nix b/microsoft/surface/common/kernel/6.12/patches.nix index 93e3c2ef..d5cc8ccc 100644 --- a/microsoft/surface/common/kernel/6.12/patches.nix +++ b/microsoft/surface/common/kernel/6.12/patches.nix @@ -1,4 +1,5 @@ -{ lib, +{ + lib, kernel ? lib.kernel, patchSrc, version, @@ -11,87 +12,87 @@ extraStructuredConfig = with kernel; { STAGING_MEDIA = yes; -## -## Surface Aggregator Module -## -CONFIG_SURFACE_AGGREGATOR= module; -# CONFIG_SURFACE_AGGREGATOR_ERROR_INJECTION is not set -CONFIG_SURFACE_AGGREGATOR_BUS= yes; -CONFIG_SURFACE_AGGREGATOR_CDEV= module; -CONFIG_SURFACE_AGGREGATOR_HUB= module; -CONFIG_SURFACE_AGGREGATOR_REGISTRY= module; -CONFIG_SURFACE_AGGREGATOR_TABLET_SWITCH= module; + ## + ## Surface Aggregator Module + ## + CONFIG_SURFACE_AGGREGATOR = module; + # CONFIG_SURFACE_AGGREGATOR_ERROR_INJECTION is not set + CONFIG_SURFACE_AGGREGATOR_BUS = yes; + CONFIG_SURFACE_AGGREGATOR_CDEV = module; + CONFIG_SURFACE_AGGREGATOR_HUB = module; + CONFIG_SURFACE_AGGREGATOR_REGISTRY = module; + CONFIG_SURFACE_AGGREGATOR_TABLET_SWITCH = module; -CONFIG_SURFACE_ACPI_NOTIFY= module; -CONFIG_SURFACE_DTX= module; -CONFIG_SURFACE_PLATFORM_PROFILE= module; + CONFIG_SURFACE_ACPI_NOTIFY = module; + CONFIG_SURFACE_DTX = module; + CONFIG_SURFACE_PLATFORM_PROFILE = module; -CONFIG_SURFACE_HID= module; -CONFIG_SURFACE_KBD= module; + CONFIG_SURFACE_HID = module; + CONFIG_SURFACE_KBD = module; -CONFIG_BATTERY_SURFACE= module; -CONFIG_CHARGER_SURFACE= module; + CONFIG_BATTERY_SURFACE = module; + CONFIG_CHARGER_SURFACE = module; -CONFIG_SENSORS_SURFACE_TEMP= module; -CONFIG_SENSORS_SURFACE_FAN= module; + CONFIG_SENSORS_SURFACE_TEMP = module; + CONFIG_SENSORS_SURFACE_FAN = module; -## -## Surface Hotplug -## -CONFIG_SURFACE_HOTPLUG= module; + ## + ## Surface Hotplug + ## + CONFIG_SURFACE_HOTPLUG = module; -## -## IPTS and ITHC touchscreen -## -## This only enables the user interface for IPTS/ITHC data. -## For the touchscreen to work, you need to install iptsd. -## -CONFIG_HID_IPTS= module; -CONFIG_HID_ITHC= module; + ## + ## IPTS and ITHC touchscreen + ## + ## This only enables the user interface for IPTS/ITHC data. + ## For the touchscreen to work, you need to install iptsd. + ## + CONFIG_HID_IPTS = module; + CONFIG_HID_ITHC = module; -## -## Cameras: IPU3 -## -CONFIG_VIDEO_DW9719= module; -CONFIG_VIDEO_IPU3_IMGU= module; -CONFIG_VIDEO_IPU3_CIO2= module; -CONFIG_IPU_BRIDGE= module; -CONFIG_INTEL_SKL_INT3472= module; -CONFIG_REGULATOR_TPS68470= module; -CONFIG_COMMON_CLK_TPS68470= module; -CONFIG_LEDS_TPS68470= module; + ## + ## Cameras: IPU3 + ## + CONFIG_VIDEO_DW9719 = module; + CONFIG_VIDEO_IPU3_IMGU = module; + CONFIG_VIDEO_IPU3_CIO2 = module; + CONFIG_IPU_BRIDGE = module; + CONFIG_INTEL_SKL_INT3472 = module; + CONFIG_REGULATOR_TPS68470 = module; + CONFIG_COMMON_CLK_TPS68470 = module; + CONFIG_LEDS_TPS68470 = module; -## -## Cameras: Sensor drivers -## -CONFIG_VIDEO_OV5693= module; -CONFIG_VIDEO_OV7251= module; -CONFIG_VIDEO_OV8865= module; + ## + ## Cameras: Sensor drivers + ## + CONFIG_VIDEO_OV5693 = module; + CONFIG_VIDEO_OV7251 = module; + CONFIG_VIDEO_OV8865 = module; -## -## Surface 3: atomisp causes problems (see issue #1095). Disable it for now. -## -# CONFIG_INTEL_ATOMISP is not set + ## + ## Surface 3: atomisp causes problems (see issue #1095). Disable it for now. + ## + # CONFIG_INTEL_ATOMISP is not set -## -## ALS Sensor for Surface Book 3, Surface Laptop 3, Surface Pro 7 -## -CONFIG_APDS9960= module; + ## + ## ALS Sensor for Surface Book 3, Surface Laptop 3, Surface Pro 7 + ## + CONFIG_APDS9960 = module; -## -## Build-in UFS support (required for some Surface Go devices) -## -CONFIG_SCSI_UFSHCD= module; -CONFIG_SCSI_UFSHCD_PCI= module; + ## + ## Build-in UFS support (required for some Surface Go devices) + ## + CONFIG_SCSI_UFSHCD = module; + CONFIG_SCSI_UFSHCD_PCI = module; -## -## Other Drivers -## -CONFIG_INPUT_SOC_BUTTON_ARRAY= module; -CONFIG_SURFACE_3_POWER_OPREGION= module; -CONFIG_SURFACE_PRO3_BUTTON= module; -CONFIG_SURFACE_GPE= module; -CONFIG_SURFACE_BOOK1_DGPU_SWITCH= module; + ## + ## Other Drivers + ## + CONFIG_INPUT_SOC_BUTTON_ARRAY = module; + CONFIG_SURFACE_3_POWER_OPREGION = module; + CONFIG_SURFACE_PRO3_BUTTON = module; + CONFIG_SURFACE_GPE = module; + CONFIG_SURFACE_BOOK1_DGPU_SWITCH = module; }; } { diff --git a/microsoft/surface/common/kernel/6.14/patches.nix b/microsoft/surface/common/kernel/6.14/patches.nix index a78be406..6f685ee4 100644 --- a/microsoft/surface/common/kernel/6.14/patches.nix +++ b/microsoft/surface/common/kernel/6.14/patches.nix @@ -1,4 +1,5 @@ -{ lib, +{ + lib, kernel ? lib.kernel, patchSrc, version, diff --git a/microsoft/surface/common/kernel/linux-package.nix b/microsoft/surface/common/kernel/linux-package.nix index 28e3e0e7..995ba75c 100644 --- a/microsoft/surface/common/kernel/linux-package.nix +++ b/microsoft/surface/common/kernel/linux-package.nix @@ -1,4 +1,5 @@ -{ pkgs, +{ + pkgs, lib, fetchurl, buildLinux, @@ -11,44 +12,73 @@ let inherit (lib) recurseIntoAttrs types versions; linuxPackage = - { url ? "mirror://kernel/linux/kernel/v${versions.major version}.x/linux-${version}.tar.xz", + { + url ? "mirror://kernel/linux/kernel/v${versions.major version}.x/linux-${version}.tar.xz", sha256 ? null, src ? (fetchurl { inherit url sha256; }), version, modDirVersion ? (versions.pad 3 version), - kernelPatches ? [], + kernelPatches ? [ ], ... - } @ args: let + }@args: + let inherit (builtins) removeAttrs; - args' = { - inherit src version modDirVersion kernelPatches; - } // removeAttrs args [ "url" "sha256" ]; + args' = + { + inherit + src + version + modDirVersion + kernelPatches + ; + } + // removeAttrs args [ + "url" + "sha256" + ]; linuxPackage = buildLinux args'; linuxPackages' = recurseIntoAttrs (linuxPackagesFor linuxPackage); - in linuxPackages'; + in + linuxPackages'; surfacePatches = - { patchSrc ? (repos.linux-surface + "/patches/${versions.majorMinor version}"), + { + patchSrc ? (repos.linux-surface + "/patches/${versions.majorMinor version}"), version, patchFn, - }: pkgs.callPackage patchFn { + }: + pkgs.callPackage patchFn { inherit (lib) kernel; inherit version patchSrc; }; - versionsOf = version: + versionsOf = + version: # Provides a list of versions that can be used as an enum option for this full version: - [ version (versions.majorMinor version) ]; + [ + version + (versions.majorMinor version) + ]; - versionsOfEnum = version: + versionsOfEnum = + version: # Provide an enum option for versions of this kernel: types.enum (versionsOf version); - isVersionOf = kernelVersion: version: + isVersionOf = + kernelVersion: version: # Test if the provided version is considered one of the list of versions from above: elem kernelVersion (versionsOf version); -in { - inherit linuxPackage repos surfacePatches versionsOf isVersionOf versionsOfEnum; +in +{ + inherit + linuxPackage + repos + surfacePatches + versionsOf + isVersionOf + versionsOfEnum + ; } diff --git a/microsoft/surface/surface-go/default.nix b/microsoft/surface/surface-go/default.nix index a86f741d..a5d717b1 100644 --- a/microsoft/surface/surface-go/default.nix +++ b/microsoft/surface/surface-go/default.nix @@ -6,7 +6,8 @@ let inherit (lib) mkDefault; -in { +in +{ imports = [ ../common ./firmware/ath10k diff --git a/microsoft/surface/surface-go/firmware/ath10k/ath10k-replace.nix b/microsoft/surface/surface-go/firmware/ath10k/ath10k-replace.nix index 132695e5..e5cf182d 100644 --- a/microsoft/surface/surface-go/firmware/ath10k/ath10k-replace.nix +++ b/microsoft/surface/surface-go/firmware/ath10k/ath10k-replace.nix @@ -1,4 +1,10 @@ -{ stdenv, lib, pkgs, firmwareLinuxNonfree, ... }: +{ + stdenv, + lib, + pkgs, + firmwareLinuxNonfree, + ... +}: let repos = pkgs.callPackage { @@ -8,14 +14,18 @@ let rev = "74e5409e699383d6ca2bc4da4a8433d16f3850b1"; sha256 = "169vgvxpgad9anmchs22fj5qm6ahzjfdnwhd8pc280q705vx6pjk"; }; - } {}; + } { }; killernetworking_firmware = repos.surface-go-ath10k-firmware_backup + "/K1535_Debian"; -in stdenv.mkDerivation { +in +stdenv.mkDerivation { pname = "microsoft-surface-go-firmware-linux-nonfree"; inherit (firmwareLinuxNonfree) version; src = firmwareLinuxNonfree; - phases = [ "unpackPhase" "installPhase" ]; + phases = [ + "unpackPhase" + "installPhase" + ]; installPhase = '' # Install the Surface Go Wifi firmware: diff --git a/microsoft/surface/surface-go/firmware/ath10k/default.nix b/microsoft/surface/surface-go/firmware/ath10k/default.nix index a7ad6a9a..efed6de8 100644 --- a/microsoft/surface/surface-go/firmware/ath10k/default.nix +++ b/microsoft/surface/surface-go/firmware/ath10k/default.nix @@ -1,11 +1,17 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let inherit (lib) mkDefault mkEnableOption mkIf; cfg = config.hardware.microsoft-surface.firmware.surface-go-ath10k; -in { +in +{ options = { hardware.microsoft-surface.firmware.surface-go-ath10k = { replace = mkEnableOption ''Use the "board.bin" firmware for ath10k-based WiFi on Surface Go.''; @@ -13,18 +19,21 @@ in { }; config = mkIf cfg.replace { - warnings = [''A working version of the ath10k QCA6174 firmware has been added to the kernel.org linux-firmware - repo, making this fix obsolete. - See: - - https://github.com/linux-surface/linux-surface/issues/542#issuecomment-976995453 - - https://github.com/linux-surface/linux-surface/wiki/Surface-Go#wi-fi-firmware + warnings = [ + '' + A working version of the ath10k QCA6174 firmware has been added to the kernel.org linux-firmware + repo, making this fix obsolete. + See: + - https://github.com/linux-surface/linux-surface/issues/542#issuecomment-976995453 + - https://github.com/linux-surface/linux-surface/wiki/Surface-Go#wi-fi-firmware - NOTE: This module option will probably be removed in the near future. - '']; + NOTE: This module option will probably be removed in the near future. + '' + ]; hardware.enableAllFirmware = true; hardware.firmware = [ - (pkgs.callPackage ./ath10k-replace.nix {}) + (pkgs.callPackage ./ath10k-replace.nix { }) ]; boot.extraModprobeConfig = mkDefault '' diff --git a/microsoft/surface/surface-pro-intel/default.nix b/microsoft/surface/surface-pro-intel/default.nix index 20ebbbab..c50e4515 100644 --- a/microsoft/surface/surface-pro-intel/default.nix +++ b/microsoft/surface/surface-pro-intel/default.nix @@ -15,7 +15,7 @@ services.iptsd.enable = lib.mkDefault true; environment.systemPackages = [ pkgs.surface-control ]; - + services.thermald = lib.mkDefault { enable = true; configFile = ./thermal-conf.xml; diff --git a/milkv/pioneer/default.nix b/milkv/pioneer/default.nix index aaf685a7..a7297e6d 100644 --- a/milkv/pioneer/default.nix +++ b/milkv/pioneer/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: { boot = { @@ -11,9 +16,11 @@ "sdhci_sophgo" ]; }; - kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./linux.nix { - inherit (config.boot) kernelPatches; - }); + kernelPackages = pkgs.linuxPackagesFor ( + pkgs.callPackage ./linux.nix { + inherit (config.boot) kernelPatches; + } + ); kernelParams = lib.mkDefault [ "earlycon" "console=ttyS0,115200" diff --git a/milkv/pioneer/firmware.nix b/milkv/pioneer/firmware.nix index fb49962b..2adedf74 100644 --- a/milkv/pioneer/firmware.nix +++ b/milkv/pioneer/firmware.nix @@ -1,12 +1,13 @@ -{ stdenv -, writeText -, opensbi -, fip -, zsbl -, linuxboot-kernel -, linuxboot-initrd -, dtbs ? "${linuxboot-kernel}/dtbs" -, ... +{ + stdenv, + writeText, + opensbi, + fip, + zsbl, + linuxboot-kernel, + linuxboot-initrd, + dtbs ? "${linuxboot-kernel}/dtbs", + ... }: let diff --git a/milkv/pioneer/linux.nix b/milkv/pioneer/linux.nix index b2396c75..48c4ecd1 100644 --- a/milkv/pioneer/linux.nix +++ b/milkv/pioneer/linux.nix @@ -1,44 +1,58 @@ -{ buildLinux, fetchFromGitHub, kernelPatches, lib, ... } @ args: +{ + buildLinux, + fetchFromGitHub, + kernelPatches, + lib, + ... +}@args: let modDirVersion = "6.6.20"; in -buildLinux (args // { - inherit kernelPatches modDirVersion; - version = "${modDirVersion}-milkv-pioneer"; - src = fetchFromGitHub { - owner = "sophgo"; - repo = "linux-riscv"; - rev = "caa949e3690fe8a4656313b2b56f52666fa880db"; - hash = "sha256-qJpR3KMgvP4tfPfBfQ/MiEWg/uuuxHYuACK8taKKK3E="; - }; +buildLinux ( + args + // { + inherit kernelPatches modDirVersion; + version = "${modDirVersion}-milkv-pioneer"; + src = fetchFromGitHub { + owner = "sophgo"; + repo = "linux-riscv"; + rev = "caa949e3690fe8a4656313b2b56f52666fa880db"; + hash = "sha256-qJpR3KMgvP4tfPfBfQ/MiEWg/uuuxHYuACK8taKKK3E="; + }; - defconfig = "sophgo_mango_normal_defconfig"; - structuredExtraConfig = let inherit (lib.kernel) freeform module yes; in { - # LinuxBoot will override the console bootparams which will result - # in the distro kernel to be booted with e.g. console=tty1 only. - # https://github.com/sophgo/bootloader-riscv/issues/71 - # Force output on serial console through the config. This is also - # needed to get the forced serial-getty to be started. - # We also list tty1 again because according to - # https://docs.kernel.org/admin-guide/serial-console.html and - # https://0pointer.de/blog/projects/serial-console.html - # this will be the main console. - CMDLINE = freeform "console=ttyS0,115200 console=tty1"; - CMDLINE_EXTEND = yes; + defconfig = "sophgo_mango_normal_defconfig"; + structuredExtraConfig = + let + inherit (lib.kernel) freeform module yes; + in + { + # LinuxBoot will override the console bootparams which will result + # in the distro kernel to be booted with e.g. console=tty1 only. + # https://github.com/sophgo/bootloader-riscv/issues/71 + # Force output on serial console through the config. This is also + # needed to get the forced serial-getty to be started. + # We also list tty1 again because according to + # https://docs.kernel.org/admin-guide/serial-console.html and + # https://0pointer.de/blog/projects/serial-console.html + # this will be the main console. + CMDLINE = freeform "console=ttyS0,115200 console=tty1"; + CMDLINE_EXTEND = yes; - # Enable these explicitly because they are not enabled by the defconfig. - # The all-hardware profile expects these to be built. - VIRTIO_MENU = yes; - VIRTIO_PCI = module; + # Enable these explicitly because they are not enabled by the defconfig. + # The all-hardware profile expects these to be built. + VIRTIO_MENU = yes; + VIRTIO_PCI = module; - # There is an i2c mcu driver (drivers/soc/sophgo/umcu) which is always - # compiled into the kernel. Hence some of the i2c support also needs to - # be compiled in instead of being compiled as a module. - I2C = yes; - I2C_CHARDEV = yes; - I2C_DESIGNWARE_PLATFORM = yes; - }; + # There is an i2c mcu driver (drivers/soc/sophgo/umcu) which is always + # compiled into the kernel. Hence some of the i2c support also needs to + # be compiled in instead of being compiled as a module. + I2C = yes; + I2C_CHARDEV = yes; + I2C_DESIGNWARE_PLATFORM = yes; + }; - extraMeta.branch = "sg2042-dev-6.6"; -} // (args.argsOverride or { })) + extraMeta.branch = "sg2042-dev-6.6"; + } + // (args.argsOverride or { }) +) diff --git a/milkv/pioneer/linuxboot-initrd.nix b/milkv/pioneer/linuxboot-initrd.nix index 507fc0e3..a0cfd7ef 100644 --- a/milkv/pioneer/linuxboot-initrd.nix +++ b/milkv/pioneer/linuxboot-initrd.nix @@ -1,9 +1,10 @@ -{ buildPackages -, fetchFromGitHub -, fetchpatch -, linux-firmware -, buildGoModule -, ... +{ + buildPackages, + fetchFromGitHub, + fetchpatch, + linux-firmware, + buildGoModule, + ... }: # Based on diff --git a/milkv/pioneer/linuxboot-kernel.nix b/milkv/pioneer/linuxboot-kernel.nix index 5f8fd815..d7d400e3 100644 --- a/milkv/pioneer/linuxboot-kernel.nix +++ b/milkv/pioneer/linuxboot-kernel.nix @@ -1,4 +1,10 @@ -{ fetchFromGitHub, lib, linuxManualConfig, stdenv, ... }: +{ + fetchFromGitHub, + lib, + linuxManualConfig, + stdenv, + ... +}: linuxManualConfig rec { inherit lib stdenv; diff --git a/milkv/pioneer/sd-image.nix b/milkv/pioneer/sd-image.nix index eaa378c4..dccfdd28 100644 --- a/milkv/pioneer/sd-image.nix +++ b/milkv/pioneer/sd-image.nix @@ -1,4 +1,10 @@ -{ config, lib, modulesPath, pkgs, ... }: +{ + config, + lib, + modulesPath, + pkgs, + ... +}: let inherit (pkgs) callPackage; @@ -10,7 +16,14 @@ let linuxboot-initrd = callPackage ./linuxboot-initrd.nix { }; dtbs = config.hardware.deviceTree.package; firmware = callPackage ./firmware.nix { - inherit fip zsbl opensbi linuxboot-kernel linuxboot-initrd dtbs; + inherit + fip + zsbl + opensbi + linuxboot-kernel + linuxboot-initrd + dtbs + ; }; in { diff --git a/milkv/pioneer/zsbl.nix b/milkv/pioneer/zsbl.nix index a275d301..9890e6fc 100644 --- a/milkv/pioneer/zsbl.nix +++ b/milkv/pioneer/zsbl.nix @@ -1,11 +1,12 @@ -{ buildPackages -, bison -, fetchFromGitHub -, flex -, lib -, stdenv +{ + buildPackages, + bison, + fetchFromGitHub, + flex, + lib, + stdenv, -, ... + ... }: stdenv.mkDerivation rec { pname = "zsbl-sg2042"; diff --git a/minisforum/v3/audio.nix b/minisforum/v3/audio.nix index 029b87ce..0cefc40a 100644 --- a/minisforum/v3/audio.nix +++ b/minisforum/v3/audio.nix @@ -1,7 +1,7 @@ { ... }: { # Fix microphone. - # Based on https://github.com/mudkipme/awesome-minisforum-v3/issues/10#issuecomment-2317474057 (Volume control workaround doesn't work on Arch) + # Based on https://github.com/mudkipme/awesome-minisforum-v3/issues/10#issuecomment-2317474057 (Volume control workaround doesn't work on Arch) boot.extraModprobeConfig = '' options snd-hda-intel model=alc256-asus-aio ''; diff --git a/minisforum/v3/sensors.nix b/minisforum/v3/sensors.nix index 0f336e90..453f29ed 100644 --- a/minisforum/v3/sensors.nix +++ b/minisforum/v3/sensors.nix @@ -5,7 +5,7 @@ hardware.sensor.iio.enable = lib.mkDefault true; services.fprintd.enable = lib.mkDefault true; - + # Override ACPI DSDT to fix the accelerometer. # A driver already exists for a similar sensor. # This overrides the IDs to make the existing driver work. @@ -16,7 +16,7 @@ name = "minisforum-acpi-override"; CPIO_PATH = "kernel/firmware/acpi"; - src = pkgs.callPackage ./src.nix {}; + src = pkgs.callPackage ./src.nix { }; patches = [ ./dsdt.patch ]; nativeBuildInputs = with pkgs; [ diff --git a/morefine/m600/default.nix b/morefine/m600/default.nix index 48790760..a2cae8d8 100644 --- a/morefine/m600/default.nix +++ b/morefine/m600/default.nix @@ -1,4 +1,5 @@ -{ lib, ...}: { +{ lib, ... }: +{ imports = [ ../../common/cpu/amd ../../common/cpu/amd/pstate.nix diff --git a/msi/b350-tomahawk/default.nix b/msi/b350-tomahawk/default.nix index 664c1029..440f32ae 100644 --- a/msi/b350-tomahawk/default.nix +++ b/msi/b350-tomahawk/default.nix @@ -5,5 +5,5 @@ ../../common/pc ]; - boot.kernelModules = ["nct6775"]; + boot.kernelModules = [ "nct6775" ]; } diff --git a/msi/b550-a-pro/default.nix b/msi/b550-a-pro/default.nix index e1070b0e..e1588005 100644 --- a/msi/b550-a-pro/default.nix +++ b/msi/b550-a-pro/default.nix @@ -5,5 +5,5 @@ ../../common/pc ]; - boot.kernelModules = ["nct6683"]; + boot.kernelModules = [ "nct6683" ]; } diff --git a/nxp/common/bsp/imx-atf.nix b/nxp/common/bsp/imx-atf.nix index efd8c43f..3325a13a 100644 --- a/nxp/common/bsp/imx-atf.nix +++ b/nxp/common/bsp/imx-atf.nix @@ -1,7 +1,7 @@ { - buildArmTrustedFirmware , - targetBoard , - fetchgit , + buildArmTrustedFirmware, + targetBoard, + fetchgit, }: { @@ -15,8 +15,11 @@ platform = targetBoard; enableParallelBuilding = true; # To build with tee.bin use extraMakeFlags = [ "bl31 SPD=opteed" ]; - extraMakeFlags = [ "PIE_LDFLAGS=--no-warn-rwx-segments LDFLAGS=--no-warn-rwx-segments" "bl31" ]; - extraMeta.platforms = ["aarch64-linux"]; - filesToInstall = ["build/${targetBoard}/release/bl31.bin"]; + extraMakeFlags = [ + "PIE_LDFLAGS=--no-warn-rwx-segments LDFLAGS=--no-warn-rwx-segments" + "bl31" + ]; + extraMeta.platforms = [ "aarch64-linux" ]; + filesToInstall = [ "build/${targetBoard}/release/bl31.bin" ]; }; } diff --git a/nxp/common/bsp/imx-firmware.nix b/nxp/common/bsp/imx-firmware.nix index 207d7ea2..46e905f8 100644 --- a/nxp/common/bsp/imx-firmware.nix +++ b/nxp/common/bsp/imx-firmware.nix @@ -1,5 +1,5 @@ { - pkgs , + pkgs, targetBoard, }: @@ -47,15 +47,21 @@ pkgs.stdenv.mkDerivation rec { ${firmwareSeco} --auto-accept --force ''; - filesToInstall = [ - "firmware-imx-${fwHdmiVersion}/firmware/hdmi/cadence/dpfw.bin" - "firmware-imx-${fwHdmiVersion}/firmware/hdmi/cadence/hdmi?xfw.bin" - ] ++ pkgs.lib.optional ( targetBoard == "imx8qm" ) - ("imx-sc-firmware-${fwScVersion}/mx8qm-mek-scfw-tcm.bin" + " " + - "imx-seco-${fwSecoVersion}/firmware/seco/mx8qmb0-ahab-container.img") - ++ pkgs.lib.optional ( targetBoard == "imx8qxp" ) - ("imx-sc-firmware-${fwScVersion}/mx8qx-mek-scfw-tcm.bin" + " " + - "imx-seco-${fwSecoVersion}/firmware/seco/mx8qxc0-ahab-container.img"); + filesToInstall = + [ + "firmware-imx-${fwHdmiVersion}/firmware/hdmi/cadence/dpfw.bin" + "firmware-imx-${fwHdmiVersion}/firmware/hdmi/cadence/hdmi?xfw.bin" + ] + ++ pkgs.lib.optional (targetBoard == "imx8qm") ( + "imx-sc-firmware-${fwScVersion}/mx8qm-mek-scfw-tcm.bin" + + " " + + "imx-seco-${fwSecoVersion}/firmware/seco/mx8qmb0-ahab-container.img" + ) + ++ pkgs.lib.optional (targetBoard == "imx8qxp") ( + "imx-sc-firmware-${fwScVersion}/mx8qx-mek-scfw-tcm.bin" + + " " + + "imx-seco-${fwSecoVersion}/firmware/seco/mx8qxc0-ahab-container.img" + ); installPhase = '' mkdir -p $out diff --git a/nxp/common/bsp/imx-optee-os.nix b/nxp/common/bsp/imx-optee-os.nix index eeef5a85..839d3dcd 100644 --- a/nxp/common/bsp/imx-optee-os.nix +++ b/nxp/common/bsp/imx-optee-os.nix @@ -5,9 +5,9 @@ let pkgsCross = import { - crossSystem = { - config = "aarch64-unknown-linux-gnu"; - }; + crossSystem = { + config = "aarch64-unknown-linux-gnu"; + }; }; outdir = "out/arm-plat-imx/core"; @@ -18,7 +18,7 @@ let in pkgs.stdenv.mkDerivation rec { - + pname = "imx-optee-os"; version = "5.15.32_2.0.0"; diff --git a/nxp/common/bsp/imx-uboot.nix b/nxp/common/bsp/imx-uboot.nix index 25cca39e..c2773f43 100644 --- a/nxp/common/bsp/imx-uboot.nix +++ b/nxp/common/bsp/imx-uboot.nix @@ -1,8 +1,10 @@ -{ pkgs , +{ + pkgs, targetBoard, }: -with pkgs; let +with pkgs; +let inherit buildUBoot; imx8qxp-attrs = { @@ -21,14 +23,25 @@ with pkgs; let patches = [ ../patches/0001-Add-UEFI-boot-for-imx8qm.patch ]; }; - imx8-attrs = if (targetBoard == "imx8qxp") then imx8qxp-attrs - else if (targetBoard == "imx8qm") then imx8qm-attrs - else {}; + imx8-attrs = + if (targetBoard == "imx8qxp") then + imx8qxp-attrs + else if (targetBoard == "imx8qm") then + imx8qm-attrs + else + { }; - inherit (callPackage ./imx-atf.nix { inherit buildArmTrustedFirmware; targetBoard = imx8-attrs.atf; }) armTrustedFirmwareiMX8; + inherit + (callPackage ./imx-atf.nix { + inherit buildArmTrustedFirmware; + targetBoard = imx8-attrs.atf; + }) + armTrustedFirmwareiMX8 + ; imx-firmware = callPackage ./imx-firmware.nix { inherit pkgs targetBoard; }; imx-mkimage = buildPackages.callPackage ./imx-mkimage.nix { inherit pkgs; }; -in { +in +{ ubootImx8 = buildUBoot { version = "2022.04"; src = fetchgit { @@ -41,7 +54,7 @@ in { patches = imx8-attrs.patches; enableParallelBuilding = true; defconfig = "${targetBoard}_mek_defconfig"; - extraMeta.platforms = ["aarch64-linux"]; + extraMeta.platforms = [ "aarch64-linux" ]; preBuildPhases = [ "copyBinaries" ]; copyBinaries = '' @@ -54,10 +67,9 @@ in { cat u-boot.bin head.hash > u-boot-hash.bin dd if=u-boot-hash.bin of=u-boot-atf.bin bs=1K seek=128 ${imx-mkimage} -soc ${imx8-attrs.soc} -rev B0 -append ahab-container.img -c -scfw ${imx8-attrs.scfw} -ap u-boot-atf.bin a35 0x80000000 -out flash.bin - ''; + ''; filesToInstall = [ "flash.bin" ]; }; inherit imx-firmware; } - diff --git a/nxp/common/modules.nix b/nxp/common/modules.nix index 16bf0ca4..e35eb405 100644 --- a/nxp/common/modules.nix +++ b/nxp/common/modules.nix @@ -1,4 +1,5 @@ -{ pkgs, lib, ... }: { +{ pkgs, lib, ... }: +{ nixpkgs.hostPlatform = "aarch64-linux"; boot = { diff --git a/nxp/imx8mp-evk/bsp/imx8mp-atf.nix b/nxp/imx8mp-evk/bsp/imx8mp-atf.nix index a75cec33..a3ac8107 100644 --- a/nxp/imx8mp-evk/bsp/imx8mp-atf.nix +++ b/nxp/imx8mp-evk/bsp/imx8mp-atf.nix @@ -1,8 +1,17 @@ -{ lib, fetchgit, enable-tee, stdenv, buildPackages, pkgsCross, openssl, }: +{ + lib, + fetchgit, + enable-tee, + stdenv, + buildPackages, + pkgsCross, + openssl, +}: let opteedflag = if enable-tee then "SPD=opteed" else ""; target-board = "imx8mp"; -in stdenv.mkDerivation rec { +in +stdenv.mkDerivation rec { pname = "imx8mp-atf"; version = "lf6.1.55_2.2.0"; platform = target-board; @@ -48,8 +57,7 @@ in stdenv.mkDerivation rec { meta = with lib; { homepage = "https://github.com/nxp-imx/imx-atf"; - description = - "Reference implementation of secure world software for ARMv8-A"; + description = "Reference implementation of secure world software for ARMv8-A"; license = [ licenses.bsd3 ]; maintainers = with maintainers; [ gngram ]; platforms = [ "aarch64-linux" ]; diff --git a/nxp/imx8mp-evk/bsp/imx8mp-boot.nix b/nxp/imx8mp-evk/bsp/imx8mp-boot.nix index b7fec803..8a74f500 100644 --- a/nxp/imx8mp-evk/bsp/imx8mp-boot.nix +++ b/nxp/imx8mp-evk/bsp/imx8mp-boot.nix @@ -2,26 +2,25 @@ pkgs, enable-tee ? true, }: -with pkgs; let +with pkgs; +let fw-ver = "202006"; - cp-tee = - if enable-tee - then "install -m 0644 ${imx8mp-optee-os}/tee.bin ./iMX8M/tee.bin" - else ""; + cp-tee = if enable-tee then "install -m 0644 ${imx8mp-optee-os}/tee.bin ./iMX8M/tee.bin" else ""; imx8mp-atf = pkgs.callPackage ./imx8mp-atf.nix { inherit enable-tee; }; - imx8mp-firmware = pkgs.callPackage ./imx8mp-firmware.nix {}; - imx8mp-uboot = pkgs.callPackage ./imx8mp-uboot.nix {}; - imx8mp-optee-os = pkgs.callPackage ./imx8mp-optee-os.nix {}; + imx8mp-firmware = pkgs.callPackage ./imx8mp-firmware.nix { }; + imx8mp-uboot = pkgs.callPackage ./imx8mp-uboot.nix { }; + imx8mp-optee-os = pkgs.callPackage ./imx8mp-optee-os.nix { }; src = pkgs.fetchgit { url = "https://github.com/nxp-imx/imx-mkimage.git"; rev = "c4365450fb115d87f245df2864fee1604d97c06a"; sha256 = "sha256-KVIVHwBpAwd1RKy3RrYxGIniE45CDlN5RQTXsMg1Jwk="; }; shortRev = builtins.substring 0 8 src.rev; -in { +in +{ imx8m-boot = pkgs.stdenv.mkDerivation rec { inherit src; name = "imx8mp-mkimage"; diff --git a/nxp/imx8mp-evk/bsp/imx8mp-firmware.nix b/nxp/imx8mp-evk/bsp/imx8mp-firmware.nix index 5dba9c70..361257fb 100644 --- a/nxp/imx8mp-evk/bsp/imx8mp-firmware.nix +++ b/nxp/imx8mp-evk/bsp/imx8mp-firmware.nix @@ -1,19 +1,19 @@ -{pkgs, ...}: +{ pkgs, ... }: with pkgs; - stdenv.mkDerivation rec { - pname = "imx8mp-firmware"; - version = "8.22"; +stdenv.mkDerivation rec { + pname = "imx8mp-firmware"; + version = "8.22"; - src = pkgs.fetchurl { - url = "https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-${version}.bin"; - sha256 = "sha256-lMi86sVuxQPCMuYU931rvY4Xx9qnHU5lHqj9UDTDA1A="; - }; + src = pkgs.fetchurl { + url = "https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-${version}.bin"; + sha256 = "sha256-lMi86sVuxQPCMuYU931rvY4Xx9qnHU5lHqj9UDTDA1A="; + }; - dontUnpack = true; - dontStrip = true; + dontUnpack = true; + dontStrip = true; - installPhase = '' - ${pkgs.bash}/bin/bash $src --auto-accept --force - mv firmware-imx-${version} $out - ''; - } + installPhase = '' + ${pkgs.bash}/bin/bash $src --auto-accept --force + mv firmware-imx-${version} $out + ''; +} diff --git a/nxp/imx8mp-evk/bsp/imx8mp-optee-os.nix b/nxp/imx8mp-evk/bsp/imx8mp-optee-os.nix index 70789f11..4119efb1 100644 --- a/nxp/imx8mp-evk/bsp/imx8mp-optee-os.nix +++ b/nxp/imx8mp-evk/bsp/imx8mp-optee-os.nix @@ -1,66 +1,67 @@ -{pkgs}: let +{ pkgs }: +let python3 = pkgs.buildPackages.python3; toolchain = pkgs.gcc9Stdenv.cc; binutils = pkgs.gcc9Stdenv.cc.bintools.bintools_bin; cpp = pkgs.gcc; in - pkgs.stdenv.mkDerivation rec { - pname = "imx8mp-optee-os"; - version = "lf-6.1.55-2.2.0"; +pkgs.stdenv.mkDerivation rec { + pname = "imx8mp-optee-os"; + version = "lf-6.1.55-2.2.0"; - nativeBuildInputs = [ - python3 - ]; + nativeBuildInputs = [ + python3 + ]; - enableParallelBuilding = true; + enableParallelBuilding = true; - propagatedBuildInputs = with python3.pkgs; [ - pycryptodomex - pyelftools - cryptography - ]; + propagatedBuildInputs = with python3.pkgs; [ + pycryptodomex + pyelftools + cryptography + ]; - src = pkgs.fetchgit { - url = "https://github.com/nxp-imx/imx-optee-os.git"; - rev = "a303fc80f7c4bd713315687a1fa1d6ed136e78ee"; - sha256 = "sha256-OpyG812DX0c06bRZPKWB2cNu6gtZCOvewDhsKgrGB+s="; - }; + src = pkgs.fetchgit { + url = "https://github.com/nxp-imx/imx-optee-os.git"; + rev = "a303fc80f7c4bd713315687a1fa1d6ed136e78ee"; + sha256 = "sha256-OpyG812DX0c06bRZPKWB2cNu6gtZCOvewDhsKgrGB+s="; + }; - postPatch = '' - substituteInPlace scripts/arm32_sysreg.py \ - --replace '/usr/bin/env python3' '${python3}/bin/python' - substituteInPlace scripts/gen_tee_bin.py \ - --replace '/usr/bin/env python3' '${python3}/bin/python' - substituteInPlace scripts/pem_to_pub_c.py \ - --replace '/usr/bin/env python3' '${python3}/bin/python' - substituteInPlace ta/pkcs11/scripts/verify-helpers.sh \ - --replace '/bin/bash' '${pkgs.bash}/bin/bash' - substituteInPlace mk/gcc.mk \ - --replace "\$(CROSS_COMPILE_\$(sm))objcopy" ${binutils}/bin/${toolchain.targetPrefix}objcopy - substituteInPlace mk/gcc.mk \ - --replace "\$(CROSS_COMPILE_\$(sm))objdump" ${binutils}/bin/${toolchain.targetPrefix}objdump - substituteInPlace mk/gcc.mk \ - --replace "\$(CROSS_COMPILE_\$(sm))nm" ${binutils}/bin/${toolchain.targetPrefix}nm - substituteInPlace mk/gcc.mk \ - --replace "\$(CROSS_COMPILE_\$(sm))readelf" ${binutils}/bin/${toolchain.targetPrefix}readelf - substituteInPlace mk/gcc.mk \ - --replace "\$(CROSS_COMPILE_\$(sm))ar" ${binutils}/bin/${toolchain.targetPrefix}ar - substituteInPlace mk/gcc.mk \ - --replace "\$(CROSS_COMPILE_\$(sm))cpp" ${cpp}/bin/cpp - ''; + postPatch = '' + substituteInPlace scripts/arm32_sysreg.py \ + --replace '/usr/bin/env python3' '${python3}/bin/python' + substituteInPlace scripts/gen_tee_bin.py \ + --replace '/usr/bin/env python3' '${python3}/bin/python' + substituteInPlace scripts/pem_to_pub_c.py \ + --replace '/usr/bin/env python3' '${python3}/bin/python' + substituteInPlace ta/pkcs11/scripts/verify-helpers.sh \ + --replace '/bin/bash' '${pkgs.bash}/bin/bash' + substituteInPlace mk/gcc.mk \ + --replace "\$(CROSS_COMPILE_\$(sm))objcopy" ${binutils}/bin/${toolchain.targetPrefix}objcopy + substituteInPlace mk/gcc.mk \ + --replace "\$(CROSS_COMPILE_\$(sm))objdump" ${binutils}/bin/${toolchain.targetPrefix}objdump + substituteInPlace mk/gcc.mk \ + --replace "\$(CROSS_COMPILE_\$(sm))nm" ${binutils}/bin/${toolchain.targetPrefix}nm + substituteInPlace mk/gcc.mk \ + --replace "\$(CROSS_COMPILE_\$(sm))readelf" ${binutils}/bin/${toolchain.targetPrefix}readelf + substituteInPlace mk/gcc.mk \ + --replace "\$(CROSS_COMPILE_\$(sm))ar" ${binutils}/bin/${toolchain.targetPrefix}ar + substituteInPlace mk/gcc.mk \ + --replace "\$(CROSS_COMPILE_\$(sm))cpp" ${cpp}/bin/cpp + ''; - makeFlags = [ - "PLATFORM=imx" - "PLATFORM_FLAVOR=mx8mpevk" - "CFG_ARM64_core=y" - "CFG_TEE_TA_LOG_LEVEL=0" - "CFG_TEE_CORE_LOG_LEVEL=0" - "CROSS_COMPILE=${toolchain}/bin/${toolchain.targetPrefix}" - "CROSS_COMPILE64=${toolchain}/bin/${toolchain.targetPrefix}" - ]; + makeFlags = [ + "PLATFORM=imx" + "PLATFORM_FLAVOR=mx8mpevk" + "CFG_ARM64_core=y" + "CFG_TEE_TA_LOG_LEVEL=0" + "CFG_TEE_CORE_LOG_LEVEL=0" + "CROSS_COMPILE=${toolchain}/bin/${toolchain.targetPrefix}" + "CROSS_COMPILE64=${toolchain}/bin/${toolchain.targetPrefix}" + ]; - installPhase = '' - mkdir -p $out - cp ./out/arm-plat-imx/core/tee-raw.bin $out/tee.bin - ''; - } + installPhase = '' + mkdir -p $out + cp ./out/arm-plat-imx/core/tee-raw.bin $out/tee.bin + ''; +} diff --git a/nxp/imx8mp-evk/bsp/imx8mp-uboot.nix b/nxp/imx8mp-evk/bsp/imx8mp-uboot.nix index c542af22..14586d47 100644 --- a/nxp/imx8mp-evk/bsp/imx8mp-uboot.nix +++ b/nxp/imx8mp-evk/bsp/imx8mp-uboot.nix @@ -1,90 +1,91 @@ -{ stdenv -, lib -, bison -, dtc -, fetchgit -, flex -, gnutls -, libuuid -, ncurses -, openssl -, which -, perl -, buildPackages +{ + stdenv, + lib, + bison, + dtc, + fetchgit, + flex, + gnutls, + libuuid, + ncurses, + openssl, + which, + perl, + buildPackages, }: let ubsrc = fetchgit { - url = "https://github.com/nxp-imx/uboot-imx.git"; - # tag: "lf-6.1.55-2.2.0" - rev = "49b102d98881fc28af6e0a8af5ea2186c1d90a5f"; - sha256 = "sha256-1j6X82DqezEizeWoSS600XKPNwrQ4yT0vZuUImKAVVA="; - }; + url = "https://github.com/nxp-imx/uboot-imx.git"; + # tag: "lf-6.1.55-2.2.0" + rev = "49b102d98881fc28af6e0a8af5ea2186c1d90a5f"; + sha256 = "sha256-1j6X82DqezEizeWoSS600XKPNwrQ4yT0vZuUImKAVVA="; + }; in - (stdenv.mkDerivation { - pname = "imx8mp-uboot"; - version = "2023.04"; - src = ubsrc; +(stdenv.mkDerivation { + pname = "imx8mp-uboot"; + version = "2023.04"; + src = ubsrc; - postPatch = '' - patchShebangs tools - patchShebangs scripts - ''; + postPatch = '' + patchShebangs tools + patchShebangs scripts + ''; - nativeBuildInputs = [ - bison - flex - openssl - which - ncurses - libuuid - gnutls - openssl - perl - ]; + nativeBuildInputs = [ + bison + flex + openssl + which + ncurses + libuuid + gnutls + openssl + perl + ]; - depsBuildBuild = [ buildPackages.stdenv.cc ]; - hardeningDisable = [ "all" ]; - enableParallelBuilding = true; + depsBuildBuild = [ buildPackages.stdenv.cc ]; + hardeningDisable = [ "all" ]; + enableParallelBuilding = true; - makeFlags = [ - "DTC=${lib.getExe buildPackages.dtc}" - "CROSS_COMPILE=${stdenv.cc.targetPrefix}" - ]; + makeFlags = [ + "DTC=${lib.getExe buildPackages.dtc}" + "CROSS_COMPILE=${stdenv.cc.targetPrefix}" + ]; - extraConfig = '' - CONFIG_USE_BOOTCOMMAND=y - CONFIG_BOOTCOMMAND="setenv ramdisk_addr_r 0x45000000; setenv fdt_addr_r 0x44000000; run distro_bootcmd; " - CONFIG_CMD_BOOTEFI_SELFTEST=y - CONFIG_CMD_BOOTEFI=y - CONFIG_EFI_LOADER=y - CONFIG_BLK=y - CONFIG_PARTITIONS=y - CONFIG_DM_DEVICE_REMOVE=n - CONFIG_CMD_CACHE=y - ''; + extraConfig = '' + CONFIG_USE_BOOTCOMMAND=y + CONFIG_BOOTCOMMAND="setenv ramdisk_addr_r 0x45000000; setenv fdt_addr_r 0x44000000; run distro_bootcmd; " + CONFIG_CMD_BOOTEFI_SELFTEST=y + CONFIG_CMD_BOOTEFI=y + CONFIG_EFI_LOADER=y + CONFIG_BLK=y + CONFIG_PARTITIONS=y + CONFIG_DM_DEVICE_REMOVE=n + CONFIG_CMD_CACHE=y + ''; - passAsFile = [ "extraConfig" ]; + passAsFile = [ "extraConfig" ]; - configurePhase = '' - runHook preConfigure + configurePhase = '' + runHook preConfigure - make imx8mp_evk_defconfig - cat $extraConfigPath >> .config + make imx8mp_evk_defconfig + cat $extraConfigPath >> .config - runHook postConfigure - ''; + runHook postConfigure + ''; - installPhase = '' - runHook preInstall + installPhase = '' + runHook preInstall - mkdir -p $out - cp ./u-boot-nodtb.bin $out - cp ./spl/u-boot-spl.bin $out - cp ./arch/arm/dts/imx8mp-evk.dtb $out - cp .config $out + mkdir -p $out + cp ./u-boot-nodtb.bin $out + cp ./spl/u-boot-spl.bin $out + cp ./arch/arm/dts/imx8mp-evk.dtb $out + cp .config $out - runHook postInstall - ''; + runHook postInstall + ''; - dontStrip = true; - }) + dontStrip = true; +}) diff --git a/nxp/imx8mp-evk/default.nix b/nxp/imx8mp-evk/default.nix index c4ba0505..13ec359a 100644 --- a/nxp/imx8mp-evk/default.nix +++ b/nxp/imx8mp-evk/default.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ nixpkgs.overlays = [ (import ./overlay.nix) ]; @@ -8,7 +9,7 @@ ]; boot.loader.grub.extraFiles = { - "imx8mp-evk.dtb" = "${pkgs.callPackage ./bsp/imx8mp-linux.nix {}}/dtbs/freescale/imx8mp-evk.dtb"; + "imx8mp-evk.dtb" = "${pkgs.callPackage ./bsp/imx8mp-linux.nix { }}/dtbs/freescale/imx8mp-evk.dtb"; }; hardware.deviceTree = { diff --git a/nxp/imx8mp-evk/modules.nix b/nxp/imx8mp-evk/modules.nix index d53f60d2..ec4e28f7 100644 --- a/nxp/imx8mp-evk/modules.nix +++ b/nxp/imx8mp-evk/modules.nix @@ -2,15 +2,16 @@ pkgs, lib, ... -}: { +}: +{ nixpkgs.hostPlatform = "aarch64-linux"; boot = { - kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/imx8mp-linux.nix {}); + kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/imx8mp-linux.nix { }); initrd.includeDefaultModules = lib.mkForce false; }; - disabledModules = ["profiles/all-hardware.nix"]; + disabledModules = [ "profiles/all-hardware.nix" ]; hardware.deviceTree.enable = true; } diff --git a/nxp/imx8mp-evk/overlay.nix b/nxp/imx8mp-evk/overlay.nix index 7f5d0c71..72166a37 100644 --- a/nxp/imx8mp-evk/overlay.nix +++ b/nxp/imx8mp-evk/overlay.nix @@ -1,3 +1,3 @@ -final: prev: { - inherit (final.callPackage ./bsp/imx8mp-boot.nix {pkgs = final;}) imx8m-boot; +final: _prev: { + inherit (final.callPackage ./bsp/imx8mp-boot.nix { pkgs = final; }) imx8m-boot; } diff --git a/nxp/imx8mq-evk/bsp/imx8mq-atf.nix b/nxp/imx8mq-evk/bsp/imx8mq-atf.nix index a7e86b86..151008bf 100644 --- a/nxp/imx8mq-evk/bsp/imx8mq-atf.nix +++ b/nxp/imx8mq-evk/bsp/imx8mq-atf.nix @@ -1,8 +1,17 @@ -{ lib, fetchgit, enable-tee, stdenv, buildPackages, pkgsCross, openssl, }: +{ + lib, + fetchgit, + enable-tee, + stdenv, + buildPackages, + pkgsCross, + openssl, +}: let opteedflag = if enable-tee then "SPD=opteed" else ""; target-board = "imx8mq"; -in stdenv.mkDerivation rec { +in +stdenv.mkDerivation rec { pname = "imx8mq-atf"; version = "lf6.1.55_2.2.0"; platform = target-board; @@ -48,8 +57,7 @@ in stdenv.mkDerivation rec { meta = with lib; { homepage = "https://github.com/nxp-imx/imx-atf"; - description = - "Reference implementation of secure world software for ARMv8-A"; + description = "Reference implementation of secure world software for ARMv8-A"; license = [ licenses.bsd3 ]; maintainers = with maintainers; [ gngram ]; platforms = [ "aarch64-linux" ]; diff --git a/nxp/imx8mq-evk/bsp/imx8mq-boot.nix b/nxp/imx8mq-evk/bsp/imx8mq-boot.nix index 2b5c246d..f38b3501 100644 --- a/nxp/imx8mq-evk/bsp/imx8mq-boot.nix +++ b/nxp/imx8mq-evk/bsp/imx8mq-boot.nix @@ -2,25 +2,24 @@ pkgs, enable-tee ? false, }: -with pkgs; let - cp-tee = - if enable-tee - then "install -m 0644 ${imx8mq-optee-os}/tee.bin ./iMX8M/tee.bin" - else ""; +with pkgs; +let + cp-tee = if enable-tee then "install -m 0644 ${imx8mq-optee-os}/tee.bin ./iMX8M/tee.bin" else ""; imx8mq-atf = pkgs.callPackage ./imx8mq-atf.nix { inherit enable-tee; }; - imx8mq-firmware = pkgs.callPackage ./imx8mq-firmware.nix {}; - imx8mq-uboot = pkgs.callPackage ./imx8mq-uboot.nix {}; - imx8mq-optee-os = pkgs.callPackage ./imx8mq-optee-os.nix {}; + imx8mq-firmware = pkgs.callPackage ./imx8mq-firmware.nix { }; + imx8mq-uboot = pkgs.callPackage ./imx8mq-uboot.nix { }; + imx8mq-optee-os = pkgs.callPackage ./imx8mq-optee-os.nix { }; src = pkgs.fetchgit { url = "https://github.com/nxp-imx/imx-mkimage.git"; rev = "c4365450fb115d87f245df2864fee1604d97c06a"; sha256 = "sha256-KVIVHwBpAwd1RKy3RrYxGIniE45CDlN5RQTXsMg1Jwk="; }; shortRev = builtins.substring 0 8 src.rev; -in { +in +{ imx8m-boot = pkgs.stdenv.mkDerivation rec { inherit src; name = "imx8mq-mkimage"; diff --git a/nxp/imx8mq-evk/bsp/imx8mq-firmware.nix b/nxp/imx8mq-evk/bsp/imx8mq-firmware.nix index e576f87f..05dba5f3 100644 --- a/nxp/imx8mq-evk/bsp/imx8mq-firmware.nix +++ b/nxp/imx8mq-evk/bsp/imx8mq-firmware.nix @@ -1,19 +1,19 @@ -{pkgs, ...}: +{ pkgs, ... }: with pkgs; - stdenv.mkDerivation rec { - pname = "imx8mq-firmware"; - version = "8.22"; +stdenv.mkDerivation rec { + pname = "imx8mq-firmware"; + version = "8.22"; - src = pkgs.fetchurl { - url = "https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-${version}.bin"; - sha256 = "sha256-lMi86sVuxQPCMuYU931rvY4Xx9qnHU5lHqj9UDTDA1A="; - }; + src = pkgs.fetchurl { + url = "https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-${version}.bin"; + sha256 = "sha256-lMi86sVuxQPCMuYU931rvY4Xx9qnHU5lHqj9UDTDA1A="; + }; - dontUnpack = true; - dontStrip = true; + dontUnpack = true; + dontStrip = true; - installPhase = '' - ${pkgs.bash}/bin/bash $src --auto-accept --force - mv firmware-imx-${version} $out - ''; - } + installPhase = '' + ${pkgs.bash}/bin/bash $src --auto-accept --force + mv firmware-imx-${version} $out + ''; +} diff --git a/nxp/imx8mq-evk/bsp/imx8mq-linux.nix b/nxp/imx8mq-evk/bsp/imx8mq-linux.nix index 8e433b8c..5c2fb535 100644 --- a/nxp/imx8mq-evk/bsp/imx8mq-linux.nix +++ b/nxp/imx8mq-evk/bsp/imx8mq-linux.nix @@ -1,54 +1,56 @@ -{pkgs, ...} @ args: +{ pkgs, ... }@args: with pkgs; - buildLinux (args - // rec { - version = "6.1.55"; - name = "imx8mq-linux"; +buildLinux ( + args + // rec { + version = "6.1.55"; + name = "imx8mq-linux"; - # modDirVersion needs to be x.y.z, will automatically add .0 if needed - modDirVersion = version; + # modDirVersion needs to be x.y.z, will automatically add .0 if needed + modDirVersion = version; - defconfig = "imx_v8_defconfig"; + defconfig = "imx_v8_defconfig"; - # https://github.com/NixOS/nixpkgs/pull/366004 - # introduced a breaking change that if a module is declared but it is not being used it will faill. - ignoreConfigErrors = true; + # https://github.com/NixOS/nixpkgs/pull/366004 + # introduced a breaking change that if a module is declared but it is not being used it will faill. + ignoreConfigErrors = true; - kernelPatches = [ - ]; + kernelPatches = [ + ]; - autoModules = false; + autoModules = false; - extraConfig = '' - CRYPTO_TLS m - TLS y - MD_RAID0 m - MD_RAID1 m - MD_RAID10 m - MD_RAID456 m - DM_VERITY m - LOGO y - FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER n - FB_EFI n - EFI_STUB y - EFI y - VIRTIO y - VIRTIO_PCI y - VIRTIO_BLK y - DRM_VIRTIO_GPU y - EXT4_FS y - USBIP_CORE m - USBIP_VHCI_HCD m - USBIP_HOST m - USBIP_VUDC m - ''; + extraConfig = '' + CRYPTO_TLS m + TLS y + MD_RAID0 m + MD_RAID1 m + MD_RAID10 m + MD_RAID456 m + DM_VERITY m + LOGO y + FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER n + FB_EFI n + EFI_STUB y + EFI y + VIRTIO y + VIRTIO_PCI y + VIRTIO_BLK y + DRM_VIRTIO_GPU y + EXT4_FS y + USBIP_CORE m + USBIP_VHCI_HCD m + USBIP_HOST m + USBIP_VUDC m + ''; - src = fetchFromGitHub { - owner = "nxp-imx"; - repo = "linux-imx"; - # tag: lf-6.1.55-2.2.0 - rev = "770c5fe2c1d1529fae21b7043911cd50c6cf087e"; - sha256 = "sha256-tIWt75RUrjB6KmUuAYBVyAC1dmVGSUAgqV5ROJh3xU0="; - }; - } - // (args.argsOverride or {})) + src = fetchFromGitHub { + owner = "nxp-imx"; + repo = "linux-imx"; + # tag: lf-6.1.55-2.2.0 + rev = "770c5fe2c1d1529fae21b7043911cd50c6cf087e"; + sha256 = "sha256-tIWt75RUrjB6KmUuAYBVyAC1dmVGSUAgqV5ROJh3xU0="; + }; + } + // (args.argsOverride or { }) +) diff --git a/nxp/imx8mq-evk/bsp/imx8mq-optee-os.nix b/nxp/imx8mq-evk/bsp/imx8mq-optee-os.nix index 4fa6e3e5..73b60a35 100644 --- a/nxp/imx8mq-evk/bsp/imx8mq-optee-os.nix +++ b/nxp/imx8mq-evk/bsp/imx8mq-optee-os.nix @@ -1,66 +1,67 @@ -{pkgs}: let +{ pkgs }: +let python3 = pkgs.buildPackages.python3; toolchain = pkgs.gcc9Stdenv.cc; binutils = pkgs.gcc9Stdenv.cc.bintools.bintools_bin; cpp = pkgs.gcc; in - pkgs.stdenv.mkDerivation rec { - pname = "imx8mq-optee-os"; - version = "lf-6.1.55-2.2.0"; +pkgs.stdenv.mkDerivation rec { + pname = "imx8mq-optee-os"; + version = "lf-6.1.55-2.2.0"; - nativeBuildInputs = [ - python3 - ]; + nativeBuildInputs = [ + python3 + ]; - enableParallelBuilding = true; + enableParallelBuilding = true; - propagatedBuildInputs = with python3.pkgs; [ - pycryptodomex - pyelftools - cryptography - ]; + propagatedBuildInputs = with python3.pkgs; [ + pycryptodomex + pyelftools + cryptography + ]; - src = pkgs.fetchgit { - url = "https://github.com/nxp-imx/imx-optee-os.git"; - rev = "a303fc80f7c4bd713315687a1fa1d6ed136e78ee"; - sha256 = "sha256-OpyG812DX0c06bRZPKWB2cNu6gtZCOvewDhsKgrGB+s="; - }; + src = pkgs.fetchgit { + url = "https://github.com/nxp-imx/imx-optee-os.git"; + rev = "a303fc80f7c4bd713315687a1fa1d6ed136e78ee"; + sha256 = "sha256-OpyG812DX0c06bRZPKWB2cNu6gtZCOvewDhsKgrGB+s="; + }; - postPatch = '' - substituteInPlace scripts/arm32_sysreg.py \ - --replace '/usr/bin/env python3' '${python3}/bin/python' - substituteInPlace scripts/gen_tee_bin.py \ - --replace '/usr/bin/env python3' '${python3}/bin/python' - substituteInPlace scripts/pem_to_pub_c.py \ - --replace '/usr/bin/env python3' '${python3}/bin/python' - substituteInPlace ta/pkcs11/scripts/verify-helpers.sh \ - --replace '/bin/bash' '${pkgs.bash}/bin/bash' - substituteInPlace mk/gcc.mk \ - --replace "\$(CROSS_COMPILE_\$(sm))objcopy" ${binutils}/bin/${toolchain.targetPrefix}objcopy - substituteInPlace mk/gcc.mk \ - --replace "\$(CROSS_COMPILE_\$(sm))objdump" ${binutils}/bin/${toolchain.targetPrefix}objdump - substituteInPlace mk/gcc.mk \ - --replace "\$(CROSS_COMPILE_\$(sm))nm" ${binutils}/bin/${toolchain.targetPrefix}nm - substituteInPlace mk/gcc.mk \ - --replace "\$(CROSS_COMPILE_\$(sm))readelf" ${binutils}/bin/${toolchain.targetPrefix}readelf - substituteInPlace mk/gcc.mk \ - --replace "\$(CROSS_COMPILE_\$(sm))ar" ${binutils}/bin/${toolchain.targetPrefix}ar - substituteInPlace mk/gcc.mk \ - --replace "\$(CROSS_COMPILE_\$(sm))cpp" ${cpp}/bin/cpp - ''; + postPatch = '' + substituteInPlace scripts/arm32_sysreg.py \ + --replace '/usr/bin/env python3' '${python3}/bin/python' + substituteInPlace scripts/gen_tee_bin.py \ + --replace '/usr/bin/env python3' '${python3}/bin/python' + substituteInPlace scripts/pem_to_pub_c.py \ + --replace '/usr/bin/env python3' '${python3}/bin/python' + substituteInPlace ta/pkcs11/scripts/verify-helpers.sh \ + --replace '/bin/bash' '${pkgs.bash}/bin/bash' + substituteInPlace mk/gcc.mk \ + --replace "\$(CROSS_COMPILE_\$(sm))objcopy" ${binutils}/bin/${toolchain.targetPrefix}objcopy + substituteInPlace mk/gcc.mk \ + --replace "\$(CROSS_COMPILE_\$(sm))objdump" ${binutils}/bin/${toolchain.targetPrefix}objdump + substituteInPlace mk/gcc.mk \ + --replace "\$(CROSS_COMPILE_\$(sm))nm" ${binutils}/bin/${toolchain.targetPrefix}nm + substituteInPlace mk/gcc.mk \ + --replace "\$(CROSS_COMPILE_\$(sm))readelf" ${binutils}/bin/${toolchain.targetPrefix}readelf + substituteInPlace mk/gcc.mk \ + --replace "\$(CROSS_COMPILE_\$(sm))ar" ${binutils}/bin/${toolchain.targetPrefix}ar + substituteInPlace mk/gcc.mk \ + --replace "\$(CROSS_COMPILE_\$(sm))cpp" ${cpp}/bin/cpp + ''; - makeFlags = [ - "PLATFORM=imx" - "PLATFORM_FLAVOR=mx8mqevk" - "CFG_ARM64_core=y" - "CFG_TEE_TA_LOG_LEVEL=0" - "CFG_TEE_CORE_LOG_LEVEL=0" - "CROSS_COMPILE=${toolchain}/bin/${toolchain.targetPrefix}" - "CROSS_COMPILE64=${toolchain}/bin/${toolchain.targetPrefix}" - ]; + makeFlags = [ + "PLATFORM=imx" + "PLATFORM_FLAVOR=mx8mqevk" + "CFG_ARM64_core=y" + "CFG_TEE_TA_LOG_LEVEL=0" + "CFG_TEE_CORE_LOG_LEVEL=0" + "CROSS_COMPILE=${toolchain}/bin/${toolchain.targetPrefix}" + "CROSS_COMPILE64=${toolchain}/bin/${toolchain.targetPrefix}" + ]; - installPhase = '' - mkdir -p $out - cp ./out/arm-plat-imx/core/tee-raw.bin $out/tee.bin - ''; - } + installPhase = '' + mkdir -p $out + cp ./out/arm-plat-imx/core/tee-raw.bin $out/tee.bin + ''; +} diff --git a/nxp/imx8mq-evk/bsp/imx8mq-uboot.nix b/nxp/imx8mq-evk/bsp/imx8mq-uboot.nix index fbbf92a1..7bb9c2df 100644 --- a/nxp/imx8mq-evk/bsp/imx8mq-uboot.nix +++ b/nxp/imx8mq-evk/bsp/imx8mq-uboot.nix @@ -1,90 +1,91 @@ -{ stdenv -, lib -, bison -, dtc -, fetchgit -, flex -, gnutls -, libuuid -, ncurses -, openssl -, which -, perl -, buildPackages +{ + stdenv, + lib, + bison, + dtc, + fetchgit, + flex, + gnutls, + libuuid, + ncurses, + openssl, + which, + perl, + buildPackages, }: let ubsrc = fetchgit { - url = "https://github.com/nxp-imx/uboot-imx.git"; - # tag: "lf-6.1.55-2.2.0" - rev = "49b102d98881fc28af6e0a8af5ea2186c1d90a5f"; - sha256 = "sha256-1j6X82DqezEizeWoSS600XKPNwrQ4yT0vZuUImKAVVA="; - }; + url = "https://github.com/nxp-imx/uboot-imx.git"; + # tag: "lf-6.1.55-2.2.0" + rev = "49b102d98881fc28af6e0a8af5ea2186c1d90a5f"; + sha256 = "sha256-1j6X82DqezEizeWoSS600XKPNwrQ4yT0vZuUImKAVVA="; + }; in - (stdenv.mkDerivation { - pname = "imx8mq-uboot"; - version = "2023.04"; - src = ubsrc; +(stdenv.mkDerivation { + pname = "imx8mq-uboot"; + version = "2023.04"; + src = ubsrc; - postPatch = '' - patchShebangs tools - patchShebangs scripts - ''; + postPatch = '' + patchShebangs tools + patchShebangs scripts + ''; - nativeBuildInputs = [ - bison - flex - openssl - which - ncurses - libuuid - gnutls - openssl - perl - ]; + nativeBuildInputs = [ + bison + flex + openssl + which + ncurses + libuuid + gnutls + openssl + perl + ]; - depsBuildBuild = [ buildPackages.stdenv.cc ]; - hardeningDisable = [ "all" ]; - enableParallelBuilding = true; + depsBuildBuild = [ buildPackages.stdenv.cc ]; + hardeningDisable = [ "all" ]; + enableParallelBuilding = true; - makeFlags = [ - "DTC=${lib.getExe buildPackages.dtc}" - "CROSS_COMPILE=${stdenv.cc.targetPrefix}" - ]; + makeFlags = [ + "DTC=${lib.getExe buildPackages.dtc}" + "CROSS_COMPILE=${stdenv.cc.targetPrefix}" + ]; - extraConfig = '' - CONFIG_USE_BOOTCOMMAND=y - CONFIG_BOOTCOMMAND="setenv ramdisk_addr_r 0x45000000; setenv fdt_addr_r 0x44000000; run distro_bootcmd; " - CONFIG_CMD_BOOTEFI_SELFTEST=y - CONFIG_CMD_BOOTEFI=y - CONFIG_EFI_LOADER=y - CONFIG_BLK=y - CONFIG_PARTITIONS=y - CONFIG_DM_DEVICE_REMOVE=n - CONFIG_CMD_CACHE=y - ''; + extraConfig = '' + CONFIG_USE_BOOTCOMMAND=y + CONFIG_BOOTCOMMAND="setenv ramdisk_addr_r 0x45000000; setenv fdt_addr_r 0x44000000; run distro_bootcmd; " + CONFIG_CMD_BOOTEFI_SELFTEST=y + CONFIG_CMD_BOOTEFI=y + CONFIG_EFI_LOADER=y + CONFIG_BLK=y + CONFIG_PARTITIONS=y + CONFIG_DM_DEVICE_REMOVE=n + CONFIG_CMD_CACHE=y + ''; - passAsFile = [ "extraConfig" ]; + passAsFile = [ "extraConfig" ]; - configurePhase = '' - runHook preConfigure + configurePhase = '' + runHook preConfigure - make imx8mq_evk_defconfig - cat $extraConfigPath >> .config + make imx8mq_evk_defconfig + cat $extraConfigPath >> .config - runHook postConfigure - ''; + runHook postConfigure + ''; - installPhase = '' - runHook preInstall + installPhase = '' + runHook preInstall - mkdir -p $out - cp ./u-boot-nodtb.bin $out - cp ./spl/u-boot-spl.bin $out - cp ./arch/arm/dts/imx8mq-evk.dtb $out - cp .config $out + mkdir -p $out + cp ./u-boot-nodtb.bin $out + cp ./spl/u-boot-spl.bin $out + cp ./arch/arm/dts/imx8mq-evk.dtb $out + cp .config $out - runHook postInstall - ''; + runHook postInstall + ''; - dontStrip = true; - }) + dontStrip = true; +}) diff --git a/nxp/imx8mq-evk/default.nix b/nxp/imx8mq-evk/default.nix index ca35c269..95504599 100644 --- a/nxp/imx8mq-evk/default.nix +++ b/nxp/imx8mq-evk/default.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ nixpkgs.overlays = [ (import ./overlay.nix) ]; @@ -8,7 +9,7 @@ ]; boot.loader.grub.extraFiles = { - "imx8mq-evk.dtb" = "${pkgs.callPackage ./bsp/imx8mq-linux.nix {}}/dtbs/freescale/imx8mq-evk.dtb"; + "imx8mq-evk.dtb" = "${pkgs.callPackage ./bsp/imx8mq-linux.nix { }}/dtbs/freescale/imx8mq-evk.dtb"; }; hardware.deviceTree = { diff --git a/nxp/imx8mq-evk/modules.nix b/nxp/imx8mq-evk/modules.nix index 4408bebc..0307d133 100644 --- a/nxp/imx8mq-evk/modules.nix +++ b/nxp/imx8mq-evk/modules.nix @@ -2,15 +2,16 @@ pkgs, lib, ... -}: { +}: +{ nixpkgs.hostPlatform = "aarch64-linux"; boot = { - kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/imx8mq-linux.nix {}); + kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./bsp/imx8mq-linux.nix { }); initrd.includeDefaultModules = lib.mkForce false; }; - disabledModules = ["profiles/all-hardware.nix"]; + disabledModules = [ "profiles/all-hardware.nix" ]; hardware.deviceTree.enable = true; } diff --git a/nxp/imx8mq-evk/overlay.nix b/nxp/imx8mq-evk/overlay.nix index 31af2bdc..ea53ce88 100644 --- a/nxp/imx8mq-evk/overlay.nix +++ b/nxp/imx8mq-evk/overlay.nix @@ -1,3 +1,3 @@ -final: prev: { - inherit (final.callPackage ./bsp/imx8mq-boot.nix {pkgs = final;}) imx8m-boot; +final: _prev: { + inherit (final.callPackage ./bsp/imx8mq-boot.nix { pkgs = final; }) imx8m-boot; } diff --git a/nxp/imx8qm-mek/default.nix b/nxp/imx8qm-mek/default.nix index 4974455c..52c8697f 100644 --- a/nxp/imx8qm-mek/default.nix +++ b/nxp/imx8qm-mek/default.nix @@ -10,7 +10,9 @@ ]; boot.loader.grub.extraFiles = { - "imx8qm-mek.dtb" = "${pkgs.callPackage ../common/bsp/linux-imx8.nix { }}/dtbs/freescale/imx8qm-mek.dtb"; + "imx8qm-mek.dtb" = "${ + pkgs.callPackage ../common/bsp/linux-imx8.nix { } + }/dtbs/freescale/imx8qm-mek.dtb"; }; hardware.deviceTree = { diff --git a/nxp/imx8qm-mek/overlay.nix b/nxp/imx8qm-mek/overlay.nix index db250883..12d1d946 100644 --- a/nxp/imx8qm-mek/overlay.nix +++ b/nxp/imx8qm-mek/overlay.nix @@ -1,3 +1,10 @@ -final: prev: { - inherit ( final.callPackage ../common/bsp/imx-uboot.nix { pkgs = final; targetBoard = "imx8qm"; }) ubootImx8 imx-firmware; +final: _prev: { + inherit + (final.callPackage ../common/bsp/imx-uboot.nix { + pkgs = final; + targetBoard = "imx8qm"; + }) + ubootImx8 + imx-firmware + ; } diff --git a/nxp/imx8qxp-mek/overlay.nix b/nxp/imx8qxp-mek/overlay.nix index 21b339d7..bcb344b7 100644 --- a/nxp/imx8qxp-mek/overlay.nix +++ b/nxp/imx8qxp-mek/overlay.nix @@ -1,3 +1,10 @@ -final: prev: { - inherit ( final.callPackage ../common/bsp/imx-uboot.nix { pkgs = final; targetBoard = "imx8qxp"; }) ubootImx8 imx-firmware; +final: _prev: { + inherit + (final.callPackage ../common/bsp/imx-uboot.nix { + pkgs = final; + targetBoard = "imx8qxp"; + }) + ubootImx8 + imx-firmware + ; } diff --git a/olimex/teres_i/default.nix b/olimex/teres_i/default.nix index f72cb1d4..4f2c97d5 100644 --- a/olimex/teres_i/default.nix +++ b/olimex/teres_i/default.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, ...}: +{ lib, pkgs, ... }: { hardware.deviceTree = { @@ -10,12 +10,12 @@ consoleLogLevel = lib.mkDefault 7; kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; - kernelParams = lib.mkDefault ["console=ttyS0,115200n8"]; - extraModulePackages = lib.mkDefault []; + kernelParams = lib.mkDefault [ "console=ttyS0,115200n8" ]; + extraModulePackages = lib.mkDefault [ ]; initrd = { - availableKernelModules = lib.mkDefault ["usbhid"]; - kernelModules = lib.mkDefault []; + availableKernelModules = lib.mkDefault [ "usbhid" ]; + kernelModules = lib.mkDefault [ ]; }; loader = { diff --git a/onenetbook/4/default.nix b/onenetbook/4/default.nix index 251bc651..c0b77f94 100644 --- a/onenetbook/4/default.nix +++ b/onenetbook/4/default.nix @@ -16,7 +16,7 @@ # `hid-multitouch-onenetbook4` is the fixed one, don't use `hid-multitouch`. boot.blacklistedKernelModules = [ "hid-multitouch" ]; boot.extraModulePackages = [ - (config.boot.kernelPackages.callPackage ./goodix-stylus-mastykin {}) + (config.boot.kernelPackages.callPackage ./goodix-stylus-mastykin { }) ]; # OneNetbook 4 has an accelerometer, diff --git a/onenetbook/4/goodix-stylus-mastykin/default.nix b/onenetbook/4/goodix-stylus-mastykin/default.nix index 14c5e5cd..8b81fdb0 100644 --- a/onenetbook/4/goodix-stylus-mastykin/default.nix +++ b/onenetbook/4/goodix-stylus-mastykin/default.nix @@ -1,4 +1,11 @@ -{ stdenv, lib, kernel, fetchpatch, runCommand, patch }: +{ + stdenv, + lib, + kernel, + fetchpatch, + runCommand, + patch, +}: let patch1_original = fetchpatch { @@ -6,24 +13,18 @@ let name = "goodix-stylus-mastykin-1-pen-support.patch"; sha256 = "sha256-1oc8OvfhScYvtsMeV9A4hU+09i59tEJ6HZS6jspsJR8="; }; - patch1_updated_5_12_12 = runCommand - "goodix-stylus-mastykin-1-pen-support-5.12.12.patch" {} - '' - cat ${patch1_original} > $out - ${patch}/bin/patch $out < ${./5.12.12.patch.patch} - ''; - patch1_updated_6_1 = runCommand - "goodix-stylus-mastykin-1-pen-support-6.1.patch" {} - '' - cat ${patch1_original} > $out - ${patch}/bin/patch $out < ${./6.1.patch.patch} - ''; - patch1_updated_6_12 = runCommand - "goodix-stylus-mastykin-1-pen-support-6.12.patch" {} - '' - cat ${patch1_original} > $out - ${patch}/bin/patch $out < ${./6.12.patch.patch} - ''; + patch1_updated_5_12_12 = runCommand "goodix-stylus-mastykin-1-pen-support-5.12.12.patch" { } '' + cat ${patch1_original} > $out + ${patch}/bin/patch $out < ${./5.12.12.patch.patch} + ''; + patch1_updated_6_1 = runCommand "goodix-stylus-mastykin-1-pen-support-6.1.patch" { } '' + cat ${patch1_original} > $out + ${patch}/bin/patch $out < ${./6.1.patch.patch} + ''; + patch1_updated_6_12 = runCommand "goodix-stylus-mastykin-1-pen-support-6.12.patch" { } '' + cat ${patch1_original} > $out + ${patch}/bin/patch $out < ${./6.12.patch.patch} + ''; patch1 = if (lib.versionAtLeast kernel.version "6.12") then patch1_updated_6_12 @@ -31,7 +32,8 @@ let patch1_updated_6_1 else if (lib.versionAtLeast kernel.version "5.12.12") then patch1_updated_5_12_12 - else patch1_original; + else + patch1_original; patch2 = fetchpatch { url = "https://marc.info/?l=linux-input&m=161847127221531&q=p4"; name = "goodix-stylus-mastykin-2-buttons.patch"; @@ -42,11 +44,17 @@ stdenv.mkDerivation rec { name = "hid-multitouch-onenetbook4-${version}"; inherit (kernel) version; - hardeningDisable = [ "pic" "format" ]; + hardeningDisable = [ + "pic" + "format" + ]; nativeBuildInputs = kernel.moduleBuildDependencies; src = ./.; - patches = [ patch1 patch2 ]; + patches = [ + patch1 + patch2 + ]; postUnpack = '' tar -C goodix-stylus-mastykin \ diff --git a/pine64/pinebook-pro/keyboard-updater/default.nix b/pine64/pinebook-pro/keyboard-updater/default.nix index 3138277f..2ed428cf 100644 --- a/pine64/pinebook-pro/keyboard-updater/default.nix +++ b/pine64/pinebook-pro/keyboard-updater/default.nix @@ -1,4 +1,9 @@ -{ stdenv, fetchFromGitHub, xxd, libusb1 }: +{ + stdenv, + fetchFromGitHub, + xxd, + libusb1, +}: stdenv.mkDerivation { pname = "pinebook-pro-keyboard-updater"; diff --git a/pine64/star64/default.nix b/pine64/star64/default.nix index ce7134bd..e286533c 100644 --- a/pine64/star64/default.nix +++ b/pine64/star64/default.nix @@ -1,9 +1,22 @@ -{ config, lib, pkgs, ... }: { - nixpkgs.overlays = [(self: super: { - makeModulesClosure = x: super.makeModulesClosure (x // { - allowMissing = true; - }); - })]; +{ + config, + lib, + pkgs, + ... +}: +{ + nixpkgs.overlays = [ + (_self: super: { + makeModulesClosure = + x: + super.makeModulesClosure ( + x + // { + allowMissing = true; + } + ); + }) + ]; # Somehow ttyS0 doesn't get enabled by default systemd.services."serial-getty@ttyS0".enable = lib.mkDefault true; @@ -12,15 +25,27 @@ boot = { # Force no ZFS (from nixos/modules/profiles/base.nix) until updated to kernel 6.0 # TODO still valid for star64? - supportedFilesystems = - lib.mkForce [ "btrfs" "reiserfs" "vfat" "f2fs" "xfs" "ntfs" "cifs" ]; + supportedFilesystems = lib.mkForce [ + "btrfs" + "reiserfs" + "vfat" + "f2fs" + "xfs" + "ntfs" + "cifs" + ]; consoleLogLevel = lib.mkDefault 7; - kernelPackages = lib.mkDefault (pkgs.callPackage ./linux-5.15.nix { - inherit (config.boot) kernelPatches; - }); + kernelPackages = lib.mkDefault ( + pkgs.callPackage ./linux-5.15.nix { + inherit (config.boot) kernelPatches; + } + ); - kernelParams = - lib.mkDefault [ "console=tty0" "console=ttyS0,115200n8" "earlycon=sbi" ]; + kernelParams = lib.mkDefault [ + "console=tty0" + "console=ttyS0,115200n8" + "earlycon=sbi" + ]; initrd.availableKernelModules = [ "8250_dw" # serial port driver @@ -39,8 +64,7 @@ }; }; - hardware.deviceTree.name = - lib.mkDefault "starfive/jh7110-pine64-star64.dtb"; + hardware.deviceTree.name = lib.mkDefault "starfive/jh7110-pine64-star64.dtb"; # Only "performance" and "schedutil" are available, # and "performance" takes precedence by default, which is a waste of power. diff --git a/pine64/star64/firmware.nix b/pine64/star64/firmware.nix index e0173a6c..5242f779 100644 --- a/pine64/star64/firmware.nix +++ b/pine64/star64/firmware.nix @@ -1,5 +1,13 @@ -{ callPackage, pkgsBuildHost, writeText, writeShellApplication -, stdenv, dtc, mtdutils, coreutils }: +{ + callPackage, + pkgsBuildHost, + writeText, + writeShellApplication, + stdenv, + dtc, + mtdutils, + coreutils, +}: let uboot = callPackage ./uboot.nix { }; opensbi = callPackage ./opensbi.nix { @@ -37,7 +45,8 @@ let }; }; ''; -in rec { +in +rec { inherit opensbi uboot; spl = stdenv.mkDerivation { name = "pine64-star64-spl"; diff --git a/pine64/star64/linux-5.15.nix b/pine64/star64/linux-5.15.nix index 020af357..28d9adbb 100644 --- a/pine64/star64/linux-5.15.nix +++ b/pine64/star64/linux-5.15.nix @@ -1,237 +1,257 @@ -{ lib, callPackage, linuxPackagesFor, kernelPatches, fetchpatch, ... }: +{ + lib, + callPackage, + linuxPackagesFor, + kernelPatches, + fetchpatch, + ... +}: let modDirVersion = "5.15.131"; - linuxPkg = { lib, fetchFromGitHub, buildLinux, ... }@args: - buildLinux (args // { - version = "${modDirVersion}-fishwaldo-star64"; + linuxPkg = + { + lib, + fetchFromGitHub, + buildLinux, + ... + }@args: + buildLinux ( + args + // { + version = "${modDirVersion}-fishwaldo-star64"; - src = fetchFromGitHub { - owner = "Fishwaldo"; - repo = "Star64_linux"; - rev = "1456c984f15e21e28fb8a9ce96d0ca10e61a71c4"; # Star64_devel branch - hash = "sha256-I5wzmxiY7PWpahYCqTOAmYEiJvpRPpUV7S21Kn9lLwg="; - }; + src = fetchFromGitHub { + owner = "Fishwaldo"; + repo = "Star64_linux"; + rev = "1456c984f15e21e28fb8a9ce96d0ca10e61a71c4"; # Star64_devel branch + hash = "sha256-I5wzmxiY7PWpahYCqTOAmYEiJvpRPpUV7S21Kn9lLwg="; + }; - inherit modDirVersion; - defconfig = "pine64_star64_defconfig"; - kernelPatches = [ - { patch = fetchpatch { - url = "https://github.com/torvalds/linux/commit/215bebc8c6ac438c382a6a56bd2764a2d4e1da72.diff"; - hash = "sha256-1ZqmVOkgcDBRkHvVRPH8I5G1STIS1R/l/63PzQQ0z0I="; - includes = ["security/keys/dh.c"]; - }; - } - { patch = fetchpatch { - url = "https://github.com/starfive-tech/linux/pull/108/commits/9ae8cb751c4d1fd2146b279a8e67887590e9d07a.diff"; - hash = "sha256-EY0lno+HkY5mradBUPII3qqu0xh+BVQRzveCQcaht0M="; - }; - } - { patch = ./irq-desc-to-data.patch; } - ] ++ kernelPatches; + inherit modDirVersion; + defconfig = "pine64_star64_defconfig"; + kernelPatches = [ + { + patch = fetchpatch { + url = "https://github.com/torvalds/linux/commit/215bebc8c6ac438c382a6a56bd2764a2d4e1da72.diff"; + hash = "sha256-1ZqmVOkgcDBRkHvVRPH8I5G1STIS1R/l/63PzQQ0z0I="; + includes = [ "security/keys/dh.c" ]; + }; + } + { + patch = fetchpatch { + url = "https://github.com/starfive-tech/linux/pull/108/commits/9ae8cb751c4d1fd2146b279a8e67887590e9d07a.diff"; + hash = "sha256-EY0lno+HkY5mradBUPII3qqu0xh+BVQRzveCQcaht0M="; + }; + } + { patch = ./irq-desc-to-data.patch; } + ] ++ kernelPatches; - structuredExtraConfig = with lib.kernel; { - # A ton of stuff just does not build. We disable it all. - # Most of it is not important except drm. - # https://github.com/starfive-tech/linux/issues/79 + structuredExtraConfig = with lib.kernel; { + # A ton of stuff just does not build. We disable it all. + # Most of it is not important except drm. + # https://github.com/starfive-tech/linux/issues/79 - # Removed files, re-added to the makefile by accident in - # https://github.com/Fishwaldo/Star64_linux/commit/cd96097d17a494974dfc5e9909476145ab4f09f5 - CRYPTO_RMD128 = no; - CRYPTO_RMD256 = no; - CRYPTO_RMD320 = no; - CRYPTO_TGR192 = no; - CRYPTO_SALSA20 = no; + # Removed files, re-added to the makefile by accident in + # https://github.com/Fishwaldo/Star64_linux/commit/cd96097d17a494974dfc5e9909476145ab4f09f5 + CRYPTO_RMD128 = no; + CRYPTO_RMD256 = no; + CRYPTO_RMD320 = no; + CRYPTO_TGR192 = no; + CRYPTO_SALSA20 = no; - CRYPTO_SM4 = no; # modpost: undefined stuff - CRYPTO_DEV_CCREE = no; # reverse dep of CRYPTO_SM4 - NLS_CODEPAGE_949 = no; - VIDEO_OV5640 = no; # conflicts with starfive VIN_SENSOR_OV5640 + CRYPTO_SM4 = no; # modpost: undefined stuff + CRYPTO_DEV_CCREE = no; # reverse dep of CRYPTO_SM4 + NLS_CODEPAGE_949 = no; + VIDEO_OV5640 = no; # conflicts with starfive VIN_SENSOR_OV5640 - DRM_IMG = no; - DRM_IMG_ROGUE = no; - DRM_VERISILICON = no; + DRM_IMG = no; + DRM_IMG_ROGUE = no; + DRM_VERISILICON = no; - # brute force disable drm - CEC_CORE = no; - CEC_NOTIFIER = no; - DRM = lib.mkForce no; - DRM_MIPI_DBI = no; - DRM_MIPI_DSI = no; - DRM_DP_AUX_BUS = no; - DRM_DP_AUX_CHARDEV = lib.mkForce no; - DRM_KMS_HELPER = no; - DRM_FBDEV_EMULATION = lib.mkForce no; - DRM_LOAD_EDID_FIRMWARE = lib.mkForce no; - DRM_TTM = no; - DRM_VRAM_HELPER = no; - DRM_TTM_HELPER = no; - DRM_GEM_CMA_HELPER = no; - DRM_KMS_CMA_HELPER = no; - DRM_GEM_SHMEM_HELPER = no; - DRM_SCHED = no; - DRM_I2C_CH7006 = no; - DRM_I2C_SIL164 = no; - DRM_I2C_NXP_TDA998X = no; # https://github.com/starfive-tech/linux/pull/86 - DRM_I2C_NXP_TDA9950 = no; - DRM_KOMEDA = no; - DRM_RADEON = no; - DRM_AMDGPU = no; - DRM_AMDGPU_SI = lib.mkForce no; - DRM_AMDGPU_CIK = lib.mkForce no; - DRM_AMDGPU_USERPTR = lib.mkForce no; - DRM_AMD_DC = no; - DRM_AMD_DC_HDCP = lib.mkForce no; - DRM_AMD_DC_SI = lib.mkForce no; - DRM_NOUVEAU = no; - NOUVEAU_LEGACY_CTX_SUPPORT = no; - DRM_NOUVEAU_BACKLIGHT = no; - DRM_VGEM = no; - DRM_VKMS = no; - DRM_UDL = no; - DRM_AST = no; - DRM_MGAG200 = no; - DRM_RCAR_DW_HDMI = no; - DRM_QXL = no; - DRM_VIRTIO_GPU = no; - DRM_PANEL = no; - DRM_PANEL_ABT_Y030XX067A = no; - DRM_PANEL_ARM_VERSATILE = no; - DRM_PANEL_ASUS_Z00T_TM5P5_NT35596 = no; - DRM_PANEL_BOE_HIMAX8279D = no; - DRM_PANEL_BOE_TV101WUM_NL6 = no; - DRM_PANEL_DSI_CM = no; - DRM_PANEL_LVDS = no; - DRM_PANEL_SIMPLE = no; - DRM_PANEL_ELIDA_KD35T133 = no; - DRM_PANEL_FEIXIN_K101_IM2BA02 = no; - DRM_PANEL_FEIYANG_FY07024DI26A30D = no; - DRM_PANEL_ILITEK_IL9322 = no; - DRM_PANEL_ILITEK_ILI9341 = no; - DRM_PANEL_ILITEK_ILI9881C = no; - DRM_PANEL_INNOLUX_EJ030NA = no; - DRM_PANEL_INNOLUX_P079ZCA = no; - DRM_PANEL_JDI_LT070ME05000 = no; - DRM_PANEL_KHADAS_TS050 = no; - DRM_PANEL_KINGDISPLAY_KD097D04 = no; - DRM_PANEL_LEADTEK_LTK050H3146W = no; - DRM_PANEL_LEADTEK_LTK500HD1829 = no; - DRM_PANEL_SAMSUNG_LD9040 = no; - DRM_PANEL_LG_LB035Q02 = no; - DRM_PANEL_LG_LG4573 = no; - DRM_PANEL_NEC_NL8048HL11 = no; - DRM_PANEL_NOVATEK_NT35510 = no; - DRM_PANEL_NOVATEK_NT36672A = no; - DRM_PANEL_NOVATEK_NT39016 = no; - DRM_PANEL_MANTIX_MLAF057WE51 = no; - DRM_PANEL_OLIMEX_LCD_OLINUXINO = no; - DRM_PANEL_ORISETECH_OTM8009A = no; - DRM_PANEL_OSD_OSD101T2587_53TS = no; - DRM_PANEL_PANASONIC_VVX10F034N00 = no; - DRM_PANEL_RASPBERRYPI_TOUCHSCREEN = no; - DRM_PANEL_RAYDIUM_RM67191 = no; - DRM_PANEL_RAYDIUM_RM68200 = no; - DRM_PANEL_RONBO_RB070D30 = no; - DRM_PANEL_SAMSUNG_ATNA33XC20 = no; - DRM_PANEL_SAMSUNG_DB7430 = no; - DRM_PANEL_SAMSUNG_S6D16D0 = no; - DRM_PANEL_SAMSUNG_S6E3HA2 = no; - DRM_PANEL_SAMSUNG_S6E63J0X03 = no; - DRM_PANEL_SAMSUNG_S6E63M0 = no; - DRM_PANEL_SAMSUNG_S6E63M0_SPI = no; - DRM_PANEL_SAMSUNG_S6E63M0_DSI = no; - DRM_PANEL_SAMSUNG_S6E88A0_AMS452EF01 = no; - DRM_PANEL_SAMSUNG_S6E8AA0 = no; - DRM_PANEL_SAMSUNG_SOFEF00 = no; - DRM_PANEL_SEIKO_43WVF1G = no; - DRM_PANEL_SHARP_LQ101R1SX01 = no; - DRM_PANEL_SHARP_LS037V7DW01 = no; - DRM_PANEL_SHARP_LS043T1LE01 = no; - DRM_PANEL_SITRONIX_ST7701 = no; - DRM_PANEL_SITRONIX_ST7703 = no; - DRM_PANEL_SITRONIX_ST7789V = no; - DRM_PANEL_SONY_ACX565AKM = no; - DRM_PANEL_TDO_TL070WSH30 = no; - DRM_PANEL_TPO_TD028TTEC1 = no; - DRM_PANEL_TPO_TD043MTEA1 = no; - DRM_PANEL_TPO_TPG110 = no; - DRM_PANEL_TRULY_NT35597_WQXGA = no; - DRM_PANEL_VISIONOX_RM69299 = no; - DRM_PANEL_WIDECHIPS_WS2401 = no; - DRM_PANEL_XINPENG_XPP055C272 = no; - DRM_BRIDGE = no; - DRM_PANEL_BRIDGE = no; - DRM_CDNS_DSI = no; - DRM_CHIPONE_ICN6211 = no; - DRM_CHRONTEL_CH7033 = no; - DRM_DISPLAY_CONNECTOR = no; - DRM_LONTIUM_LT8912B = no; - DRM_LONTIUM_LT9611 = no; - DRM_LONTIUM_LT9611UXC = no; - DRM_ITE_IT66121 = no; - DRM_LVDS_CODEC = no; - DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW = no; - DRM_NWL_MIPI_DSI = no; - DRM_NXP_PTN3460 = no; - DRM_PARADE_PS8622 = no; - DRM_PARADE_PS8640 = no; - DRM_SIL_SII8620 = no; - DRM_SII902X = no; - DRM_SII9234 = no; - DRM_SIMPLE_BRIDGE = no; - DRM_THINE_THC63LVD1024 = no; - DRM_TOSHIBA_TC358762 = no; - DRM_TOSHIBA_TC358764 = no; - DRM_TOSHIBA_TC358767 = no; - DRM_TOSHIBA_TC358768 = no; - DRM_TOSHIBA_TC358775 = no; - DRM_TI_TFP410 = no; - DRM_TI_SN65DSI83 = no; - DRM_TI_SN65DSI86 = no; - DRM_TI_TPD12S015 = no; - DRM_ANALOGIX_ANX6345 = no; - DRM_ANALOGIX_ANX78XX = no; - DRM_ANALOGIX_DP = no; - DRM_ANALOGIX_ANX7625 = no; - DRM_I2C_ADV7511 = no; - DRM_I2C_ADV7511_CEC = no; - DRM_CDNS_MHDP8546 = no; - DRM_DW_HDMI = no; - DRM_DW_HDMI_AHB_AUDIO = no; - DRM_DW_HDMI_I2S_AUDIO = no; - DRM_DW_HDMI_CEC = no; - DRM_ETNAVIV = no; - DRM_ETNAVIV_THERMAL = no; - DRM_MXS = no; - DRM_MXSFB = no; - DRM_ARCPGU = no; - DRM_BOCHS = no; - DRM_CIRRUS_QEMU = no; - DRM_GM12U320 = no; - TINYDRM_HX8357D = no; - TINYDRM_ILI9225 = no; - TINYDRM_ILI9341 = no; - TINYDRM_ILI9486 = no; - TINYDRM_MI0283QT = no; - TINYDRM_REPAPER = no; - TINYDRM_ST7586 = no; - TINYDRM_ST7735R = no; - DRM_GUD = no; - DRM_LEGACY = no; - DRM_TDFX = no; - DRM_R128 = no; - DRM_MGA = no; - DRM_VIA = no; - DRM_SAVAGE = no; - VIDEOMODE_HELPERS = no; - SND_PCM_ELD = no; - SND_PCM_IEC958 = no; - SND_HDA_COMPONENT = no; - SND_SOC_HDMI_CODEC = no; - VIRTIO_DMA_SHARED_BUFFER = no; - }; + # brute force disable drm + CEC_CORE = no; + CEC_NOTIFIER = no; + DRM = lib.mkForce no; + DRM_MIPI_DBI = no; + DRM_MIPI_DSI = no; + DRM_DP_AUX_BUS = no; + DRM_DP_AUX_CHARDEV = lib.mkForce no; + DRM_KMS_HELPER = no; + DRM_FBDEV_EMULATION = lib.mkForce no; + DRM_LOAD_EDID_FIRMWARE = lib.mkForce no; + DRM_TTM = no; + DRM_VRAM_HELPER = no; + DRM_TTM_HELPER = no; + DRM_GEM_CMA_HELPER = no; + DRM_KMS_CMA_HELPER = no; + DRM_GEM_SHMEM_HELPER = no; + DRM_SCHED = no; + DRM_I2C_CH7006 = no; + DRM_I2C_SIL164 = no; + DRM_I2C_NXP_TDA998X = no; # https://github.com/starfive-tech/linux/pull/86 + DRM_I2C_NXP_TDA9950 = no; + DRM_KOMEDA = no; + DRM_RADEON = no; + DRM_AMDGPU = no; + DRM_AMDGPU_SI = lib.mkForce no; + DRM_AMDGPU_CIK = lib.mkForce no; + DRM_AMDGPU_USERPTR = lib.mkForce no; + DRM_AMD_DC = no; + DRM_AMD_DC_HDCP = lib.mkForce no; + DRM_AMD_DC_SI = lib.mkForce no; + DRM_NOUVEAU = no; + NOUVEAU_LEGACY_CTX_SUPPORT = no; + DRM_NOUVEAU_BACKLIGHT = no; + DRM_VGEM = no; + DRM_VKMS = no; + DRM_UDL = no; + DRM_AST = no; + DRM_MGAG200 = no; + DRM_RCAR_DW_HDMI = no; + DRM_QXL = no; + DRM_VIRTIO_GPU = no; + DRM_PANEL = no; + DRM_PANEL_ABT_Y030XX067A = no; + DRM_PANEL_ARM_VERSATILE = no; + DRM_PANEL_ASUS_Z00T_TM5P5_NT35596 = no; + DRM_PANEL_BOE_HIMAX8279D = no; + DRM_PANEL_BOE_TV101WUM_NL6 = no; + DRM_PANEL_DSI_CM = no; + DRM_PANEL_LVDS = no; + DRM_PANEL_SIMPLE = no; + DRM_PANEL_ELIDA_KD35T133 = no; + DRM_PANEL_FEIXIN_K101_IM2BA02 = no; + DRM_PANEL_FEIYANG_FY07024DI26A30D = no; + DRM_PANEL_ILITEK_IL9322 = no; + DRM_PANEL_ILITEK_ILI9341 = no; + DRM_PANEL_ILITEK_ILI9881C = no; + DRM_PANEL_INNOLUX_EJ030NA = no; + DRM_PANEL_INNOLUX_P079ZCA = no; + DRM_PANEL_JDI_LT070ME05000 = no; + DRM_PANEL_KHADAS_TS050 = no; + DRM_PANEL_KINGDISPLAY_KD097D04 = no; + DRM_PANEL_LEADTEK_LTK050H3146W = no; + DRM_PANEL_LEADTEK_LTK500HD1829 = no; + DRM_PANEL_SAMSUNG_LD9040 = no; + DRM_PANEL_LG_LB035Q02 = no; + DRM_PANEL_LG_LG4573 = no; + DRM_PANEL_NEC_NL8048HL11 = no; + DRM_PANEL_NOVATEK_NT35510 = no; + DRM_PANEL_NOVATEK_NT36672A = no; + DRM_PANEL_NOVATEK_NT39016 = no; + DRM_PANEL_MANTIX_MLAF057WE51 = no; + DRM_PANEL_OLIMEX_LCD_OLINUXINO = no; + DRM_PANEL_ORISETECH_OTM8009A = no; + DRM_PANEL_OSD_OSD101T2587_53TS = no; + DRM_PANEL_PANASONIC_VVX10F034N00 = no; + DRM_PANEL_RASPBERRYPI_TOUCHSCREEN = no; + DRM_PANEL_RAYDIUM_RM67191 = no; + DRM_PANEL_RAYDIUM_RM68200 = no; + DRM_PANEL_RONBO_RB070D30 = no; + DRM_PANEL_SAMSUNG_ATNA33XC20 = no; + DRM_PANEL_SAMSUNG_DB7430 = no; + DRM_PANEL_SAMSUNG_S6D16D0 = no; + DRM_PANEL_SAMSUNG_S6E3HA2 = no; + DRM_PANEL_SAMSUNG_S6E63J0X03 = no; + DRM_PANEL_SAMSUNG_S6E63M0 = no; + DRM_PANEL_SAMSUNG_S6E63M0_SPI = no; + DRM_PANEL_SAMSUNG_S6E63M0_DSI = no; + DRM_PANEL_SAMSUNG_S6E88A0_AMS452EF01 = no; + DRM_PANEL_SAMSUNG_S6E8AA0 = no; + DRM_PANEL_SAMSUNG_SOFEF00 = no; + DRM_PANEL_SEIKO_43WVF1G = no; + DRM_PANEL_SHARP_LQ101R1SX01 = no; + DRM_PANEL_SHARP_LS037V7DW01 = no; + DRM_PANEL_SHARP_LS043T1LE01 = no; + DRM_PANEL_SITRONIX_ST7701 = no; + DRM_PANEL_SITRONIX_ST7703 = no; + DRM_PANEL_SITRONIX_ST7789V = no; + DRM_PANEL_SONY_ACX565AKM = no; + DRM_PANEL_TDO_TL070WSH30 = no; + DRM_PANEL_TPO_TD028TTEC1 = no; + DRM_PANEL_TPO_TD043MTEA1 = no; + DRM_PANEL_TPO_TPG110 = no; + DRM_PANEL_TRULY_NT35597_WQXGA = no; + DRM_PANEL_VISIONOX_RM69299 = no; + DRM_PANEL_WIDECHIPS_WS2401 = no; + DRM_PANEL_XINPENG_XPP055C272 = no; + DRM_BRIDGE = no; + DRM_PANEL_BRIDGE = no; + DRM_CDNS_DSI = no; + DRM_CHIPONE_ICN6211 = no; + DRM_CHRONTEL_CH7033 = no; + DRM_DISPLAY_CONNECTOR = no; + DRM_LONTIUM_LT8912B = no; + DRM_LONTIUM_LT9611 = no; + DRM_LONTIUM_LT9611UXC = no; + DRM_ITE_IT66121 = no; + DRM_LVDS_CODEC = no; + DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW = no; + DRM_NWL_MIPI_DSI = no; + DRM_NXP_PTN3460 = no; + DRM_PARADE_PS8622 = no; + DRM_PARADE_PS8640 = no; + DRM_SIL_SII8620 = no; + DRM_SII902X = no; + DRM_SII9234 = no; + DRM_SIMPLE_BRIDGE = no; + DRM_THINE_THC63LVD1024 = no; + DRM_TOSHIBA_TC358762 = no; + DRM_TOSHIBA_TC358764 = no; + DRM_TOSHIBA_TC358767 = no; + DRM_TOSHIBA_TC358768 = no; + DRM_TOSHIBA_TC358775 = no; + DRM_TI_TFP410 = no; + DRM_TI_SN65DSI83 = no; + DRM_TI_SN65DSI86 = no; + DRM_TI_TPD12S015 = no; + DRM_ANALOGIX_ANX6345 = no; + DRM_ANALOGIX_ANX78XX = no; + DRM_ANALOGIX_DP = no; + DRM_ANALOGIX_ANX7625 = no; + DRM_I2C_ADV7511 = no; + DRM_I2C_ADV7511_CEC = no; + DRM_CDNS_MHDP8546 = no; + DRM_DW_HDMI = no; + DRM_DW_HDMI_AHB_AUDIO = no; + DRM_DW_HDMI_I2S_AUDIO = no; + DRM_DW_HDMI_CEC = no; + DRM_ETNAVIV = no; + DRM_ETNAVIV_THERMAL = no; + DRM_MXS = no; + DRM_MXSFB = no; + DRM_ARCPGU = no; + DRM_BOCHS = no; + DRM_CIRRUS_QEMU = no; + DRM_GM12U320 = no; + TINYDRM_HX8357D = no; + TINYDRM_ILI9225 = no; + TINYDRM_ILI9341 = no; + TINYDRM_ILI9486 = no; + TINYDRM_MI0283QT = no; + TINYDRM_REPAPER = no; + TINYDRM_ST7586 = no; + TINYDRM_ST7735R = no; + DRM_GUD = no; + DRM_LEGACY = no; + DRM_TDFX = no; + DRM_R128 = no; + DRM_MGA = no; + DRM_VIA = no; + DRM_SAVAGE = no; + VIDEOMODE_HELPERS = no; + SND_PCM_ELD = no; + SND_PCM_IEC958 = no; + SND_HDA_COMPONENT = no; + SND_SOC_HDMI_CODEC = no; + VIRTIO_DMA_SHARED_BUFFER = no; + }; - extraMeta.branch = "Star64_devel"; - } // (args.argsOverride or { })); + extraMeta.branch = "Star64_devel"; + } + // (args.argsOverride or { }) + ); -in lib.recurseIntoAttrs (linuxPackagesFor (callPackage linuxPkg { })) +in +lib.recurseIntoAttrs (linuxPackagesFor (callPackage linuxPkg { })) diff --git a/pine64/star64/opensbi.nix b/pine64/star64/opensbi.nix index 5b46fec6..e9a79129 100644 --- a/pine64/star64/opensbi.nix +++ b/pine64/star64/opensbi.nix @@ -1,14 +1,18 @@ -{ opensbi, withPayload, withFDT }: +{ + opensbi, + withPayload, + withFDT, +}: (opensbi.override { inherit withPayload withFDT; -}).overrideAttrs (attrs: { - makeFlags = attrs.makeFlags ++ [ - # opensbi generic platform default FW_TEXT_START is 0x80000000 - # For JH7110, need to specify the FW_TEXT_START to 0x40000000 - # Otherwise, the fw_payload.bin downloading via jtag will not run. - # https://github.com/starfive-tech/VisionFive2/blob/7733673d27052dc5a48f1cb1d060279dfa3f0241/Makefile#L274 - "FW_TEXT_START=0x40000000" - ]; -}) - +}).overrideAttrs + (attrs: { + makeFlags = attrs.makeFlags ++ [ + # opensbi generic platform default FW_TEXT_START is 0x80000000 + # For JH7110, need to specify the FW_TEXT_START to 0x40000000 + # Otherwise, the fw_payload.bin downloading via jtag will not run. + # https://github.com/starfive-tech/VisionFive2/blob/7733673d27052dc5a48f1cb1d060279dfa3f0241/Makefile#L274 + "FW_TEXT_START=0x40000000" + ]; + }) diff --git a/pine64/star64/sd-image.nix b/pine64/star64/sd-image.nix index 07d00ae8..e76b0c03 100644 --- a/pine64/star64/sd-image.nix +++ b/pine64/star64/sd-image.nix @@ -1,7 +1,14 @@ -{ config, pkgs, modulesPath, ... }: +{ + config, + pkgs, + modulesPath, + ... +}: -let firmware = pkgs.callPackage ./firmware.nix { }; -in { +let + firmware = pkgs.callPackage ./firmware.nix { }; +in +{ imports = [ "${modulesPath}/profiles/base.nix" "${modulesPath}/installer/sd-card/sd-image.nix" @@ -9,8 +16,7 @@ in { ]; sdImage = { - imageName = - "${config.sdImage.imageBaseName}-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}-pine64-star64.img"; + imageName = "${config.sdImage.imageBaseName}-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}-pine64-star64.img"; # Overridden by postBuildCommands populateFirmwareCommands = ""; diff --git a/pine64/star64/spl-tool.nix b/pine64/star64/spl-tool.nix index 6b91a36e..0f1f8df9 100644 --- a/pine64/star64/spl-tool.nix +++ b/pine64/star64/spl-tool.nix @@ -1,6 +1,6 @@ { stdenv, fetchFromGitHub }: -stdenv.mkDerivation rec{ +stdenv.mkDerivation rec { pname = "spi_tool"; version = "unstable-2023-04-14"; src = fetchFromGitHub { diff --git a/purism/librem/5r4/audio.nix b/purism/librem/5r4/audio.nix index 8c8b00b9..9c49fa7a 100644 --- a/purism/librem/5r4/audio.nix +++ b/purism/librem/5r4/audio.nix @@ -1,13 +1,14 @@ -{ config -, lib -, pkgs -, ... -}: { +{ + config, + lib, + pkgs, + ... +}: +{ config = - lib.mkIf config.hardware.librem5.audio - { - services.dbus.packages = [ pkgs.callaudiod ]; - } + lib.mkIf config.hardware.librem5.audio { + services.dbus.packages = [ pkgs.callaudiod ]; + } // ( let paConfig = { @@ -18,24 +19,25 @@ ''; }; in - if lib.versionOlder (lib.versions.majorMinor lib.version) "25.05" - then { - assertions = [ - { - assertion = config.hardware.pulseaudio.enable; - message = "Call audio on Librem5 requires pulse audio to be enabled through `hardware.pulseaudio.enable`."; - } - ]; - hardware.pulseaudio = paConfig; - } - else { - assertions = [ - { - assertion = config.services.pulseaudio.enable; - message = "Call audio on Librem5 requires pulse audio to be enabled through `services.pulseaudio.enable`."; - } - ]; - services.pulseaudio = paConfig; - } + if lib.versionOlder (lib.versions.majorMinor lib.version) "25.05" then + { + assertions = [ + { + assertion = config.hardware.pulseaudio.enable; + message = "Call audio on Librem5 requires pulse audio to be enabled through `hardware.pulseaudio.enable`."; + } + ]; + hardware.pulseaudio = paConfig; + } + else + { + assertions = [ + { + assertion = config.services.pulseaudio.enable; + message = "Call audio on Librem5 requires pulse audio to be enabled through `services.pulseaudio.enable`."; + } + ]; + services.pulseaudio = paConfig; + } ); } diff --git a/purism/librem/5r4/default.nix b/purism/librem/5r4/default.nix index 339b43b3..33eeefdd 100644 --- a/purism/librem/5r4/default.nix +++ b/purism/librem/5r4/default.nix @@ -1,9 +1,15 @@ -{ config, pkgs, lib, ... }: +{ + config, + pkgs, + lib, + ... +}: let cfg = config.hardware.librem5; linuxPackages_librem5 = pkgs.linuxPackagesFor (pkgs.callPackage ./kernel.nix { }); ubootLibrem5 = pkgs.callPackage ./u-boot { }; -in { +in +{ options = { hardware.librem5 = { package = lib.mkOption { @@ -11,7 +17,11 @@ in { default = pkgs.callPackage ./librem5-base { }; }; wifiCard = lib.mkOption { - type = lib.types.enum [ "redpine" "sparklan" "none" ]; + type = lib.types.enum [ + "redpine" + "sparklan" + "none" + ]; description = '' Which wi-fi card is installed in your phone. diff --git a/purism/librem/5r4/kernel.nix b/purism/librem/5r4/kernel.nix index 0ffbb3d3..9e42a586 100644 --- a/purism/librem/5r4/kernel.nix +++ b/purism/librem/5r4/kernel.nix @@ -1,28 +1,31 @@ -{ lib -, buildLinux -, fetchFromGitLab -, ... -} @ args: -buildLinux (args +{ + lib, + buildLinux, + fetchFromGitLab, + ... +}@args: +buildLinux ( + args // rec { - defconfig = "librem5_defconfig"; - version = "6.6.74-librem5"; - modDirVersion = version; - src = fetchFromGitLab { - domain = "source.puri.sm"; - owner = "Librem5"; - repo = "linux"; - rev = "pureos/6.6.74pureos1"; - hash = "sha256-qUPY+2fHVu7SFc+Uf8U7QtkQJJsE/4I1SavpLqJ/34c="; - }; - kernelPatches = [ ]; - # see https://github.com/NixOS/nixpkgs/pull/366004 - ignoreConfigErrors = true; + defconfig = "librem5_defconfig"; + version = "6.6.74-librem5"; + modDirVersion = version; + src = fetchFromGitLab { + domain = "source.puri.sm"; + owner = "Librem5"; + repo = "linux"; + rev = "pureos/6.6.74pureos1"; + hash = "sha256-qUPY+2fHVu7SFc+Uf8U7QtkQJJsE/4I1SavpLqJ/34c="; + }; + kernelPatches = [ ]; + # see https://github.com/NixOS/nixpkgs/pull/366004 + ignoreConfigErrors = true; - structuredExtraConfig = with lib.kernel; { - # buildLinux overrides this and defaults to 32, so go back to the value defined librem5_defconfig - # this is required for millipixels to take photos, otherwise the VIDIOC_REQ_BUFS ioctl returns ENOMEM - CMA_SIZE_MBYTES = lib.mkForce (freeform "320"); - }; -} - // args.argsOverride or { }) + structuredExtraConfig = with lib.kernel; { + # buildLinux overrides this and defaults to 32, so go back to the value defined librem5_defconfig + # this is required for millipixels to take photos, otherwise the VIDIOC_REQ_BUFS ioctl returns ENOMEM + CMA_SIZE_MBYTES = lib.mkForce (freeform "320"); + }; + } + // args.argsOverride or { } +) diff --git a/purism/librem/5r4/librem5-base/default.nix b/purism/librem/5r4/librem5-base/default.nix index da9a39e2..5ad48597 100644 --- a/purism/librem/5r4/librem5-base/default.nix +++ b/purism/librem/5r4/librem5-base/default.nix @@ -1,4 +1,10 @@ -{ stdenv, fetchFromGitLab, shellcheck, kmod, lib }: +{ + stdenv, + fetchFromGitLab, + shellcheck, + kmod, + lib, +}: stdenv.mkDerivation { pname = "librem5-base"; version = "unstable"; diff --git a/purism/librem/5r4/lockdown-fix.nix b/purism/librem/5r4/lockdown-fix.nix index 121ded30..08ee137f 100644 --- a/purism/librem/5r4/lockdown-fix.nix +++ b/purism/librem/5r4/lockdown-fix.nix @@ -1,4 +1,9 @@ -{ config, pkgs, lib, ... }: +{ + config, + pkgs, + lib, + ... +}: lib.mkIf config.hardware.librem5.lockdownFix { # We blacklist the drivers so they don't load during early boot when the sensors are disconnected, boot.blacklistedKernelModules = [ @@ -17,10 +22,10 @@ lib.mkIf config.hardware.librem5.lockdownFix { }; # udev rules from librem5-base handle going into "lockdown mode" and back. - assertions = [{ - assertion = with config.hardware.librem5; - lockdownFix -> installUdevPackages; - message = - "'hardware.librem5.lockdownFix' requires 'hardware.librem5.installUdevPackages', but it is not enabled."; - }]; + assertions = [ + { + assertion = with config.hardware.librem5; lockdownFix -> installUdevPackages; + message = "'hardware.librem5.lockdownFix' requires 'hardware.librem5.installUdevPackages', but it is not enabled."; + } + ]; } diff --git a/purism/librem/5r4/u-boot/default.nix b/purism/librem/5r4/u-boot/default.nix index a6b00a79..43dcee43 100644 --- a/purism/librem/5r4/u-boot/default.nix +++ b/purism/librem/5r4/u-boot/default.nix @@ -1,4 +1,12 @@ -{ stdenv, gcc11Stdenv, buildUBoot, fetchurl, fetchFromGitLab, lib, bison }: +{ + stdenv, + gcc11Stdenv, + buildUBoot, + fetchurl, + fetchFromGitLab, + lib, + bison, +}: let firmware-imx = stdenv.mkDerivation (fa: { pname = "firmware-imx"; @@ -20,7 +28,7 @@ let meta.license = lib.licenses.unfree; }); - arm-trusted-firmware-imx8mq = gcc11Stdenv.mkDerivation (fa: { + arm-trusted-firmware-imx8mq = gcc11Stdenv.mkDerivation (_fa: { pname = "arm-trusted-firmware-bl31"; version = "unstable-2020-07-08"; src = fetchFromGitLab { @@ -33,7 +41,10 @@ let enableParallelBuilding = true; hardeningDisable = [ "all" ]; NIX_LDFLAGS = "--no-warn-rwx-segments"; - buildFlags = [ "PLAT=imx8mq" "bl31" ]; + buildFlags = [ + "PLAT=imx8mq" + "bl31" + ]; installPhase = '' mkdir -p $out cp build/imx8mq/release/bl31.bin $out @@ -51,7 +62,7 @@ let rev = "956aa590c93977992743b41c45d3c7ee5a024915"; # this is the latest commit on the upstream/librem5 branch hash = "sha256-MsIIlarN+WFFEzc0ptLAgS7BwJ6Cosy42xo0EwPn1AU="; }; - patches = []; + patches = [ ]; BL31 = "${arm-trusted-firmware-imx8mq}/bl31.bin"; preConfigure = '' cp $BL31 . diff --git a/radxa/default.nix b/radxa/default.nix index fb311df7..e687ff88 100644 --- a/radxa/default.nix +++ b/radxa/default.nix @@ -1,11 +1,13 @@ -{ lib -, pkgs -, config -, ... +{ + lib, + pkgs, + config, + ... }: let cfg = config.hardware.radxa; -in { +in +{ options.hardware.radxa = { enable = lib.mkEnableOption "Radxa system support"; }; diff --git a/radxa/disko.nix b/radxa/disko.nix index 30c30a97..739f4575 100644 --- a/radxa/disko.nix +++ b/radxa/disko.nix @@ -1,11 +1,10 @@ -{ lib -, pkgs -, config -, ... +{ + lib, + pkgs, + config, + ... }: -let - cfg = config.hardware.radxa; -in { +{ imports = [ ../rockchip/disko.nix ]; diff --git a/radxa/rock-4c-plus/default.nix b/radxa/rock-4c-plus/default.nix index e432dd74..956fc546 100644 --- a/radxa/rock-4c-plus/default.nix +++ b/radxa/rock-4c-plus/default.nix @@ -1,8 +1,10 @@ -{ lib -, pkgs -, config -, ... -}: { +{ + lib, + pkgs, + config, + ... +}: +{ imports = [ ../. ../../rockchip diff --git a/radxa/rock-5b/default.nix b/radxa/rock-5b/default.nix index c8a899dd..891ae26c 100644 --- a/radxa/rock-5b/default.nix +++ b/radxa/rock-5b/default.nix @@ -1,8 +1,10 @@ -{ lib -, pkgs -, config -, ... -}: { +{ + lib, + pkgs, + config, + ... +}: +{ imports = [ ../. ../../rockchip diff --git a/radxa/rock-pi-4/default.nix b/radxa/rock-pi-4/default.nix index e205a46e..d6000816 100644 --- a/radxa/rock-pi-4/default.nix +++ b/radxa/rock-pi-4/default.nix @@ -1,8 +1,10 @@ -{ lib -, pkgs -, config -, ... -}: { +{ + lib, + pkgs, + config, + ... +}: +{ imports = [ ../. ../../rockchip diff --git a/radxa/rock-pi-e/default.nix b/radxa/rock-pi-e/default.nix index 0eec4e9a..95ad4106 100644 --- a/radxa/rock-pi-e/default.nix +++ b/radxa/rock-pi-e/default.nix @@ -1,8 +1,10 @@ -{ lib -, pkgs -, config -, ... -}: { +{ + lib, + pkgs, + config, + ... +}: +{ imports = [ ../. ../../rockchip diff --git a/raspberry-pi/2/default.nix b/raspberry-pi/2/default.nix index 368cb27f..2e61025c 100644 --- a/raspberry-pi/2/default.nix +++ b/raspberry-pi/2/default.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, ...}: +{ lib, pkgs, ... }: { boot = { diff --git a/raspberry-pi/3/default.nix b/raspberry-pi/3/default.nix index 57da74a3..00e052f6 100644 --- a/raspberry-pi/3/default.nix +++ b/raspberry-pi/3/default.nix @@ -1,6 +1,7 @@ -{ lib -, pkgs -, ... +{ + lib, + pkgs, + ... }: { @@ -11,8 +12,7 @@ # https://github.com/NixOS/nixpkgs/issues/154163#issuecomment-1350599022 nixpkgs.overlays = [ (_final: super: { - makeModulesClosure = x: - super.makeModulesClosure (x // { allowMissing = true; }); + makeModulesClosure = x: super.makeModulesClosure (x // { allowMissing = true; }); }) ]; diff --git a/raspberry-pi/4/apply-overlays-dtmerge.nix b/raspberry-pi/4/apply-overlays-dtmerge.nix index e5b52d37..ab6d5296 100644 --- a/raspberry-pi/4/apply-overlays-dtmerge.nix +++ b/raspberry-pi/4/apply-overlays-dtmerge.nix @@ -1,48 +1,67 @@ # modification of nixpkgs deviceTree.applyOverlays to resolve https://github.com/NixOS/nixpkgs/issues/125354 # derived from https://github.com/NixOS/nixpkgs/blob/916ca8f2b0c208def051f8ea9760c534a40309db/pkgs/os-specific/linux/device-tree/default.nix -{ lib, stdenvNoCC, dtc, libraspberrypi }: +{ + lib, + stdenvNoCC, + dtc, + libraspberrypi, +}: -with lib; (base: overlays': stdenvNoCC.mkDerivation { - name = "device-tree-overlays"; - nativeBuildInputs = [ dtc libraspberrypi ]; - buildCommand = let - overlays = toList overlays'; - in '' - mkdir -p $out - cd "${base}" - find . -type f -name '*.dtb' -print0 \ - | xargs -0 cp -v --no-preserve=mode --target-directory "$out" --parents +with lib; +( + base: overlays': + stdenvNoCC.mkDerivation { + name = "device-tree-overlays"; + nativeBuildInputs = [ + dtc + libraspberrypi + ]; + buildCommand = + let + overlays = toList overlays'; + in + '' + mkdir -p $out + cd "${base}" + find . -type f -name '*.dtb' -print0 \ + | xargs -0 cp -v --no-preserve=mode --target-directory "$out" --parents - for dtb in $(find "$out" -type f -name '*.dtb'); do - dtbCompat=$(fdtget -t s "$dtb" / compatible 2>/dev/null || true) - # skip files without `compatible` string - test -z "$dtbCompat" && continue + for dtb in $(find "$out" -type f -name '*.dtb'); do + dtbCompat=$(fdtget -t s "$dtb" / compatible 2>/dev/null || true) + # skip files without `compatible` string + test -z "$dtbCompat" && continue - ${flip (concatMapStringsSep "\n") overlays (o: '' - overlayCompat="$(fdtget -t s "${o.dtboFile}" / compatible)" + ${flip (concatMapStringsSep "\n") overlays (o: '' + overlayCompat="$(fdtget -t s "${o.dtboFile}" / compatible)" - # skip incompatible and non-matching overlays - if [[ ! "$dtbCompat" =~ "$overlayCompat" ]]; then - echo "Skipping overlay ${o.name}: incompatible with $(basename "$dtb")" - elif ${if ((o.filter or null) == null) then "false" else '' - [[ "''${dtb//${o.filter}/}" == "$dtb" ]] - ''} - then - echo "Skipping overlay ${o.name}: filter does not match $(basename "$dtb")" - else - echo -n "Applying overlay ${o.name} to $(basename "$dtb")... " - mv "$dtb"{,.in} + # skip incompatible and non-matching overlays + if [[ ! "$dtbCompat" =~ "$overlayCompat" ]]; then + echo "Skipping overlay ${o.name}: incompatible with $(basename "$dtb")" + elif ${ + if ((o.filter or null) == null) then + "false" + else + '' + [[ "''${dtb//${o.filter}/}" == "$dtb" ]] + '' + } + then + echo "Skipping overlay ${o.name}: filter does not match $(basename "$dtb")" + else + echo -n "Applying overlay ${o.name} to $(basename "$dtb")... " + mv "$dtb"{,.in} - # dtmerge requires a .dtbo ext for dtbo files, otherwise it adds it to the given file implicitly - dtboWithExt="$TMPDIR/$(basename "${o.dtboFile}").dtbo" - cp -r ${o.dtboFile} "$dtboWithExt" + # dtmerge requires a .dtbo ext for dtbo files, otherwise it adds it to the given file implicitly + dtboWithExt="$TMPDIR/$(basename "${o.dtboFile}").dtbo" + cp -r ${o.dtboFile} "$dtboWithExt" - dtmerge "$dtb.in" "$dtb" "$dtboWithExt" + dtmerge "$dtb.in" "$dtb" "$dtboWithExt" - echo "ok" - rm "$dtb.in" "$dtboWithExt" - fi - '')} + echo "ok" + rm "$dtb.in" "$dtboWithExt" + fi + '')} - done''; -}) + done''; + } +) diff --git a/raspberry-pi/4/audio.nix b/raspberry-pi/4/audio.nix index 38773864..08c0b921 100644 --- a/raspberry-pi/4/audio.nix +++ b/raspberry-pi/4/audio.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let cfg = config.hardware.raspberry-pi."4".audio; @@ -38,9 +43,10 @@ in # set tsched=0 in pulseaudio config to avoid audio glitches # see https://wiki.archlinux.org/title/PulseAudio/Troubleshooting#Glitches,_skips_or_crackling - hardware.pulseaudio.configFile = lib.mkOverride 990 (pkgs.runCommand "default.pa" {} '' - sed 's/module-udev-detect$/module-udev-detect tsched=0/' ${config.hardware.pulseaudio.package}/etc/pulse/default.pa > $out - ''); + hardware.pulseaudio.configFile = lib.mkOverride 990 ( + pkgs.runCommand "default.pa" { } '' + sed 's/module-udev-detect$/module-udev-detect tsched=0/' ${config.hardware.pulseaudio.package}/etc/pulse/default.pa > $out + '' + ); }; } - diff --git a/raspberry-pi/4/default.nix b/raspberry-pi/4/default.nix index 150a66b9..e02ba0b3 100644 --- a/raspberry-pi/4/default.nix +++ b/raspberry-pi/4/default.nix @@ -1,4 +1,9 @@ -{ lib, pkgs, config, ... }: +{ + lib, + pkgs, + config, + ... +}: { imports = [ @@ -40,7 +45,6 @@ hardware.deviceTree.filter = lib.mkDefault "bcm2711-rpi-*.dtb"; - assertions = [ { assertion = (lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.1"); diff --git a/raspberry-pi/4/dwc2.nix b/raspberry-pi/4/dwc2.nix index bdb63b18..874efa24 100644 --- a/raspberry-pi/4/dwc2.nix +++ b/raspberry-pi/4/dwc2.nix @@ -25,7 +25,11 @@ in https://www.kernel.org/doc/Documentation/usb/gadget-testing.txt ''; dr_mode = lib.mkOption { - type = lib.types.enum [ "host" "peripheral" "otg" ]; + type = lib.types.enum [ + "host" + "peripheral" + "otg" + ]; default = "otg"; description = '' Dual role mode setting for the dwc2 USB controller driver. diff --git a/raspberry-pi/4/gpio.nix b/raspberry-pi/4/gpio.nix index 23c7bdae..dc12965c 100644 --- a/raspberry-pi/4/gpio.nix +++ b/raspberry-pi/4/gpio.nix @@ -1,36 +1,41 @@ -{ pkgs, lib, config, ... }: +{ + pkgs, + lib, + config, + ... +}: { options.hardware.raspberry-pi."4".gpio = { enable = lib.mkOption { type = lib.types.bool; - description = - "Enable udev rules and kernelParams that make lgpio and pigpio work"; + description = "Enable udev rules and kernelParams that make lgpio and pigpio work"; default = false; }; }; - config = let - cfg = config.hardware.raspberry-pi."4".gpio; + config = + let + cfg = config.hardware.raspberry-pi."4".gpio; in - lib.mkIf cfg.enable { - users.groups.gpio = lib.mkDefault { }; + lib.mkIf cfg.enable { + users.groups.gpio = lib.mkDefault { }; - # the bit that matters to lgpio here is - # "${pkgs.coreutils}/bin/chgrp gpio /dev/%k && chmod 660 /dev/%k" - # see https://github.com/NixOS/nixpkgs/pull/352308 + # the bit that matters to lgpio here is + # "${pkgs.coreutils}/bin/chgrp gpio /dev/%k && chmod 660 /dev/%k" + # see https://github.com/NixOS/nixpkgs/pull/352308 - # sudo udevadm test --action=add /dev/gpiochip0 to test + # sudo udevadm test --action=add /dev/gpiochip0 to test - # import lgpio; lgpio.gpiochip_open(0) should show "1" and not raise - # an exception + # import lgpio; lgpio.gpiochip_open(0) should show "1" and not raise + # an exception - services.udev.extraRules = lib.mkBefore '' - KERNEL=="gpiomem", GROUP="gpio", MODE="0660" - SUBSYSTEM=="gpio", KERNEL=="gpiochip*", ACTION=="add", PROGRAM="${pkgs.bash}/bin/bash -c '${pkgs.coreutils}/bin/chgrp gpio /dev/%k && chmod 660 /dev/%k && ${pkgs.coreutils}/bin/chgrp -R gpio /sys/class/gpio && ${pkgs.coreutils}/bin/chmod -R g=u /sys/class/gpio'" - SUBSYSTEM=="gpio", ACTION=="add", PROGRAM="${pkgs.bash}/bin/bash -c '${pkgs.coreutils}/bin/chgrp -R gpio /sys%p && ${pkgs.coreutils}/bin/chmod -R g=u /sys%p'" - ''; + services.udev.extraRules = lib.mkBefore '' + KERNEL=="gpiomem", GROUP="gpio", MODE="0660" + SUBSYSTEM=="gpio", KERNEL=="gpiochip*", ACTION=="add", PROGRAM="${pkgs.bash}/bin/bash -c '${pkgs.coreutils}/bin/chgrp gpio /dev/%k && chmod 660 /dev/%k && ${pkgs.coreutils}/bin/chgrp -R gpio /sys/class/gpio && ${pkgs.coreutils}/bin/chmod -R g=u /sys/class/gpio'" + SUBSYSTEM=="gpio", ACTION=="add", PROGRAM="${pkgs.bash}/bin/bash -c '${pkgs.coreutils}/bin/chgrp -R gpio /sys%p && ${pkgs.coreutils}/bin/chmod -R g=u /sys%p'" + ''; - boot.kernelParams = [ - "iomem=relaxed" # for pigpiod - ]; - }; + boot.kernelParams = [ + "iomem=relaxed" # for pigpiod + ]; + }; } diff --git a/raspberry-pi/4/i2c.nix b/raspberry-pi/4/i2c.nix index 0355397e..5939a78a 100644 --- a/raspberry-pi/4/i2c.nix +++ b/raspberry-pi/4/i2c.nix @@ -2,24 +2,31 @@ let cfg = config.hardware.raspberry-pi."4"; - optionalProperty = name: value: lib.optionalString (value != null) "${name} = <${builtins.toString value}>;"; - simple-overlay = { target, status, frequency }: { - name = "${target}-${status}-overlay"; - dtsText = '' - /dts-v1/; - /plugin/; - / { - compatible = "brcm,bcm2711"; - fragment@0 { - target = <&${target}>; - __overlay__ { - status = "${status}"; - ${optionalProperty "clock-frequency" frequency} + optionalProperty = + name: value: lib.optionalString (value != null) "${name} = <${builtins.toString value}>;"; + simple-overlay = + { + target, + status, + frequency, + }: + { + name = "${target}-${status}-overlay"; + dtsText = '' + /dts-v1/; + /plugin/; + / { + compatible = "brcm,bcm2711"; + fragment@0 { + target = <&${target}>; + __overlay__ { + status = "${status}"; + ${optionalProperty "clock-frequency" frequency} + }; }; }; - }; - ''; - }; + ''; + }; in { options.hardware.raspberry-pi."4" = { @@ -54,21 +61,25 @@ in (lib.mkIf cfg.i2c0.enable { i2c.enable = lib.mkDefault true; deviceTree = { - overlays = [ (simple-overlay { - target = "i2c0if"; - status = "okay"; - inherit (cfg.i2c0) frequency; - }) ]; + overlays = [ + (simple-overlay { + target = "i2c0if"; + status = "okay"; + inherit (cfg.i2c0) frequency; + }) + ]; }; }) (lib.mkIf cfg.i2c1.enable { i2c.enable = lib.mkDefault true; deviceTree = { - overlays = [ (simple-overlay { - target = "i2c1"; - status = "okay"; - inherit (cfg.i2c1) frequency; - }) ]; + overlays = [ + (simple-overlay { + target = "i2c1"; + status = "okay"; + inherit (cfg.i2c1) frequency; + }) + ]; }; }) ]; diff --git a/raspberry-pi/4/leds.nix b/raspberry-pi/4/leds.nix index 5f58fa22..3860fff5 100644 --- a/raspberry-pi/4/leds.nix +++ b/raspberry-pi/4/leds.nix @@ -2,12 +2,14 @@ let cfg = config.hardware.raspberry-pi."4".leds; - mkDisableOption = name: lib.mkOption { - default = false; - example = true; - description = "Whether to disable ${name}."; - type = lib.types.bool; - }; + mkDisableOption = + name: + lib.mkOption { + default = false; + example = true; + description = "Whether to disable ${name}."; + type = lib.types.bool; + }; in { options.hardware = { @@ -71,23 +73,25 @@ in { name = "disable-act-led"; filter = "*rpi-4-b*"; - dtsText = let - kernelVersion = lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.2"; - target = if kernelVersion then "<&led_act>" else "<&act_led>"; - in '' - /dts-v1/; - /plugin/; - /{ - compatible = "raspberrypi,4-model-b"; - fragment@0 { - target = ${target}; - __overlay__ { - gpios = <&gpio 42 0>; /* first two values copied from bcm2711-rpi-4-b.dts */ - linux,default-trigger = "none"; - }; - }; - }; - ''; + dtsText = + let + kernelVersion = lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.2"; + target = if kernelVersion then "<&led_act>" else "<&act_led>"; + in + '' + /dts-v1/; + /plugin/; + /{ + compatible = "raspberrypi,4-model-b"; + fragment@0 { + target = ${target}; + __overlay__ { + gpios = <&gpio 42 0>; /* first two values copied from bcm2711-rpi-4-b.dts */ + linux,default-trigger = "none"; + }; + }; + }; + ''; } ]; }; @@ -101,23 +105,25 @@ in { name = "disable-pwr-led"; filter = "*rpi-4-b*"; - dtsText = let - kernelVersion = lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.2"; - target = if kernelVersion then "<&led_pwr>" else "<&pwr_led>"; - in '' - /dts-v1/; - /plugin/; - /{ - compatible = "raspberrypi,4-model-b"; - fragment@0 { - target = ${target}; - __overlay__ { - gpios = <&expgpio 2 0>; /* first two values copied from bcm2711-rpi-4-b.dts */ - linux,default-trigger = "default-on"; - }; - }; - }; - ''; + dtsText = + let + kernelVersion = lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.2"; + target = if kernelVersion then "<&led_pwr>" else "<&pwr_led>"; + in + '' + /dts-v1/; + /plugin/; + /{ + compatible = "raspberrypi,4-model-b"; + fragment@0 { + target = ${target}; + __overlay__ { + gpios = <&expgpio 2 0>; /* first two values copied from bcm2711-rpi-4-b.dts */ + linux,default-trigger = "default-on"; + }; + }; + }; + ''; } ]; }; diff --git a/raspberry-pi/4/pkgs-overlays.nix b/raspberry-pi/4/pkgs-overlays.nix index 8c3e29af..95109c21 100644 --- a/raspberry-pi/4/pkgs-overlays.nix +++ b/raspberry-pi/4/pkgs-overlays.nix @@ -6,7 +6,8 @@ let applyOverlays = _final.callPackage ./apply-overlays-dtmerge.nix { }; }; }; -in { +in +{ options.hardware = { raspberry-pi."4".apply-overlays-dtmerge = { enable = lib.mkEnableOption '' diff --git a/raspberry-pi/4/poe-hat.nix b/raspberry-pi/4/poe-hat.nix index 07bc4e46..0eb8d847 100644 --- a/raspberry-pi/4/poe-hat.nix +++ b/raspberry-pi/4/poe-hat.nix @@ -2,7 +2,8 @@ let cfg = config.hardware.raspberry-pi."4".poe-hat; -in { +in +{ options.hardware = { raspberry-pi."4".poe-hat = { enable = lib.mkEnableOption '' diff --git a/raspberry-pi/4/poe-plus-hat.nix b/raspberry-pi/4/poe-plus-hat.nix index 96f50e40..985971f3 100644 --- a/raspberry-pi/4/poe-plus-hat.nix +++ b/raspberry-pi/4/poe-plus-hat.nix @@ -2,7 +2,8 @@ let cfg = config.hardware.raspberry-pi."4".poe-plus-hat; -in { +in +{ options.hardware = { raspberry-pi."4".poe-plus-hat = { enable = lib.mkEnableOption '' diff --git a/raspberry-pi/4/pwm0.nix b/raspberry-pi/4/pwm0.nix index 5470eaf4..665f81be 100644 --- a/raspberry-pi/4/pwm0.nix +++ b/raspberry-pi/4/pwm0.nix @@ -14,37 +14,39 @@ in config = lib.mkIf cfg.enable { hardware.deviceTree = { - overlays = [{ - name = "pwm-overlay"; - dtsText = '' - /dts-v1/; - /plugin/; - / { - compatible = "brcm,bcm2711"; + overlays = [ + { + name = "pwm-overlay"; + dtsText = '' + /dts-v1/; + /plugin/; + / { + compatible = "brcm,bcm2711"; - fragment@0 { - target = <&gpio>; - __overlay__ { - pwm_pins: pwm_pins { - brcm,pins = <18>; - brcm,function = <2>; /* Alt5 */ + fragment@0 { + target = <&gpio>; + __overlay__ { + pwm_pins: pwm_pins { + brcm,pins = <18>; + brcm,function = <2>; /* Alt5 */ + }; }; }; - }; - fragment@1 { - target = <&pwm>; - __overlay__ { - pinctrl-names = "default"; - assigned-clock-rates = <100000000>; - status = "okay"; - pinctrl-0 = <&pwm_pins>; + fragment@1 { + target = <&pwm>; + __overlay__ { + pinctrl-names = "default"; + assigned-clock-rates = <100000000>; + status = "okay"; + pinctrl-0 = <&pwm_pins>; + }; }; - }; - }; - ''; - }]; + }; + ''; + } + ]; }; }; } diff --git a/raspberry-pi/4/tv-hat.nix b/raspberry-pi/4/tv-hat.nix index 8c480f43..263d6fcf 100644 --- a/raspberry-pi/4/tv-hat.nix +++ b/raspberry-pi/4/tv-hat.nix @@ -2,7 +2,8 @@ let cfg = config.hardware.raspberry-pi."4".tv-hat; -in { +in +{ options.hardware = { raspberry-pi."4".tv-hat = { enable = lib.mkEnableOption '' diff --git a/raspberry-pi/4/xhci.nix b/raspberry-pi/4/xhci.nix index b5398f2e..eb1d2ada 100644 --- a/raspberry-pi/4/xhci.nix +++ b/raspberry-pi/4/xhci.nix @@ -2,9 +2,11 @@ config, lib, ... -}: let +}: +let cfg = config.hardware.raspberry-pi."4".xhci; -in { +in +{ options.hardware = { raspberry-pi."4".xhci = { enable = lib.mkEnableOption '' diff --git a/raspberry-pi/5/default.nix b/raspberry-pi/5/default.nix index aba0178f..12d51b4d 100644 --- a/raspberry-pi/5/default.nix +++ b/raspberry-pi/5/default.nix @@ -1,4 +1,9 @@ -{ lib, pkgs, config, ... }: +{ + lib, + pkgs, + config, + ... +}: let linux_rpi5 = pkgs.linux_rpi4.override { rpiVersion = 5; @@ -18,12 +23,12 @@ in # Needed for Xorg to start (https://github.com/raspberrypi-ui/gldriver-test/blob/master/usr/lib/systemd/scripts/rp1_test.sh) # This won't work for displays connected to the RP1 (DPI/composite/MIPI DSI), since I don't have one to test. services.xserver.extraConfig = '' - Section "OutputClass" - Identifier "vc4" - MatchDriver "vc4" - Driver "modesetting" - Option "PrimaryGPU" "true" - EndSection + Section "OutputClass" + Identifier "vc4" + MatchDriver "vc4" + Driver "modesetting" + Option "PrimaryGPU" "true" + EndSection ''; assertions = [ diff --git a/rockchip/default.nix b/rockchip/default.nix index 68bbb83f..f0195f9d 100644 --- a/rockchip/default.nix +++ b/rockchip/default.nix @@ -1,11 +1,13 @@ -{ lib -, pkgs -, config -, ... +{ + lib, + pkgs, + config, + ... }: let cfg = config.hardware.rockchip; -in { +in +{ imports = [ ./rk3328 ./rk3399 diff --git a/rockchip/disko.nix b/rockchip/disko.nix index 7d6b4c9a..fa846c2e 100644 --- a/rockchip/disko.nix +++ b/rockchip/disko.nix @@ -1,11 +1,13 @@ -{ lib -, pkgs -, config -, ... +{ + lib, + pkgs, + config, + ... }: let cfg = config.hardware.rockchip; -in { +in +{ imports = [ rk3399/disko.nix ]; diff --git a/rockchip/rk3328/default.nix b/rockchip/rk3328/default.nix index f2d53910..804be1a5 100644 --- a/rockchip/rk3328/default.nix +++ b/rockchip/rk3328/default.nix @@ -1,11 +1,13 @@ -{ lib -, pkgs -, config -, ... +{ + lib, + pkgs, + config, + ... }: let cfg = config.hardware.rockchip.rk3328; -in { +in +{ options.hardware.rockchip.rk3328 = { enable = lib.mkEnableOption "Rockchip RK3328 support"; }; diff --git a/rockchip/rk3399/default.nix b/rockchip/rk3399/default.nix index 5748c33e..17f92779 100644 --- a/rockchip/rk3399/default.nix +++ b/rockchip/rk3399/default.nix @@ -1,11 +1,13 @@ -{ lib -, pkgs -, config -, ... +{ + lib, + pkgs, + config, + ... }: let cfg = config.hardware.rockchip.rk3399; -in { +in +{ options.hardware.rockchip.rk3399 = { enable = lib.mkEnableOption "Rockchip RK3399 support"; }; diff --git a/rockchip/rk3399/disko.nix b/rockchip/rk3399/disko.nix index bae10ef5..b48972b4 100644 --- a/rockchip/rk3399/disko.nix +++ b/rockchip/rk3399/disko.nix @@ -1,14 +1,18 @@ -{ lib -, pkgs -, config -, ... +{ + lib, + pkgs, + config, + ... }: let cfg = config.hardware.rockchip.rk3399; -in { +in +{ config = lib.mkIf cfg.enable { - nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ - "arm-trusted-firmware-rk3399" - ]; + nixpkgs.config.allowUnfreePredicate = + pkg: + builtins.elem (lib.getName pkg) [ + "arm-trusted-firmware-rk3399" + ]; }; } diff --git a/rockchip/rk3588/default.nix b/rockchip/rk3588/default.nix index cabc04b2..7dff0b64 100644 --- a/rockchip/rk3588/default.nix +++ b/rockchip/rk3588/default.nix @@ -1,11 +1,13 @@ -{ lib -, pkgs -, config -, ... +{ + lib, + pkgs, + config, + ... }: let cfg = config.hardware.rockchip.rk3588; -in { +in +{ options.hardware.rockchip.rk3588 = { enable = lib.mkEnableOption "Rockchip RK3588 support"; }; diff --git a/samsung/np900x3c/default.nix b/samsung/np900x3c/default.nix index 1d850eb5..83261ed9 100644 --- a/samsung/np900x3c/default.nix +++ b/samsung/np900x3c/default.nix @@ -1,2 +1,2 @@ # TODO: use ../../common/pc/laptop -{} +{ } diff --git a/starfive/visionfive/v1/default.nix b/starfive/visionfive/v1/default.nix index 4a3c3dd0..0d55a3e9 100644 --- a/starfive/visionfive/v1/default.nix +++ b/starfive/visionfive/v1/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ...}: +{ + config, + lib, + pkgs, + ... +}: { hardware.deviceTree.name = lib.mkDefault "starfive/jh7100-starfive-visionfive-v1.dtb"; @@ -7,9 +12,19 @@ boot = { # Force no ZFS (from nixos/modules/profiles/base.nix) until updated to kernel 6.0 - supportedFilesystems = lib.mkForce [ "btrfs" "reiserfs" "vfat" "f2fs" "xfs" "ntfs" "cifs" ]; + supportedFilesystems = lib.mkForce [ + "btrfs" + "reiserfs" + "vfat" + "f2fs" + "xfs" + "ntfs" + "cifs" + ]; consoleLogLevel = lib.mkDefault 7; - kernelPackages = lib.mkDefault (pkgs.callPackage ./linux.nix { inherit (config.boot) kernelPatches; }); + kernelPackages = lib.mkDefault ( + pkgs.callPackage ./linux.nix { inherit (config.boot) kernelPatches; } + ); kernelParams = lib.mkDefault [ "console=tty0" diff --git a/starfive/visionfive/v1/firmware.nix b/starfive/visionfive/v1/firmware.nix index 3ea63757..308e355c 100644 --- a/starfive/visionfive/v1/firmware.nix +++ b/starfive/visionfive/v1/firmware.nix @@ -1,6 +1,7 @@ -{ runCommand -, buildPackages -, pkgs +{ + runCommand, + buildPackages, + pkgs, }: let @@ -10,26 +11,29 @@ let withPayload = "${uboot}/u-boot.bin"; withFDT = "${uboot}/u-boot.dtb"; }; -in runCommand "firmware-starfive-visionfive-v1" { - nativeBuildInputs = with buildPackages; [ xxd ]; -} '' - function handle_file { - inFile=$1 - echo inFile: $inFile - outFile=$2 - inSize=`stat -c "%s" $inFile` - inSize32HexBe=`printf "%08x\n" $inSize` - inSize32HexLe=''${inSize32HexBe:6:2}''${inSize32HexBe:4:2}''${inSize32HexBe:2:2}''${inSize32HexBe:0:2} - echo "inSize: $inSize (0x$inSize32HexBe, LE:0x$inSize32HexLe)" - echo $inSize32HexLe | xxd -r -ps > $outFile - cat $inFile >> $outFile - echo outFile: $outFile - outSize=`stat -c "%s" $outFile` - outSize32HexBe=`printf "%08x\n" $outSize` - echo "outSize: $outSize (0x$outSize32HexBe)" +in +runCommand "firmware-starfive-visionfive-v1" + { + nativeBuildInputs = with buildPackages; [ xxd ]; } + '' + function handle_file { + inFile=$1 + echo inFile: $inFile + outFile=$2 + inSize=`stat -c "%s" $inFile` + inSize32HexBe=`printf "%08x\n" $inSize` + inSize32HexLe=''${inSize32HexBe:6:2}''${inSize32HexBe:4:2}''${inSize32HexBe:2:2}''${inSize32HexBe:0:2} + echo "inSize: $inSize (0x$inSize32HexBe, LE:0x$inSize32HexLe)" + echo $inSize32HexLe | xxd -r -ps > $outFile + cat $inFile >> $outFile + echo outFile: $outFile + outSize=`stat -c "%s" $outFile` + outSize32HexBe=`printf "%08x\n" $outSize` + echo "outSize: $outSize (0x$outSize32HexBe)" + } - mkdir -p "$out/nix-support" - echo "file bin \"$out/opensbi_u-boot_starfive_visionfive_v1.bin\"" >> "$out/nix-support/hydra-build-products" - handle_file ${opensbi}/share/opensbi/lp64/generic/firmware/fw_payload.bin $out/opensbi_u-boot_starfive_visionfive_v1.bin -'' + mkdir -p "$out/nix-support" + echo "file bin \"$out/opensbi_u-boot_starfive_visionfive_v1.bin\"" >> "$out/nix-support/hydra-build-products" + handle_file ${opensbi}/share/opensbi/lp64/generic/firmware/fw_payload.bin $out/opensbi_u-boot_starfive_visionfive_v1.bin + '' diff --git a/starfive/visionfive/v1/linux.nix b/starfive/visionfive/v1/linux.nix index 88909099..157745ed 100644 --- a/starfive/visionfive/v1/linux.nix +++ b/starfive/visionfive/v1/linux.nix @@ -1,36 +1,44 @@ -{ lib -, callPackage -, linuxPackagesFor -, kernelPatches -, ... }: +{ + lib, + callPackage, + linuxPackagesFor, + kernelPatches, + ... +}: let modDirVersion = "6.0.0"; - linuxPkg = { fetchFromGitHub, buildLinux, ... } @ args: - buildLinux (args // { - inherit modDirVersion kernelPatches; - version = "${modDirVersion}-starfive-visionfive-v1"; + linuxPkg = + { fetchFromGitHub, buildLinux, ... }@args: + buildLinux ( + args + // { + inherit modDirVersion kernelPatches; + version = "${modDirVersion}-starfive-visionfive-v1"; - src = fetchFromGitHub { - owner = "starfive-tech"; - repo = "linux"; - rev = "cfcb617265422c0af0ae5bc9688dceba2d10b27a"; - sha256 = "sha256-EAMCOtJZ51xSLySQPaZyomfa/1Xs9kNedz04tIbELqg="; - }; + src = fetchFromGitHub { + owner = "starfive-tech"; + repo = "linux"; + rev = "cfcb617265422c0af0ae5bc9688dceba2d10b27a"; + sha256 = "sha256-EAMCOtJZ51xSLySQPaZyomfa/1Xs9kNedz04tIbELqg="; + }; - defconfig = "starfive_jh7100_fedora_defconfig"; + defconfig = "starfive_jh7100_fedora_defconfig"; - structuredExtraConfig = with lib.kernel; { - KEXEC = yes; - SERIAL_8250_DW = yes; - PINCTRL_STARFIVE = yes; - DW_AXI_DMAC_STARFIVE = yes; - PTP_1588_CLOCK = yes; - STMMAC_ETH = yes; - STMMAC_PCI = yes; - }; + structuredExtraConfig = with lib.kernel; { + KEXEC = yes; + SERIAL_8250_DW = yes; + PINCTRL_STARFIVE = yes; + DW_AXI_DMAC_STARFIVE = yes; + PTP_1588_CLOCK = yes; + STMMAC_ETH = yes; + STMMAC_PCI = yes; + }; - extraMeta.branch = "visionfive"; - } // (args.argsOverride or { })); -in lib.recurseIntoAttrs (linuxPackagesFor (callPackage linuxPkg { })) + extraMeta.branch = "visionfive"; + } + // (args.argsOverride or { }) + ); +in +lib.recurseIntoAttrs (linuxPackagesFor (callPackage linuxPkg { })) diff --git a/starfive/visionfive/v1/sd-image.nix b/starfive/visionfive/v1/sd-image.nix index 6b4acfc5..7b855c44 100644 --- a/starfive/visionfive/v1/sd-image.nix +++ b/starfive/visionfive/v1/sd-image.nix @@ -1,10 +1,16 @@ # To build, use: # nix-build "" -I nixos-config=starfive/visionfive/v1/sd-image.nix -A config.system.build.sdImage -{ config, pkgs, modulesPath, ... }: +{ + config, + pkgs, + modulesPath, + ... +}: let firmware = pkgs.callPackage ./firmware.nix { }; -in { +in +{ imports = [ "${modulesPath}/profiles/base.nix" "${modulesPath}/installer/sd-card/sd-image.nix" diff --git a/starfive/visionfive/v1/uboot.nix b/starfive/visionfive/v1/uboot.nix index 9eebeb9f..4f3d6a52 100644 --- a/starfive/visionfive/v1/uboot.nix +++ b/starfive/visionfive/v1/uboot.nix @@ -1,5 +1,6 @@ -{ fetchFromGitHub -, buildUBoot +{ + fetchFromGitHub, + buildUBoot, }: buildUBoot { @@ -13,5 +14,8 @@ buildUBoot { }; defconfig = "starfive_jh7100_visionfive_smode_defconfig"; - filesToInstall = [ "u-boot.bin" "u-boot.dtb" ]; + filesToInstall = [ + "u-boot.bin" + "u-boot.dtb" + ]; } diff --git a/starfive/visionfive/v2/firmware.nix b/starfive/visionfive/v2/firmware.nix index b6291152..54360093 100644 --- a/starfive/visionfive/v2/firmware.nix +++ b/starfive/visionfive/v2/firmware.nix @@ -1,4 +1,9 @@ -{ config, pkgs, lib, ... }: +{ + config, + pkgs, + lib, + ... +}: let cfg = config.hardware.visionfive2; in @@ -34,15 +39,19 @@ in config = { system.build = { - opensbi = (pkgs.callPackage ./opensbi.nix {}).overrideAttrs (f: p: { - src = if cfg.opensbi.src != null then cfg.opensbi.src else p.src; - patches = if cfg.opensbi.patches != null then cfg.opensbi.patches else (p.patches or []); - }); + opensbi = (pkgs.callPackage ./opensbi.nix { }).overrideAttrs ( + _f: p: { + src = if cfg.opensbi.src != null then cfg.opensbi.src else p.src; + patches = if cfg.opensbi.patches != null then cfg.opensbi.patches else (p.patches or [ ]); + } + ); - uboot = (pkgs.callPackage ./uboot.nix { inherit (config.system.build) opensbi; }).overrideAttrs (f: p: { - src = if cfg.uboot.src != null then cfg.uboot.src else p.src; - patches = if cfg.uboot.patches != null then cfg.uboot.patches else (p.patches or []); - }); + uboot = (pkgs.callPackage ./uboot.nix { inherit (config.system.build) opensbi; }).overrideAttrs ( + _f: p: { + src = if cfg.uboot.src != null then cfg.uboot.src else p.src; + patches = if cfg.uboot.patches != null then cfg.uboot.patches else (p.patches or [ ]); + } + ); updater-flash = pkgs.writeShellApplication { name = "visionfive2-firmware-update-flash"; diff --git a/starfive/visionfive/v2/sd-image.nix b/starfive/visionfive/v2/sd-image.nix index a14b87b2..667dc3fa 100644 --- a/starfive/visionfive/v2/sd-image.nix +++ b/starfive/visionfive/v2/sd-image.nix @@ -1,4 +1,9 @@ -{ config, pkgs, modulesPath, ... }: +{ + config, + pkgs, + modulesPath, + ... +}: { imports = [ "${modulesPath}/profiles/base.nix" @@ -7,8 +12,7 @@ ]; sdImage = { - imageName = - "${config.sdImage.imageBaseName}-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}-starfive-visionfive2.img"; + imageName = "${config.sdImage.imageBaseName}-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}-starfive-visionfive2.img"; # Overridden by postBuildCommands populateFirmwareCommands = ""; diff --git a/starfive/visionfive/v2/spl-tool.nix b/starfive/visionfive/v2/spl-tool.nix index cd0a77b0..a4543373 100644 --- a/starfive/visionfive/v2/spl-tool.nix +++ b/starfive/visionfive/v2/spl-tool.nix @@ -1,6 +1,6 @@ { stdenv, fetchFromGitHub }: -stdenv.mkDerivation (finalAttrs: { +stdenv.mkDerivation (_finalAttrs: { pname = "spi_tool"; version = "0x01010101"; src = fetchFromGitHub { diff --git a/starfive/visionfive/v2/uboot.nix b/starfive/visionfive/v2/uboot.nix index ef92cce3..6fe62a70 100644 --- a/starfive/visionfive/v2/uboot.nix +++ b/starfive/visionfive/v2/uboot.nix @@ -1,5 +1,6 @@ -{ buildUBoot -, opensbi +{ + buildUBoot, + opensbi, }: buildUBoot { diff --git a/supermicro/default.nix b/supermicro/default.nix index 9c5a2bb3..817f01d1 100644 --- a/supermicro/default.nix +++ b/supermicro/default.nix @@ -1,5 +1,8 @@ { pkgs, ... }: { - boot.kernelModules = [ "ipmi_devintf" "ipmi_si" ]; + boot.kernelModules = [ + "ipmi_devintf" + "ipmi_si" + ]; environment.systemPackages = [ pkgs.ipmitool ]; } diff --git a/supermicro/x10sll-f/default.nix b/supermicro/x10sll-f/default.nix index c0200510..cbba1eb8 100644 --- a/supermicro/x10sll-f/default.nix +++ b/supermicro/x10sll-f/default.nix @@ -3,7 +3,10 @@ ../. ]; - boot.kernelModules = [ "jc42" "tpm_rng" ]; + boot.kernelModules = [ + "jc42" + "tpm_rng" + ]; # services.cron.systemCronJobs = [ # # Reset 5-minute watchdog timer every minute diff --git a/system76/darp6/default.nix b/system76/darp6/default.nix index ff70ac94..b5a2560f 100644 --- a/system76/darp6/default.nix +++ b/system76/darp6/default.nix @@ -10,19 +10,24 @@ # system76-io-dkms also appears to be loaded on darp6 with Pop!_OS, and # system76-dkms does not, and in fact refuses to load. -{ config, lib, options, pkgs, ... }: +{ + config, + lib, + options, + pkgs, + ... +}: let cfg = config.hardware.system76.darp6; # Allow silencing the warning about these options if either is defined. soundSettingsDefined = - options.hardware.system76.darp6.soundVendorId.isDefined || - options.hardware.system76.darp6.soundSubsystemId.isDefined; + options.hardware.system76.darp6.soundVendorId.isDefined + || options.hardware.system76.darp6.soundSubsystemId.isDefined; # We neeed both options non-null to be able to apply the headset fixup though. soundSettingsAvailable = - soundSettingsDefined && - (cfg.soundVendorId != null && cfg.soundSubsystemId != null); + soundSettingsDefined && (cfg.soundVendorId != null && cfg.soundSubsystemId != null); in { imports = [ diff --git a/system76/galp5-1650/default.nix b/system76/galp5-1650/default.nix index c2fcf231..71820f6d 100644 --- a/system76/galp5-1650/default.nix +++ b/system76/galp5-1650/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: { imports = [ ../. diff --git a/system76/gaze18/default.nix b/system76/gaze18/default.nix index dd4302b8..61b3f92f 100644 --- a/system76/gaze18/default.nix +++ b/system76/gaze18/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: { imports = [ ../. diff --git a/tests/build-profile.nix b/tests/build-profile.nix index 36ab88b5..3c20380d 100644 --- a/tests/build-profile.nix +++ b/tests/build-profile.nix @@ -2,20 +2,23 @@ (pkgs.nixos [ profile - ({ config, lib, ... }: { - nixpkgs.pkgs = pkgs; - boot.loader.systemd-boot.enable = !config.boot.loader.generic-extlinux-compatible.enable; - # we forcefully disable grub here just for testing purposes, even though some profiles might still use grub in the end. - boot.loader.grub.enable = false; + ( + { config, lib, ... }: + { + nixpkgs.pkgs = pkgs; + boot.loader.systemd-boot.enable = !config.boot.loader.generic-extlinux-compatible.enable; + # we forcefully disable grub here just for testing purposes, even though some profiles might still use grub in the end. + boot.loader.grub.enable = false; - # so we can have assertions that require a certain minimum kernel version, - # We use a priority of 1200 here, which is higher than the default of 1000 - boot.kernelPackages = lib.mkOverride 1200 pkgs.linuxPackages_latest; + # so we can have assertions that require a certain minimum kernel version, + # We use a priority of 1200 here, which is higher than the default of 1000 + boot.kernelPackages = lib.mkOverride 1200 pkgs.linuxPackages_latest; - fileSystems."/" = { - device = "/dev/disk/by-uuid/00000000-0000-0000-0000-000000000000"; - fsType = "btrfs"; - }; - system.stateVersion = config.system.nixos.release; - }) + fileSystems."/" = { + device = "/dev/disk/by-uuid/00000000-0000-0000-0000-000000000000"; + fsType = "btrfs"; + }; + system.stateVersion = config.system.nixos.release; + } + ) ]).config.system.build.toplevel diff --git a/tests/flake.nix b/tests/flake.nix index 91de6edf..bf20ed3a 100644 --- a/tests/flake.nix +++ b/tests/flake.nix @@ -85,10 +85,17 @@ in { _module.args.pkgs = nixpkgsUnstable; - checks = checksForNixpkgs "nixos-unstable" nixpkgsUnstable // checksForNixpkgs "nixos-stable" nixpkgsStable; + checks = + checksForNixpkgs "nixos-unstable" nixpkgsUnstable + // checksForNixpkgs "nixos-stable" nixpkgsStable; packages.run = pkgs.writeShellScriptBin "run.py" '' #!${pkgs.bash}/bin/bash - export PATH=${lib.makeBinPath [ pkgs.nix-eval-jobs pkgs.nix-eval-jobs.nix ]} + export PATH=${ + lib.makeBinPath [ + pkgs.nix-eval-jobs + pkgs.nix-eval-jobs.nix + ] + } exec ${pkgs.python3.interpreter} ${./.}/run.py --nixos-hardware "$@" ''; }; diff --git a/toshiba/swanky/default.nix b/toshiba/swanky/default.nix index 32e3b126..7557d0a9 100644 --- a/toshiba/swanky/default.nix +++ b/toshiba/swanky/default.nix @@ -17,11 +17,13 @@ in boot.kernelParams = [ "acpi_backlight=vendor" ]; # Sound requires a custom UCM config: - system.replaceRuntimeDependencies = [{ - original = pkgs.alsa-lib; + system.replaceRuntimeDependencies = [ + { + original = pkgs.alsa-lib; - replacement = pkgs.alsa-lib.overrideAttrs (_super: { - postFixup = "cp -r ${ucm}/chtmax98090 $out/share/alsa/ucm"; - }); - }]; + replacement = pkgs.alsa-lib.overrideAttrs (_super: { + postFixup = "cp -r ${ucm}/chtmax98090 $out/share/alsa/ucm"; + }); + } + ]; } diff --git a/treefmt.nix b/treefmt.nix new file mode 100644 index 00000000..7039d8b5 --- /dev/null +++ b/treefmt.nix @@ -0,0 +1,19 @@ +{ pkgs, ... }: +{ + projectRootFile = "flake.nix"; + + programs = { + deadnix = { + enable = true; + no-lambda-pattern-names = true; + }; + nixfmt = { + enable = true; + package = pkgs.nixfmt-rfc-style; + }; + }; + + settings = { + on-unmatched = "info"; + }; +} diff --git a/tuxedo/infinitybook/pro14/gen9/default.nix b/tuxedo/infinitybook/pro14/gen9/default.nix index 7662c658..5dc50911 100644 --- a/tuxedo/infinitybook/pro14/gen9/default.nix +++ b/tuxedo/infinitybook/pro14/gen9/default.nix @@ -1,9 +1,11 @@ -{ lib, config, ... }: { +{ lib, config, ... }: +{ imports = [ ../../. ]; # Add Motorcomm YT6801 Driver if available - boot.extraModulePackages = with config.boot; lib.lists.optional - ( kernelPackages ? yt6801 ) kernelPackages.yt6801; + boot.extraModulePackages = + with config.boot; + lib.lists.optional (kernelPackages ? yt6801) kernelPackages.yt6801; } diff --git a/tuxedo/pulse/14/gen3/default.nix b/tuxedo/pulse/14/gen3/default.nix index 52d292cf..5458ce9d 100644 --- a/tuxedo/pulse/14/gen3/default.nix +++ b/tuxedo/pulse/14/gen3/default.nix @@ -3,7 +3,8 @@ pkgs, config, ... -}: { +}: +{ imports = [ ../../../../common/cpu/amd ../../../../common/cpu/amd/pstate.nix @@ -17,8 +18,9 @@ # Kernel 6.6.35 apparently does not have this issue, # the exact version is still unknown which fixed this. boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.6.35") ( - if (config.boot.zfs.enabled) - then pkgs.zfs.latestCompatibleLinuxPackages - else pkgs.linuxPackages_latest + if (config.boot.zfs.enabled) then + pkgs.zfs.latestCompatibleLinuxPackages + else + pkgs.linuxPackages_latest ); } diff --git a/tuxedo/pulse/15/gen2/default.nix b/tuxedo/pulse/15/gen2/default.nix index 05c56055..0afd6b3b 100644 --- a/tuxedo/pulse/15/gen2/default.nix +++ b/tuxedo/pulse/15/gen2/default.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ imports = [ ../../../../common/cpu/amd ../../../../common/gpu/amd @@ -6,11 +7,16 @@ ]; services.udev.extraRules = builtins.concatStringsSep "\n" ( - ["# Properly suspend the system."] - ++ ( - map - (device: ''SUBSYSTEM=="pci", ACTION=="add", ATTR{vendor}=="0x144d", ATTR{device}=="${device}", RUN+="${pkgs.runtimeShell} -c 'echo 0 > /sys/bus/pci/devices/$kernel/d3cold_allowed'"'') - ["0xa80a" "0xa808"] + [ "# Properly suspend the system." ] + ++ (map + ( + device: + ''SUBSYSTEM=="pci", ACTION=="add", ATTR{vendor}=="0x144d", ATTR{device}=="${device}", RUN+="${pkgs.runtimeShell} -c 'echo 0 > /sys/bus/pci/devices/$kernel/d3cold_allowed'"'' + ) + [ + "0xa80a" + "0xa808" + ] ) ); } From 2b0ced06c1543883636ec5dea30b48b13a28c9f5 Mon Sep 17 00:00:00 2001 From: Andre Date: Wed, 4 Jun 2025 13:39:40 -0400 Subject: [PATCH 108/134] chore: add formatting job to GitHub Actions --- .github/workflows/test.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1a7c3f7e..7200246e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,14 @@ on: branches: - master jobs: + nixfmt: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v31 + - run: nix fmt . tests: + needs: nixfmt runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From 34762bf406b82fd06e71d78556884f04f7d409fd Mon Sep 17 00:00:00 2001 From: Rituraj <56511165+imxade@users.noreply.github.com> Date: Fri, 6 Jun 2025 08:12:58 +0530 Subject: [PATCH 109/134] added inspiron 3442 to the flake --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index f7481983..1dedc2f1 100644 --- a/flake.nix +++ b/flake.nix @@ -64,6 +64,7 @@ (import ./dell/e7240); dell-g3-3779 = import ./dell/g3/3779; dell-g3-3579 = import ./dell/g3/3579; + dell-inspiron-3442 = import ./dell/inspiron/3442; dell-inspiron-14-5420 = import ./dell/inspiron/14-5420; dell-inspiron-5509 = import ./dell/inspiron/5509; dell-inspiron-5515 = import ./dell/inspiron/5515; From 293b5e472b5d740bdc218de82c7a6b77955dd7ed Mon Sep 17 00:00:00 2001 From: Pasha Fistanto Date: Wed, 28 May 2025 20:19:16 +0200 Subject: [PATCH 110/134] dell-precision-3490: split into intel and nvidia configurations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jörg Thalheim --- README.md | 3 ++- dell/precision/3490/default.nix | 29 +++++++++++--------------- dell/precision/3490/intel/default.nix | 5 +++++ dell/precision/3490/nvidia/default.nix | 12 +++++++++++ dell/precision/3490/shared.nix | 6 ++++++ flake.nix | 6 +++++- 6 files changed, 42 insertions(+), 19 deletions(-) create mode 100644 dell/precision/3490/intel/default.nix create mode 100644 dell/precision/3490/nvidia/default.nix create mode 100644 dell/precision/3490/shared.nix diff --git a/README.md b/README.md index 1bf859ab..2fb3bcc9 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,8 @@ See code for all available configurations. | [Dell Latitude E7240](dell/latitude/e7240) | `` | | [Dell Optiplex 3050](dell/optiplex/3050) | `` | | [Dell Poweredge R7515](dell/poweredge/r7515) | `` | -| [Dell Precision 3490](dell/precision/3490) | `` | +| [Dell Precision 3490, nvidia](dell/precision/3490/nvidia) | `` | +| [Dell Precision 3490, intel](dell/precision/3490/intel) | `` | | [Dell Precision 3541](dell/precision/3541) | `` | | [Dell Precision 5490](dell/precision/5490) | `` | | [Dell Precision 5530](dell/precision/5530) | `` | diff --git a/dell/precision/3490/default.nix b/dell/precision/3490/default.nix index c579f880..08d80d2f 100644 --- a/dell/precision/3490/default.nix +++ b/dell/precision/3490/default.nix @@ -1,21 +1,16 @@ { + warnings = [ + '' + DEPRECATED: The module has been deprecated. + + Either use + + for NVIDIA graphics or + + for Intel graphics. + '' + ]; imports = [ - ../../../common/cpu/intel/meteor-lake - ../../../common/gpu/nvidia/ada-lovelace - ../../../common/pc/laptop + ./nvidia/default.nix ]; - - boot.initrd.availableKernelModules = [ - "nvme" - "sd_mod" - "thunderbolt" - "usb_storage" - "vmd" - "xhci_pci" - ]; - - hardware.nvidia.prime = { - intelBusId = "PCI:0:2:0"; - nvidiaBusId = "PCI:1:0:0"; - }; } diff --git a/dell/precision/3490/intel/default.nix b/dell/precision/3490/intel/default.nix new file mode 100644 index 00000000..a5678040 --- /dev/null +++ b/dell/precision/3490/intel/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ../shared.nix + ]; +} diff --git a/dell/precision/3490/nvidia/default.nix b/dell/precision/3490/nvidia/default.nix new file mode 100644 index 00000000..379ea1f5 --- /dev/null +++ b/dell/precision/3490/nvidia/default.nix @@ -0,0 +1,12 @@ +{ + imports = [ + ../shared.nix + ../../../../common/gpu/nvidia/ada-lovelace + ]; + + + hardware.nvidia.prime = { + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:1:0:0"; + }; +} diff --git a/dell/precision/3490/shared.nix b/dell/precision/3490/shared.nix new file mode 100644 index 00000000..a4de2011 --- /dev/null +++ b/dell/precision/3490/shared.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ../../../common/cpu/intel/meteor-lake + ../../../common/pc/laptop + ]; +} diff --git a/flake.nix b/flake.nix index 048a59b7..97a3aef2 100644 --- a/flake.nix +++ b/flake.nix @@ -83,7 +83,11 @@ dell-latitude-e7240 = import ./dell/latitude/e7240; dell-optiplex-3050 = import ./dell/optiplex/3050; dell-poweredge-r7515 = import ./dell/poweredge/r7515; - dell-precision-3490 = import ./dell/precision/3490; + dell-precision-3490 = + deprecated "1491" "dell-precision-3490" + (import ./dell/precision/3490); + dell-precision-3490-nvidia = import ./dell/precision/3490/nvidia; + dell-precision-3490-intel = import ./dell/precision/3490/intel; dell-precision-3541 = import ./dell/precision/3541; dell-precision-5490 = import ./dell/precision/5490; dell-precision-5530 = import ./dell/precision/5530; From 12b4b1a92966020c748097e5feaf8a2ce585abe7 Mon Sep 17 00:00:00 2001 From: Leandro Reina Date: Fri, 6 Jun 2025 19:38:14 +0200 Subject: [PATCH 111/134] Add support for TUXEDO InfinityBook Pro AMD Gen9 --- flake.nix | 1 + tuxedo/infinitybook/pro14/gen9/amd/README.md | 1 + tuxedo/infinitybook/pro14/gen9/amd/default.nix | 6 ++++++ tuxedo/infinitybook/pro14/gen9/{ => intel}/README.md | 0 4 files changed, 8 insertions(+) create mode 100644 tuxedo/infinitybook/pro14/gen9/amd/README.md create mode 100644 tuxedo/infinitybook/pro14/gen9/amd/default.nix rename tuxedo/infinitybook/pro14/gen9/{ => intel}/README.md (100%) diff --git a/flake.nix b/flake.nix index 9fa91b25..f22412b6 100644 --- a/flake.nix +++ b/flake.nix @@ -353,6 +353,7 @@ tuxedo-aura-15-gen1 = import ./tuxedo/aura/15/gen1; tuxedo-infinitybook-v4 = import ./tuxedo/infinitybook/v4; tuxedo-infinitybook-pro14-gen7 = import ./tuxedo/infinitybook/pro14/gen7; + tuxedo-infinitybook-pro14-gen9-amd = import ./tuxedo/infinitybook/pro14/gen9/amd; tuxedo-infinitybook-pro14-gen9-intel = import ./tuxedo/infinitybook/pro14/gen9/intel; tuxedo-pulse-14-gen3 = import ./tuxedo/pulse/14/gen3; tuxedo-pulse-15-gen2 = import ./tuxedo/pulse/15/gen2; diff --git a/tuxedo/infinitybook/pro14/gen9/amd/README.md b/tuxedo/infinitybook/pro14/gen9/amd/README.md new file mode 100644 index 00000000..9f8c4038 --- /dev/null +++ b/tuxedo/infinitybook/pro14/gen9/amd/README.md @@ -0,0 +1 @@ +# [TUXEDO InfinityBook Pro 14 - Gen9 - AMD](https://www.tuxedocomputers.com/en/TUXEDO-InfinityBook-Pro-14-Gen9-AMD) diff --git a/tuxedo/infinitybook/pro14/gen9/amd/default.nix b/tuxedo/infinitybook/pro14/gen9/amd/default.nix new file mode 100644 index 00000000..15452013 --- /dev/null +++ b/tuxedo/infinitybook/pro14/gen9/amd/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ../. + ../../../../../common/cpu/amd + ]; +} diff --git a/tuxedo/infinitybook/pro14/gen9/README.md b/tuxedo/infinitybook/pro14/gen9/intel/README.md similarity index 100% rename from tuxedo/infinitybook/pro14/gen9/README.md rename to tuxedo/infinitybook/pro14/gen9/intel/README.md From ddd49b38e4994c200e9d1f135a5d1c5e52ea8932 Mon Sep 17 00:00:00 2001 From: Leandro Reina Date: Fri, 6 Jun 2025 20:03:11 +0200 Subject: [PATCH 112/134] Forgot README --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f20d7a3e..07ec6308 100644 --- a/README.md +++ b/README.md @@ -398,7 +398,8 @@ See code for all available configurations. | [Tuxedo InfinityBook v4](tuxedo/infinitybook/v4) | `` | | [TUXEDO Aura 15 - Gen1](tuxedo/aura/15/gen1) | `` | | [TUXEDO InfinityBook Pro 14 - Gen7](tuxedo/infinitybook/pro14/gen7) | `` | -| [TUXEDO InfinityBook Pro 14 - Gen9 - INTEL](tuxedo/infinitybook/pro14/gen9-intel) | `` | +| [TUXEDO InfinityBook Pro 14 - Gen9 - AMD](tuxedo/infinitybook/pro14/gen9/amd) | `` | +| [TUXEDO InfinityBook Pro 14 - Gen9 - INTEL](tuxedo/infinitybook/pro14/gen9/intel) | `` | | [TUXEDO Pulse 14 - Gen3](tuxedo/pulse/14/gen3) | `` | | [TUXEDO Pulse 15 - Gen2](tuxedo/pulse/15/gen2) | `` | | [Xiaomi Redmibook 16 Pro 2024](xiaomi/redmibook/16-pro-2024) | `` | From 62acc1db8ecebdda404eb86a0e3c947f4ec573ea Mon Sep 17 00:00:00 2001 From: Weathercold Date: Wed, 11 Jun 2025 00:38:36 -0400 Subject: [PATCH 113/134] xiaomi/redmibook/16-pro-2024: remove boot fix This option was enabled in the NixOS kernel config in https://github.com/NixOS/nixpkgs/pull/410324 --- xiaomi/fix-boot-quirk.nix | 12 ------------ xiaomi/redmibook/16-pro-2024/README.md | 3 --- xiaomi/redmibook/16-pro-2024/default.nix | 1 - 3 files changed, 16 deletions(-) delete mode 100644 xiaomi/fix-boot-quirk.nix diff --git a/xiaomi/fix-boot-quirk.nix b/xiaomi/fix-boot-quirk.nix deleted file mode 100644 index 7f8446e3..00000000 --- a/xiaomi/fix-boot-quirk.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ lib, ... }: -{ - # Required fix to allow booting NixOS on certain Xiaomi laptops - # https://discourse.nixos.org/t/system-wont-boot-path-efi-stub/29212/12 - boot.kernelPatches = lib.singleton { - name = "Fix boot"; - patch = null; - extraStructuredConfig = with lib.kernel; { - ACPI_DEBUG = yes; - }; - }; -} diff --git a/xiaomi/redmibook/16-pro-2024/README.md b/xiaomi/redmibook/16-pro-2024/README.md index 7fa95c05..d63bcfb6 100644 --- a/xiaomi/redmibook/16-pro-2024/README.md +++ b/xiaomi/redmibook/16-pro-2024/README.md @@ -1,8 +1,5 @@ # Xiaomi Redmibook 16 Pro (2024) -Note that the boot fix requires building the kernel. As such, you might run out -of space during nixos-rebuild if you mount tmpfs on `/tmp`. - ## Tested Hardware ```shellsession diff --git a/xiaomi/redmibook/16-pro-2024/default.nix b/xiaomi/redmibook/16-pro-2024/default.nix index 35fe687d..1c824b15 100644 --- a/xiaomi/redmibook/16-pro-2024/default.nix +++ b/xiaomi/redmibook/16-pro-2024/default.nix @@ -1,7 +1,6 @@ { lib, ... }: { imports = [ - ../../fix-boot-quirk.nix ../../../common/cpu/intel ../../../common/pc/laptop ../../../common/pc/ssd From 88c842d260a3c3bc88ca03b7f54d9e8a2b0c410e Mon Sep 17 00:00:00 2001 From: Rishabh <40533251+Rishabh5321@users.noreply.github.com> Date: Fri, 13 Jun 2025 19:33:13 +0530 Subject: [PATCH 114/134] xiaomi/redmibook/15-pro-2021: init --- README.md | 1 + flake.nix | 1 + xiaomi/redmibook/15-pro-2021/README.md | 37 ++++++++++++++++++++++++ xiaomi/redmibook/15-pro-2021/default.nix | 12 ++++++++ 4 files changed, 51 insertions(+) create mode 100644 xiaomi/redmibook/15-pro-2021/README.md create mode 100644 xiaomi/redmibook/15-pro-2021/default.nix diff --git a/README.md b/README.md index 07ec6308..836284c5 100644 --- a/README.md +++ b/README.md @@ -402,4 +402,5 @@ See code for all available configurations. | [TUXEDO InfinityBook Pro 14 - Gen9 - INTEL](tuxedo/infinitybook/pro14/gen9/intel) | `` | | [TUXEDO Pulse 14 - Gen3](tuxedo/pulse/14/gen3) | `` | | [TUXEDO Pulse 15 - Gen2](tuxedo/pulse/15/gen2) | `` | +| [Xiaomi Redmibook 15 Pro 2021](xiaomi/redmibook/15-pro-2021) | `` | | [Xiaomi Redmibook 16 Pro 2024](xiaomi/redmibook/16-pro-2024) | `` | diff --git a/flake.nix b/flake.nix index 2302c0be..a804dd8e 100644 --- a/flake.nix +++ b/flake.nix @@ -358,6 +358,7 @@ tuxedo-infinitybook-pro14-gen9-intel = import ./tuxedo/infinitybook/pro14/gen9/intel; tuxedo-pulse-14-gen3 = import ./tuxedo/pulse/14/gen3; tuxedo-pulse-15-gen2 = import ./tuxedo/pulse/15/gen2; + xiaomi-redmibook-15-pro-2021 = import ./xiaomi/redmibook/15-pro-2021; xiaomi-redmibook-16-pro-2024 = import ./xiaomi/redmibook/16-pro-2024; common-cpu-amd = import ./common/cpu/amd; diff --git a/xiaomi/redmibook/15-pro-2021/README.md b/xiaomi/redmibook/15-pro-2021/README.md new file mode 100644 index 00000000..d47c7546 --- /dev/null +++ b/xiaomi/redmibook/15-pro-2021/README.md @@ -0,0 +1,37 @@ +# Xiaomi Redmibook 15 Pro (2021) + +## Tested Hardware + +```shellsession +$ lspci -nn +00:00.0 Host bridge [0600]: Intel Corporation Tiger Lake-UP3/H35 4 cores Host Bridge/DRAM Registers [8086:9a14] (rev 01) +00:02.0 VGA compatible controller [0300]: Intel Corporation TigerLake-LP GT2 [Iris Xe Graphics] [8086:9a49] (rev 01) +00:04.0 Signal processing controller [1180]: Intel Corporation TigerLake-LP Dynamic Tuning Processor Participant [8086:9a03] (rev 01) +00:08.0 System peripheral [0880]: Intel Corporation GNA Scoring Accelerator module [8086:9a11] (rev 01) +00:0a.0 Signal processing controller [1180]: Intel Corporation Tigerlake Telemetry Aggregator Driver [8086:9a0d] (rev 01) +00:0d.0 USB controller [0c03]: Intel Corporation Tiger Lake-LP Thunderbolt 4 USB Controller [8086:9a13] (rev 01) +00:14.0 USB controller [0c03]: Intel Corporation Tiger Lake-LP USB 3.2 Gen 2x1 xHCI Host Controller [8086:a0ed] (rev 20) +00:14.2 RAM memory [0500]: Intel Corporation Tiger Lake-LP Shared SRAM [8086:a0ef] (rev 20) +00:14.3 Network controller [0280]: Intel Corporation Wi-Fi 6 AX201 [8086:a0f0] (rev 20) +00:15.0 Serial bus controller [0c80]: Intel Corporation Tiger Lake-LP Serial IO I2C Controller #0 [8086:a0e8] (rev 20) +00:15.1 Serial bus controller [0c80]: Intel Corporation Tiger Lake-LP Serial IO I2C Controller #1 [8086:a0e9] (rev 20) +00:15.2 Serial bus controller [0c80]: Intel Corporation Tiger Lake-LP Serial IO I2C Controller #2 [8086:a0ea] (rev 20) +00:15.3 Serial bus controller [0c80]: Intel Corporation Tiger Lake-LP Serial IO I2C Controller #3 [8086:a0eb] (rev 20) +00:16.0 Communication controller [0780]: Intel Corporation Tiger Lake-LP Management Engine Interface [8086:a0e0] (rev 20) +00:19.0 Serial bus controller [0c80]: Intel Corporation Tiger Lake-LP Serial IO I2C Controller #4 [8086:a0c5] (rev 20) +00:19.1 Serial bus controller [0c80]: Intel Corporation Tiger Lake-LP Serial IO I2C Controller #5 [8086:a0c6] (rev 20) +00:1d.0 PCI bridge [0604]: Intel Corporation Tiger Lake-LP PCI Express Root Port #9 [8086:a0b0] (rev 20) +00:1d.3 PCI bridge [0604]: Intel Corporation Tiger Lake-LP PCI Express Root Port #12 [8086:a0b3] (rev 20) +00:1f.0 ISA bridge [0601]: Intel Corporation Tiger Lake-LP LPC Controller [8086:a082] (rev 20) +00:1f.3 Multimedia audio controller [0401]: Intel Corporation Tiger Lake-LP Smart Sound Technology Audio Controller [8086:a0c8] (rev 20) +00:1f.4 SMBus [0c05]: Intel Corporation Tiger Lake-LP SMBus Controller [8086:a0a3] (rev 20) +00:1f.5 Serial bus controller [0c80]: Intel Corporation Tiger Lake-LP SPI Controller [8086:a0a4] (rev 20) +01:00.0 Non-Volatile memory controller [0108]: Shenzhen Longsys Electronics Co., Ltd. FORESEE XP1000 / Lexar Professional CFexpress Type B Gold series, NM620 PCIe NVME SSD (DRAM-less) [1d97:5216] (rev 01) +02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 15) +``` + +## Extra Configuration + +### Bluetooth + +To enable bluetooth support, set `hardware.bluetooth.enable = true;`. diff --git a/xiaomi/redmibook/15-pro-2021/default.nix b/xiaomi/redmibook/15-pro-2021/default.nix new file mode 100644 index 00000000..1c824b15 --- /dev/null +++ b/xiaomi/redmibook/15-pro-2021/default.nix @@ -0,0 +1,12 @@ +{ lib, ... }: +{ + imports = [ + ../../../common/cpu/intel + ../../../common/pc/laptop + ../../../common/pc/ssd + ]; + + hardware.enableRedistributableFirmware = lib.mkDefault true; + + services.thermald.enable = lib.mkDefault true; +} From 16aad554b0f1a5ac40cce80c8681c06d8907c56b Mon Sep 17 00:00:00 2001 From: Rituraj <56511165+imxade@users.noreply.github.com> Date: Sun, 15 Jun 2025 20:07:14 +0530 Subject: [PATCH 115/134] removed explicit gpu mention as it's included in cpu profile --- dell/inspiron/3442/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dell/inspiron/3442/default.nix b/dell/inspiron/3442/default.nix index 44b65ce6..0d298ff3 100644 --- a/dell/inspiron/3442/default.nix +++ b/dell/inspiron/3442/default.nix @@ -2,9 +2,8 @@ { imports = [ - ../../../common/cpu/intel + ../../../common/cpu/intel/haswell ../../../common/pc/laptop - ../../../common/gpu/intel/haswell ]; hardware.enableAllFirmware = lib.mkDefault true; From 9b86fa5d67f0192d8f2f8d3fcd8a019664b41c55 Mon Sep 17 00:00:00 2001 From: Biaogo <481622717@qq.com> Date: Mon, 16 Jun 2025 22:11:03 +0800 Subject: [PATCH 116/134] Add 16iah7h --- README.md | 1 + flake.nix | 1 + lenovo/legion/16iah7h/default.nix | 31 +++++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 lenovo/legion/16iah7h/default.nix diff --git a/README.md b/README.md index 836284c5..758c2ab2 100644 --- a/README.md +++ b/README.md @@ -232,6 +232,7 @@ See code for all available configurations. | [Lenovo Legion 5 Pro 16ach6h (Nvidia)](lenovo/legion/16ach6h/nvidia) | `` | | [Lenovo Legion 5 Pro 16arh7h (IGPU Only)](lenovo/legion/16arh7h/igpu-only) | `` | | [Lenovo Legion 5 Pro 16arh7h (Hybrid)](lenovo/legion/16arh7h/hybrid) | `` | +| [Legion Legion 5 Pro 16IAH7H (Intel)](lenovo/legion/16iah7h/) | `` | | [Lenovo Legion 7 16achg6 (Hybrid)](lenovo/legion/16achg6/hybrid) | `` | | [Lenovo Legion 7 16achg6 (Nvidia)](lenovo/legion/16achg6/nvidia) | `` | | [Lenovo Legion 7i Pro 16irx8h (Intel)](lenovo/legion/16irx8h) | `` | diff --git a/flake.nix b/flake.nix index a804dd8e..389be153 100644 --- a/flake.nix +++ b/flake.nix @@ -180,6 +180,7 @@ lenovo-legion-16achg6-nvidia = import ./lenovo/legion/16achg6/nvidia; lenovo-legion-16aph8 = import ./lenovo/legion/16aph8; lenovo-legion-16arha7 = import ./lenovo/legion/16arha7; + lenovo-legion-16iah7h = import ./lenovo/legion/16iah7h; lenovo-legion-16ithg6 = import ./lenovo/legion/16ithg6; lenovo-legion-16irx8h = import ./lenovo/legion/16irx8h; lenovo-legion-16irx9h = import ./lenovo/legion/16irx9h; diff --git a/lenovo/legion/16iah7h/default.nix b/lenovo/legion/16iah7h/default.nix new file mode 100644 index 00000000..cf1fe5f8 --- /dev/null +++ b/lenovo/legion/16iah7h/default.nix @@ -0,0 +1,31 @@ +{ + lib, + config, + ... +}: { + imports = [ + ../../../common/cpu/intel + ../../../common/gpu/nvidia/prime.nix + ../../../common/gpu/nvidia/ampere + ../../../common/pc/laptop + ../../../common/pc/ssd + ../../../common/hidpi.nix + ]; + + boot.extraModulePackages = [config.boot.kernelPackages.lenovo-legion-module]; + + hardware = { + nvidia = { + powerManagement.enable = lib.mkDefault true; + + prime = { + intelBusId = "PCI:00:02:0"; + nvidiaBusId = "PCI:01:00:0"; + }; + }; + }; + + services.thermald.enable = lib.mkDefault true; + + services.xserver.dpi = 189; +} From 66b2b86107252af9524305096d91368674850ed4 Mon Sep 17 00:00:00 2001 From: AlexAntonik Date: Wed, 18 Jun 2025 22:48:44 +0300 Subject: [PATCH 117/134] add module names to README, add missing modulle declaration, fix typos Signed-off-by: AlexAntonik --- README.md | 664 +++++++++++++++++++++++++++--------------------------- flake.nix | 1 + 2 files changed, 333 insertions(+), 332 deletions(-) diff --git a/README.md b/README.md index 758c2ab2..dce01f4a 100644 --- a/README.md +++ b/README.md @@ -73,335 +73,335 @@ For questions and discussions, come join us in the [nixos-anywhere matrix](https See code for all available configurations. -| Model | Path | -| --------------------------------------------------------------------------------- | ------------------------------------------------------- | -| [Acer Aspire 4810T](acer/aspire/4810t) | `` | -| [Airis N990](airis/n990) | `` | -| [Apple iMac 14.2](apple/imac/14-2) | `` | -| [Apple iMac 18.2](apple/imac/18-2) | `` | -| [Apple MacBook Air 3,X](apple/macbook-air/3) | `` | -| [Apple MacBook Air 4,X](apple/macbook-air/4) | `` | -| [Apple MacBook Air 6,X](apple/macbook-air/6) | `` | -| [Apple MacBook Air 7,X](apple/macbook-air/7) | `` | -| [Apple MacBook Pro 8,1](apple/macbook-pro/8-1) | `` | -| [Apple MacBook Pro 10,1](apple/macbook-pro/10-1) | `` | -| [Apple MacBook Pro 11,1](apple/macbook-pro/11-1) | `` | -| [Apple MacBook Pro 11,5](apple/macbook-pro/11-5) | `` | -| [Apple MacBook Pro 12,1](apple/macbook-pro/12-1) | `` | -| [Apple MacBook Pro 14,1](apple/macbook-pro/14-1) | `` | -| [Apple MacMini (2010, Intel, Nvidia)](apple/macmini/4) | `` | -| [Apple Macs with a T2 Chip](apple/t2) | `` | -| [Aoostar R1 N100](aoostar/r1/n100) | `` | -| [Asus Pro WS X570-ACE](asus/pro-ws-x570-ace) | `` | -| [Asus ROG Ally RC71L (2023)](asus/ally/rc71l) | `` | -| [Asus ROG Flow X13 GV302X\* (2023)](asus/flow/gv302x/amdgpu) | `` | -| [Asus ROG Flow X13 GV302X\* (2023)](asus/flow/gv302x/nvidia) | `` | -| [Asus ROG Strix G513IM](asus/rog-strix/g513im) | `` | -| [Asus ROG Strix G533ZW](asus/rog-strix/g533zw) | `` | -| [Asus ROG Strix G713IE](asus/rog-strix/g713ie) | `` | -| [Asus ROG Strix G733QS](asus/rog-strix/g733qs) | `` | -| [Asus ROG Strix X570-E GAMING](asus/rog-strix/x570e) | `` | -| [Asus ROG Zephyrus G14 GA401](asus/zephyrus/ga401) | `` | -| [Asus ROG Zephyrus G14 GA402](asus/zephyrus/ga402) | `` | -| [Asus ROG Zephyrus G14 GA402X\* (2023)](asus/zephyrus/ga402x/amdgpu) | `` | -| [Asus ROG Zephyrus G14 GA402X\* (2023)](asus/zephyrus/ga402x/nvidia) | `` | -| [Asus ROG Zephyrus G15 GA502](asus/zephyrus/ga502) | `` | -| [Asus ROG Zephyrus G15 GA503](asus/zephyrus/ga503) | `` | -| [Asus ROG Zephyrus G16 GU605MY](asus/zephyrus/gu605my) | `` | -| [Asus ROG Zephyrus M16 GU603H](asus/zephyrus/gu603h) | `` | -| [Asus TUF FX504GD](asus/fx504gd) | `` | -| [Asus TUF FX506HM](asus/fx506hm) | `` | -| [Asus TUF FA506IC](asus/fa506ic) | `` | -| [Asus TUF FA507RM](asus/fa507rm) | `` | -| [Asus TUF FA507NV](asus/fa507nv) | `` | -| [Asus Zenbook Duo 14 UX481](asus/zenbook/ux481/intelgpu/) | `` | -| [Asus Zenbook Duo 14 UX481](asus/zenbook/ux481/nvidia/) | `` | -| [Asus Zenbook Flip S13 UX371](asus/zenbook/ux371/) | `` | -| [Asus Zenbook Pro 15 UX535](asus/zenbook/ux535/) | `` | -| [BeagleBoard PocketBeagle](beagleboard/pocketbeagle) | `` | -| [Chuwi MiniBook X](chuwi/minibook-x) | `` | -| [Deciso DEC series](deciso/dec) | `` | -| [Dell G3 3779](dell/g3/3779) | `` | -| [Dell G3 3579](dell/g3/3579) | `` | -| [Dell Inspiron 3442](dell/inspiron/3442) | `` | -| [Dell Inspiron 14 5420](dell/inspiron/14-5420) | `` | -| [Dell Inspiron 5509](dell/inspiron/5509) | `` | -| [Dell Inspiron 5515](dell/inspiron/5515) | `` | -| [Dell Inspiron 7405](dell/inspiron/7405) | `` | -| [Dell Inspiron 7460](dell/inspiron/7460) | `` | -| [Dell Inspiron 7559](dell/inspiron/7559) | `` | -| [Dell Latitude 3340](dell/latitude/3340) | `` | -| [Dell Latitude 3480](dell/latitude/3480) | `` | -| [Dell Latitude 5490](dell/latitude/5490) | `` | -| [Dell Latitude 5520](dell/latitude/5520) | `` | -| [Dell Latitude 7280](dell/latitude/7280) | `` | -| [Dell Latitude 7390](dell/latitude/7390) | `` | -| [Dell Latitude 7420](dell/latitude/7420) | `` | -| [Dell Latitude 7430](dell/latitude/7430) | `` | -| [Dell Latitude 7490](dell/latitude/7490) | `` | -| [Dell Latitude 9430](dell/latitude/9430) | `` | -| [Dell Latitude E7240](dell/latitude/e7240) | `` | -| [Dell Optiplex 3050](dell/optiplex/3050) | `` | -| [Dell Poweredge R7515](dell/poweredge/r7515) | `` | -| [Dell Precision 3490, nvidia](dell/precision/3490/nvidia) | `` | -| [Dell Precision 3490, intel](dell/precision/3490/intel) | `` | -| [Dell Precision 3541](dell/precision/3541) | `` | -| [Dell Precision 5490](dell/precision/5490) | `` | -| [Dell Precision 5530](dell/precision/5530) | `` | -| [Dell Precision 7520](dell/precision/7520) | `` | -| [Dell XPS 13 7390](dell/xps/13-7390) | `` | -| [Dell XPS 13 9300](dell/xps/13-9300) | `` | -| [Dell XPS 13 9310](dell/xps/13-9310) | `` | -| [Dell XPS 13 9315](dell/xps/13-9315) | `` | -| [Dell XPS 13 9333](dell/xps/13-9333) | `` | -| [Dell XPS 13 9343](dell/xps/13-9343) | `` | -| [Dell XPS 13 9350](dell/xps/13-9350) | `` | -| [Dell XPS 13 9360](dell/xps/13-9360) | `` | -| [Dell XPS 13 9370](dell/xps/13-9370) | `` | -| [Dell XPS 13 9380](dell/xps/13-9380) | `` | -| [Dell XPS 15 7590, nvidia](dell/xps/15-7590/nvidia) | `` | -| [Dell XPS 15 7590](dell/xps/15-7590) | `` | -| [Dell XPS 15 9500, nvidia](dell/xps/15-9500/nvidia) | `` | -| [Dell XPS 15 9500](dell/xps/15-9500) | `` | -| [Dell XPS 15 9510, nvidia](dell/xps/15-9510/nvidia) | `` | -| [Dell XPS 15 9510](dell/xps/15-9510) | `` | -| [Dell XPS 15 9520, nvidia](dell/xps/15-9520/nvidia) | `` | -| [Dell XPS 15 9520](dell/xps/15-9520) | `` | -| [Dell XPS 15 9530, nvidia](dell/xps/15-9520/nvidia) | `` | -| [Dell XPS 15 9420](dell/xps/15-9520) | `` | -| [Dell XPS 15 9550, nvidia](dell/xps/15-9550/nvidia) | `` | -| [Dell XPS 15 9550](dell/xps/15-9550) | `` | -| [Dell XPS 15 9560, intel only](dell/xps/15-9560/intel) | `` | -| [Dell XPS 15 9560, nvidia only](dell/xps/15-9560/nvidia) | `` | -| [Dell XPS 15 9560](dell/xps/15-9560) | `` | -| [Dell XPS 15 9570, intel only](dell/xps/15-9570/intel) | `` | -| [Dell XPS 15 9570, nvidia](dell/xps/15-9570/nvidia) | `` | -| [Dell XPS 15 9570](dell/xps/15-9570) | `` | -| [Dell XPS 17 9700, intel](dell/xps/17-9700/intel) | `` | -| [Dell XPS 17 9710, intel only](dell/xps/17-9710/intel) | `` | -| [Framework 11th Gen Intel Core](framework/13-inch/11th-gen-intel) | `` | -| [Framework 12th Gen Intel Core](framework/13-inch/12th-gen-intel) | `` | -| [Framework 13th Gen Intel Core](framework/13-inch/13th-gen-intel) | `` | -| [Framework Intel Core Ultra Series 1](framework/13-inch/intel-core-ultra-series1) | `` | -| [Framework 13 AMD Ryzen 7040 Series](framework/13-inch/7040-amd) | `` | -| [Framework 13 AMD AI 300 Series](framework/13-inch/amd-ai-300-series) | `` | -| [Framework 12 13th Gen Intel Core](framework/12-inch/13th-gen-intel) | `` | -| [Framework 16 AMD Ryzen 7040 Series](framework/16-inch/7040-amd) | `` | -| [FriendlyARM NanoPC-T4](friendlyarm/nanopc-t4) | `` | -| [FriendlyARM NanoPi R5s](friendlyarm/nanopi-r5s) | `` | -| [Focus M2 Gen 1](focus/m2/gen1) | `` | -| [Gigabyte B550](gigabyte/b550) | `` | -| [Gigabyte B650](gigabyte/b650) | `` | -| [GMKtec NucBox G3 Plus](gmktec/nucbox/g3-plus) | `` | -| [GPD MicroPC](gpd/micropc) | `` | -| [GPD P2 Max](gpd/p2-max) | `` | -| [GPD Pocket 3](gpd/pocket-3) | `` | -| [GPD Pocket 4](gpd/pocket-4) | `` | -| [GPD WIN 2](gpd/win-2) | `` | -| [GPD WIN Max 2 2023](gpd/win-max-2/2023) | `` | -| [GPD WIN Mini 2024](gpd/win-mini/2024) | `` | -| [Google Pixelbook](google/pixelbook) | `` | -| [HP Elitebook 2560p](hp/elitebook/2560p) | `` | -| [HP Elitebook 830g6](hp/elitebook/830/g6) | `` | -| [HP Elitebook 845g7](hp/elitebook/845/g7) | `` | -| [HP Elitebook 845g8](hp/elitebook/845/g8) | `` | -| [HP Elitebook 845g9](hp/elitebook/845/g9) | `` | -| [HP Laptop 14s-dq2024nf](hp/laptop/14s-dq2024nf) | `` | -| [HP Notebook 14-df0023](hp/notebook/14-df0023) | `` | -| [HP Probook 440G5](hp/probook/440g5) | `` | -| [Huawei Matebook X Pro (2020)](huawei/machc-wa) | `` | -| [i.MX8QuadMax Multisensory Enablement Kit](nxp/imx8qm-mek/) | `` | -| [Intel NUC 8i7BEH](intel/nuc/8i7beh/) | `` | -| [Lenovo IdeaCentre K330](lenovo/ideacentre/k330) | `` | -| [Lenovo IdeaPad 3 15alc6](lenovo/ideapad/15alc6) | `` | -| [Lenovo IdeaPad Gaming 3 15arh05](lenovo/ideapad/15arh05) | `` | -| [Lenovo IdeaPad Gaming 3 15ach6](lenovo/ideapad/15ach6) | `` | -| [Lenovo IdeaPad 5 Pro 14imh9](lenovo/ideapad/14imh9) | `` | -| [Lenovo IdeaPad 5 Pro 16ach6](lenovo/ideapad/16ach6) | `` | -| [Lenovo IdeaPad Z510](lenovo/ideapad/z510) | `` | -| [Lenovo IdeaPad Slim 5](lenovo/ideapad/slim-5) | `` | -| [Lenovo IdeaPad Slim 5 16iah8](lenovo/ideapad/16iah8) | `` | -| [Lenovo Legion 5 15ach6h](lenovo/legion/15ach6h) | `` | -| [Lenovo Legion 5 15arh05h](lenovo/legion/15arh05h) | `` | -| [Lenovo Legion 7 Slim 15ach6](lenovo/legion/15ach6) | `` | -| [Lenovo Legion 5 Pro 16ach6h](lenovo/legion/16ach6h) | `` | -| [Lenovo Legion 5 Pro 16ach6h (Hybrid)](lenovo/legion/16ach6h/hybrid) | `` | -| [Lenovo Legion 5 Pro 16ach6h (Nvidia)](lenovo/legion/16ach6h/nvidia) | `` | -| [Lenovo Legion 5 Pro 16arh7h (IGPU Only)](lenovo/legion/16arh7h/igpu-only) | `` | -| [Lenovo Legion 5 Pro 16arh7h (Hybrid)](lenovo/legion/16arh7h/hybrid) | `` | -| [Legion Legion 5 Pro 16IAH7H (Intel)](lenovo/legion/16iah7h/) | `` | -| [Lenovo Legion 7 16achg6 (Hybrid)](lenovo/legion/16achg6/hybrid) | `` | -| [Lenovo Legion 7 16achg6 (Nvidia)](lenovo/legion/16achg6/nvidia) | `` | -| [Lenovo Legion 7i Pro 16irx8h (Intel)](lenovo/legion/16irx8h) | `` | -| [Lenovo Legion 7 Pro 16irx9h (Intel)](lenovo/legion/16irx9h) | `` | -| [Lenovo Legion Slim 7 Gen 7 (AMD)](lenovo/legion/16arha7/) | `` | -| [Lenovo Legion T5 AMR5](lenovo/legion/t526amr5) | `` | -| [Lenovo Legion Y530 15ICH](lenovo/legion/15ich) | `` | -| [Lenovo ThinkPad A475](lenovo/thinkpad/a475) | `` | -| [Lenovo ThinkPad E14 (AMD)](lenovo/thinkpad/e14/amd) | `` | -| [Lenovo ThinkPad E14 (Intel - Gen 1)](lenovo/thinkpad/e14/intel) | `` | -| [Lenovo ThinkPad E14 (Intel - Gen 4)](lenovo/thinkpad/e14/intel/gen4) | `` | -| [Lenovo ThinkPad E14 (Intel - Gen 6)](lenovo/thinkpad/e14/intel/gen6) | `` | -| [Lenovo ThinkPad E15 (Intel)](lenovo/thinkpad/e15/intel) | `` | -| [Lenovo ThinkPad E470](lenovo/thinkpad/e470) | `` | -| [Lenovo ThinkPad E495](lenovo/thinkpad/e495) | `` | -| [Lenovo ThinkPad L13 Yoga](lenovo/thinkpad/l13/yoga) | `` | -| [Lenovo ThinkPad L13](lenovo/thinkpad/l13) | `` | -| [Lenovo ThinkPad L14 (AMD)](lenovo/thinkpad/l14/amd) | `` | -| [Lenovo ThinkPad L14 (Intel)](lenovo/thinkpad/l14/intel) | `` | -| [Lenovo ThinkPad L480](lenovo/thinkpad/l480) | `` | -| [Lenovo ThinkPad P1 Gen 3](lenovo/thinkpad/p1/3th-gen) | `` | -| [Lenovo ThinkPad P14s AMD Gen 1](lenovo/thinkpad/p14s/amd/gen1) | `` | -| [Lenovo ThinkPad P14s AMD Gen 2](lenovo/thinkpad/p14s/amd/gen2) | `` | -| [Lenovo ThinkPad P14s AMD Gen 3](lenovo/thinkpad/p14s/amd/gen3) | `` | -| [Lenovo ThinkPad P14s AMD Gen 4](lenovo/thinkpad/p14s/amd/gen4) | `` | -| [Lenovo ThinkPad P14s AMD Gen 5](lenovo/thinkpad/p14s/amd/gen5) | `` | -| [Lenovo ThinkPad P14s Intel Gen 3](lenovo/thinkpad/p14s/intel/gen3) | `` | -| [Lenovo ThinkPad P14s Intel Gen 5](lenovo/thinkpad/p14s/intel/gen5) | `` | -| [Lenovo ThinkPad P16s AMD Gen 1](lenovo/thinkpad/p16s/amd/gen1) | `` | -| [Lenovo ThinkPad P16s AMD Gen 2](lenovo/thinkpad/p16s/amd/gen2) | `` | -| [Lenovo ThinkPad P16s Intel Gen 2](lenovo/thinkpad/p16s/intel/gen2) | `` | -| [Lenovo ThinkPad P1](lenovo/thinkpad/p1) | `` | -| [Lenovo ThinkPad P43s](lenovo/thinkpad/p43s) | `` | -| [Lenovo ThinkPad P50](lenovo/thinkpad/p50) | `` | -| [Lenovo ThinkPad P51](lenovo/thinkpad/p51) | `` | -| [Lenovo ThinkPad P52](lenovo/thinkpad/p52) | `` | -| [Lenovo ThinkPad P53](lenovo/thinkpad/p53) | `` | -| [Lenovo ThinkPad T14 AMD Gen 1](lenovo/thinkpad/t14/amd/gen1) | `` | -| [Lenovo ThinkPad T14 AMD Gen 2](lenovo/thinkpad/t14/amd/gen2) | `` | -| [Lenovo ThinkPad T14 AMD Gen 3](lenovo/thinkpad/t14/amd/gen3) | `` | -| [Lenovo ThinkPad T14 AMD Gen 4](lenovo/thinkpad/t14/amd/gen4) | `` | -| [Lenovo ThinkPad T14 AMD Gen 5](lenovo/thinkpad/t14/amd/gen5) | `` | -| [Lenovo ThinkPad T14](lenovo/thinkpad/t14) | `` | -| [Lenovo ThinkPad T14s AMD Gen 1](lenovo/thinkpad/t14s/amd/gen1) | `` | -| [Lenovo ThinkPad T14s AMD Gen 4](lenovo/thinkpad/t14s/amd/gen4) | `` | -| [Lenovo ThinkPad T14s](lenovo/thinkpad/t14s) | `` | -| [Lenovo ThinkPad T410](lenovo/thinkpad/t410) | `` | -| [Lenovo ThinkPad T420](lenovo/thinkpad/t420) | `` | -| [Lenovo ThinkPad T430](lenovo/thinkpad/t430) | `` | -| [Lenovo ThinkPad T440p](lenovo/thinkpad/t440p) | `` | -| [Lenovo ThinkPad T440s](lenovo/thinkpad/t440s) | `` | -| [Lenovo ThinkPad T450s](lenovo/thinkpad/t450s) | `` | -| [Lenovo ThinkPad T460](lenovo/thinkpad/t460) | `` | -| [Lenovo ThinkPad T460p](lenovo/thinkpad/t460p) | `` | -| [Lenovo ThinkPad T460s](lenovo/thinkpad/t460s) | `` | -| [Lenovo ThinkPad T470s](lenovo/thinkpad/t470s) | `` | -| [Lenovo ThinkPad T480](lenovo/thinkpad/t480) | `` | -| [Lenovo ThinkPad T480s](lenovo/thinkpad/t480s) | `` | -| [Lenovo ThinkPad T490](lenovo/thinkpad/t490) | `` | -| [Lenovo ThinkPad T490s](lenovo/thinkpad/t490s) | `` | -| [Lenovo ThinkPad T495](lenovo/thinkpad/t495) | `` | -| [Lenovo ThinkPad T520](lenovo/thinkpad/t520) | `` | -| [Lenovo ThinkPad T550](lenovo/thinkpad/t550) | `` | -| [Lenovo ThinkPad T590](lenovo/thinkpad/t590) | `` | -| [Lenovo ThinkPad W520](lenovo/thinkpad/w520) | `` | -| [Lenovo ThinkPad X1 Yoga](lenovo/thinkpad/x1/yoga) | `` | -| [Lenovo ThinkPad X1 Yoga Gen 7](lenovo/thinkpad/x1/yoga/7th-gen/) | `` | -| [Lenovo ThinkPad X1 Yoga Gen 8](lenovo/thinkpad/x1/yoga/8th-gen/) | `` | -| [Lenovo ThinkPad X1 (2nd Gen)](lenovo/thinkpad/x1/2nd-gen) | `` | -| [Lenovo ThinkPad X1 (6th Gen)](lenovo/thinkpad/x1/6th-gen) | `` | -| [Lenovo ThinkPad X1 (7th Gen)](lenovo/thinkpad/x1/7th-gen) | `` | -| [Lenovo ThinkPad X1 (9th Gen)](lenovo/thinkpad/x1/9th-gen) | `` | -| [Lenovo ThinkPad X1 (10th Gen)](lenovo/thinkpad/x1/10th-gen) | `` | -| [Lenovo ThinkPad X1 (11th Gen)](lenovo/thinkpad/x1/11th-gen) | `` | -| [Lenovo ThinkPad X1 (12th Gen)](lenovo/thinkpad/x1/12th-gen) | `` | -| [Lenovo ThinkPad X1 (13th Gen)](lenovo/thinkpad/x1/13th-gen) | `` | -| [Lenovo ThinkPad X1 Extreme Gen 2](lenovo/thinkpad/x1-extreme/gen2) | `` | -| [Lenovo ThinkPad X1 Extreme Gen 3](lenovo/thinkpad/x1-extreme/gen3) | `` | -| [Lenovo ThinkPad X1 Extreme Gen 4](lenovo/thinkpad/x1-extreme/gen4) | `` | -| [Lenovo ThinkPad X1 Nano Gen 1](lenovo/thinkpad/x1-nano/gen1) | `` | -| [Lenovo ThinkPad X13s](lenovo/thinkpad/x13s) | `` | -| [Lenovo ThinkPad X13 Yoga](lenovo/thinkpad/x13/yoga) | `` | -| [Lenovo ThinkPad X13 Yoga (3th Gen)](lenovo/thinkpad/x13/yoga/3th-gen) | `` | -| [Lenovo ThinkPad X13 (Intel)](lenovo/thinkpad/x13/intel) | `` | -| [Lenovo ThinkPad X13 (AMD)](lenovo/thinkpad/x13/amd) | `` | -| [Lenovo ThinkPad X140e](lenovo/thinkpad/x140e) | `` | -| [Lenovo ThinkPad X200s](lenovo/thinkpad/x200s) | `` | -| [Lenovo ThinkPad X220](lenovo/thinkpad/x220) | `` | -| [Lenovo ThinkPad X230](lenovo/thinkpad/x230) | `` | -| [Lenovo ThinkPad X250](lenovo/thinkpad/x250) | `` | -| [Lenovo ThinkPad X260](lenovo/thinkpad/x260) | `` | -| [Lenovo ThinkPad X270](lenovo/thinkpad/x270) | `` | -| [Lenovo ThinkPad X280](lenovo/thinkpad/x280) | `` | -| [Lenovo ThinkPad X390](lenovo/thinkpad/x390) | `` | -| [Lenovo ThinkPad Z Series](lenovo/thinkpad/z) | `` | -| [Lenovo ThinkPad Z13 Gen 1](lenovo/thinkpad/z/gen1/z13) | `` | -| [Lenovo ThinkPad Z13 Gen 2](lenovo/thinkpad/z/gen2/z13) | `` | -| [Lenovo XiaoXin Pro 14imh9 2024](lenovo/ideapad/14imh9) | `` | -| [LENOVO Yoga 6 13ALC6 82ND](lenovo/yoga/6/13ALC6) | `` | -| [LENOVO Yoga Slim 7 Pro-X 14ARH7 82ND](lenovo/yoga/7/14ARH7/amdgpu) | `` | -| [LENOVO Yoga Slim 7 Pro-X 14ARH7 82ND](lenovo/yoga/7/14ARH7/nvidia) | `` | -| [Lenovo Yoga Slim 7i Pro X 14IAH7 (Integrated)](lenovo/yoga/7/14IAH7/integrated) | `` | -| [Lenovo Yoga Slim 7i Pro X 14IAH7 (Hybrid)](lenovo/yoga/7/14IAH7/hybrid) | `` | -| [Lenovo Yoga Slim 7 14ILL10](lenovo/yoga/7/14ILL10) | `` | -| [LENOVO Yoga 7 Slim Gen8](lenovo/yoga/7/slim/gen8) | `` | -| [MSI B550-A PRO](msi/b550-a-pro) | `` | -| [MSI B350 TOMAHAWK](msi/b350-tomahawk) | `` | -| [MSI GS60 2QE](msi/gs60) | `` | -| [MSI GL62/CX62](msi/gl62) | `` | -| [MSI GL65 10SDR-492](msi/gl65/10SDR-492) | `` | -| [Microchip Icicle Kit](microchip/icicle-kit) | `` | -| [Microsoft Surface Go](microsoft/surface/surface-go) | `` | -| [Microsoft Surface Pro (Intel)](microsoft/surface/surface-pro-intel) | `` | -| [Microsoft Surface Laptop (AMD)](microsoft/surface/surface-laptop-amd) | `` | -| [Microsoft Surface Range (Common Modules)](microsoft/surface/common) | `` | -| [Microsoft Surface Pro 3](microsoft/surface-pro/3) | `` | -| [Microsoft Surface Pro 9](microsoft/surface-pro/9) | `` | -| [Morefine M600](morefine/m600) | `` | -| [Minisforum V3](minisforum/v3) | `` | -| [NXP iMX8 MPlus Evaluation Kit](nxp/imx8mp-evk) | `` | -| [NXP iMX8 MQuad Evaluation Kit](nxp/imx8mq-evk) | `` | -| [Hardkernel Odroid HC4](hardkernel/odroid-hc4/default.nix) | `` | -| [Hardkernel Odroid H3](hardkernel/odroid-h3/default.nix) | `` | -| [Hardkernel Odroid H4](hardkernel/odroid-h4/default.nix) | `` | -| [Omen 14-fb0798ng](omen/14-fb0798ng) | `` | -| [Omen 15-ce002ns](omen/15-ce002ns) | `` | -| [Omen 15-en0010ca](omen/15-en0010ca) | `` | -| [Omen 16-n0005ne](omen/16-n0005ne) | `` | -| [Omen 16-n0280nd](/omen/16-n0280nd) | `` | -| [Omen 15-en1007sa](omen/15-en1007sa) | `` | -| [Omen 15-en0002np](omen/15-en0002np) | `` | -| [One-Netbook OneNetbook 4](onenetbook/4) | `` | -| [Panasonic Let's Note CF-LX4](panasonic/letsnote/cf-lx4) | `` | -| [PC Engines APU](pcengines/apu) | `` | -| [PINE64 Pinebook Pro](pine64/pinebook-pro/) | `` | -| [PINE64 RockPro64](pine64/rockpro64/) | `` | -| [PINE64 STAR64](pine64/star64/) | `` | -| [Protectli VP4670](protectli/vp4670/) | `` | -| [Purism Librem 13v3](purism/librem/13v3) | `` | -| [Purism Librem 15v3](purism/librem/13v3) | `` | -| [Purism Librem 5r4](purism/librem/5r4) | `` | -| [Radxa ROCK 4C+](radxa/rock-4c-plus) | `` | -| [Radxa ROCK 5 Model B](radxa/rock-5b) | `` | -| [Radxa ROCK Pi 4](radxa/rock-pi-4) | `` | -| [Radxa ROCK Pi E](radxa/rock-pi-e) | `` | -| [Raspberry Pi 2](raspberry-pi/2) | `` | -| [Raspberry Pi 3](raspberry-pi/3) | `` | -| [Raspberry Pi 4](raspberry-pi/4) | `` | -| [Raspberry Pi 5](raspberry-pi/5) | `` | -| [Samsung Series 9 NP900X3C](samsung/np900x3c) | `` | -| [Slimbook Hero RPL-RTX](slimbook/hero/rpl-rtx) | `` | -| [StarFive VisionFive v1](starfive/visionfive/v1) | `` | -| [StarFive VisionFive 2](starfive/visionfive/v2) | `` | -| [StarLabs StarLite 5 (I5)](starlabs/starlite/i5) | `` | -| [Supermicro A1SRi-2758F](supermicro/a1sri-2758f) | `` | -| [Supermicro M11SDV-8C-LN4F](supermicro/m11sdv-8c-ln4f) | `` | -| [Supermicro X10SLL-F](supermicro/x10sll-f) | `` | -| [Supermicro X12SCZ-TLN4F](supermicro/x12scz-tln4f) | `` | -| [System76 (generic)](system76) | `` | -| [System76 Darter Pro 6](system76/darp6) | `` | -| [System76 Gazelle 18](system76/gaze18) | `` | -| [System76 Galago Pro 5](system76/galp5-1650) | `` | -| [Toshiba Chromebook 2 `swanky`](toshiba/swanky) | `` | -| [Tuxedo InfinityBook v4](tuxedo/infinitybook/v4) | `` | -| [TUXEDO Aura 15 - Gen1](tuxedo/aura/15/gen1) | `` | -| [TUXEDO InfinityBook Pro 14 - Gen7](tuxedo/infinitybook/pro14/gen7) | `` | -| [TUXEDO InfinityBook Pro 14 - Gen9 - AMD](tuxedo/infinitybook/pro14/gen9/amd) | `` | -| [TUXEDO InfinityBook Pro 14 - Gen9 - INTEL](tuxedo/infinitybook/pro14/gen9/intel) | `` | -| [TUXEDO Pulse 14 - Gen3](tuxedo/pulse/14/gen3) | `` | -| [TUXEDO Pulse 15 - Gen2](tuxedo/pulse/15/gen2) | `` | -| [Xiaomi Redmibook 15 Pro 2021](xiaomi/redmibook/15-pro-2021) | `` | -| [Xiaomi Redmibook 16 Pro 2024](xiaomi/redmibook/16-pro-2024) | `` | +| Model | Path | Flake Module | +| --------------------------------------------------------------------------------- | ------------------------------------------------------- | ---------------------------------- | +| [Acer Aspire 4810T](acer/aspire/4810t) | `` | `acer-aspire-4810t` | +| [Airis N990](airis/n990) | `` | `airis-n990` | +| [Apple iMac 14.2](apple/imac/14-2) | `` | `apple-imac-14-2` | +| [Apple iMac 18.2](apple/imac/18-2) | `` | `apple-imac-18-2` | +| [Apple MacBook Air 3,X](apple/macbook-air/3) | `` | `apple-macbook-air-3` | +| [Apple MacBook Air 4,X](apple/macbook-air/4) | `` | `apple-macbook-air-4` | +| [Apple MacBook Air 6,X](apple/macbook-air/6) | `` | `apple-macbook-air-6` | +| [Apple MacBook Air 7,X](apple/macbook-air/7) | `` | `apple-macbook-air-7` | +| [Apple MacBook Pro 8,1](apple/macbook-pro/8-1) | `` | `apple-macbook-pro-8-1` | +| [Apple MacBook Pro 10,1](apple/macbook-pro/10-1) | `` | `apple-macbook-pro-10-1` | +| [Apple MacBook Pro 11,1](apple/macbook-pro/11-1) | `` | `apple-macbook-pro-11-1` | +| [Apple MacBook Pro 11,5](apple/macbook-pro/11-5) | `` | `apple-macbook-pro-11-5` | +| [Apple MacBook Pro 12,1](apple/macbook-pro/12-1) | `` | `apple-macbook-pro-12-1` | +| [Apple MacBook Pro 14,1](apple/macbook-pro/14-1) | `` | `apple-macbook-pro-14-1` | +| [Apple MacMini (2010, Intel, Nvidia)](apple/macmini/4) | `` | `apple-macmini-4-1` | +| [Apple Macs with a T2 Chip](apple/t2) | `` | `apple-t2` | +| [Aoostar R1 N100](aoostar/r1/n100) | `` | `aoostar-r1-n100` | +| [Asus Pro WS X570-ACE](asus/pro-ws-x570-ace) | `` | `asus-pro-ws-x570-ace` | +| [Asus ROG Ally RC71L (2023)](asus/ally/rc71l) | `` | `asus-ally-rc71l` | +| [Asus ROG Flow X13 GV302X\* (2023)](asus/flow/gv302x/amdgpu) | `` | `asus-flow-gv302x-amdgpu` | +| [Asus ROG Flow X13 GV302X\* (2023)](asus/flow/gv302x/nvidia) | `` | `asus-flow-gv302x-nvidia` | +| [Asus ROG Strix G513IM](asus/rog-strix/g513im) | `` | `asus-rog-strix-g513im` | +| [Asus ROG Strix G533ZW](asus/rog-strix/g533zw) | `` | `asus-rog-strix-g533zw` | +| [Asus ROG Strix G713IE](asus/rog-strix/g713ie) | `` | `asus-rog-strix-g713ie` | +| [Asus ROG Strix G733QS](asus/rog-strix/g733qs) | `` | `asus-rog-strix-g733qs` | +| [Asus ROG Strix X570-E GAMING](asus/rog-strix/x570e) | `` | `asus-rog-strix-x570e` | +| [Asus ROG Zephyrus G14 GA401](asus/zephyrus/ga401) | `` | `asus-zephyrus-ga401` | +| [Asus ROG Zephyrus G14 GA402](asus/zephyrus/ga402) | `` | `asus-zephyrus-ga402` | +| [Asus ROG Zephyrus G14 GA402X\* (2023)](asus/zephyrus/ga402x/amdgpu) | `` | `asus-zephyrus-ga402x-amdgpu` | +| [Asus ROG Zephyrus G14 GA402X\* (2023)](asus/zephyrus/ga402x/nvidia) | `` | `asus-zephyrus-ga402x-nvidia` | +| [Asus ROG Zephyrus G15 GA502](asus/zephyrus/ga502) | `` | `asus-zephyrus-ga502` | +| [Asus ROG Zephyrus G15 GA503](asus/zephyrus/ga503) | `` | `asus-zephyrus-ga503` | +| [Asus ROG Zephyrus G16 GU605MY](asus/zephyrus/gu605my) | `` | `asus-zephyrus-gu605my` | +| [Asus ROG Zephyrus M16 GU603H](asus/zephyrus/gu603h) | `` | `asus-zephyrus-gu603h` | +| [Asus TUF FX504GD](asus/fx504gd) | `` | `asus-fx504gd` | +| [Asus TUF FX506HM](asus/fx506hm) | `` | `asus-fx506hm` | +| [Asus TUF FA506IC](asus/fa506ic) | `` | `asus-fa506ic` | +| [Asus TUF FA507RM](asus/fa507rm) | `` | `asus-fa507rm` | +| [Asus TUF FA507NV](asus/fa507nv) | `` | `asus-fa507nv` | +| [Asus Zenbook Duo 14 UX481](asus/zenbook/ux481/intelgpu/) | `` | `asus-zenbook-ux481-intelgpu` | +| [Asus Zenbook Duo 14 UX481](asus/zenbook/ux481/nvidia/) | `` | `asus-zenbook-ux481-nvidia` | +| [Asus Zenbook Flip S13 UX371](asus/zenbook/ux371/) | `` | `asus-zenbook-ux371` | +| [Asus Zenbook Pro 15 UX535](asus/zenbook/ux535/) | `` | `asus-zenbook-ux535` | +| [BeagleBoard PocketBeagle](beagleboard/pocketbeagle) | `` | `beagleboard-pocketbeagle` | +| [Chuwi MiniBook X](chuwi/minibook-x) | `` | `chuwi-minibook-x` | +| [Deciso DEC series](deciso/dec) | `` | `deciso-dec` | +| [Dell G3 3779](dell/g3/3779) | `` | `dell-g3-3779` | +| [Dell G3 3579](dell/g3/3579) | `` | `dell-g3-3579` | +| [Dell Inspiron 3442](dell/inspiron/3442) | `` | `dell-inspiron-3442` | +| [Dell Inspiron 14 5420](dell/inspiron/14-5420) | `` | `dell-inspiron-14-5420` | +| [Dell Inspiron 5509](dell/inspiron/5509) | `` | `dell-inspiron-5509` | +| [Dell Inspiron 5515](dell/inspiron/5515) | `` | `dell-inspiron-5515` | +| [Dell Inspiron 7405](dell/inspiron/7405) | `` | `dell-inspiron-7405` | +| [Dell Inspiron 7460](dell/inspiron/7460) | `` | `dell-inspiron-7460` | +| [Dell Inspiron 7559](dell/inspiron/7559) | `` | `dell-inspiron-7559` | +| [Dell Latitude 3340](dell/latitude/3340) | `` | `dell-latitude-3340` | +| [Dell Latitude 3480](dell/latitude/3480) | `` | `dell-latitude-3480` | +| [Dell Latitude 5490](dell/latitude/5490) | `` | `dell-latitude-5490` | +| [Dell Latitude 5520](dell/latitude/5520) | `` | `dell-latitude-5520` | +| [Dell Latitude 7280](dell/latitude/7280) | `` | `dell-latitude-7280` | +| [Dell Latitude 7390](dell/latitude/7390) | `` | `dell-latitude-7390` | +| [Dell Latitude 7420](dell/latitude/7420) | `` | `dell-latitude-7420` | +| [Dell Latitude 7430](dell/latitude/7430) | `` | `dell-latitude-7430` | +| [Dell Latitude 7490](dell/latitude/7490) | `` | `dell-latitude-7490` | +| [Dell Latitude 9430](dell/latitude/9430) | `` | `dell-latitude-9430` | +| [Dell Latitude E7240](dell/latitude/e7240) | `` | `dell-latitude-e7240` | +| [Dell Optiplex 3050](dell/optiplex/3050) | `` | `dell-optiplex-3050` | +| [Dell Poweredge R7515](dell/poweredge/r7515) | `` | `dell-poweredge-r7515` | +| [Dell Precision 3490, nvidia](dell/precision/3490/nvidia) | `` | `dell-precision-3490-nvidia` | +| [Dell Precision 3490, intel](dell/precision/3490/intel) | `` | `dell-precision-3490-intel` | +| [Dell Precision 3541](dell/precision/3541) | `` | `dell-precision-3541` | +| [Dell Precision 5490](dell/precision/5490) | `` | `dell-precision-5490` | +| [Dell Precision 5530](dell/precision/5530) | `` | `dell-precision-5530` | +| [Dell Precision 7520](dell/precision/7520) | `` | `dell-precision-7520` | +| [Dell XPS 13 7390](dell/xps/13-7390) | `` | `dell-xps-13-7390` | +| [Dell XPS 13 9300](dell/xps/13-9300) | `` | `dell-xps-13-9300` | +| [Dell XPS 13 9310](dell/xps/13-9310) | `` | `dell-xps-13-9310` | +| [Dell XPS 13 9315](dell/xps/13-9315) | `` | `dell-xps-13-9315` | +| [Dell XPS 13 9333](dell/xps/13-9333) | `` | `dell-xps-13-9333` | +| [Dell XPS 13 9343](dell/xps/13-9343) | `` | `dell-xps-13-9343` | +| [Dell XPS 13 9350](dell/xps/13-9350) | `` | `dell-xps-13-9350` | +| [Dell XPS 13 9360](dell/xps/13-9360) | `` | `dell-xps-13-9360` | +| [Dell XPS 13 9370](dell/xps/13-9370) | `` | `dell-xps-13-9370` | +| [Dell XPS 13 9380](dell/xps/13-9380) | `` | `dell-xps-13-9380` | +| [Dell XPS 15 7590, nvidia](dell/xps/15-7590/nvidia) | `` | `dell-xps-15-7590-nvidia` | +| [Dell XPS 15 7590](dell/xps/15-7590) | `` | `dell-xps-15-7590` | +| [Dell XPS 15 9500, nvidia](dell/xps/15-9500/nvidia) | `` | `dell-xps-15-9500-nvidia` | +| [Dell XPS 15 9500](dell/xps/15-9500) | `` | `dell-xps-15-9500` | +| [Dell XPS 15 9510, nvidia](dell/xps/15-9510/nvidia) | `` | `dell-xps-15-9510-nvidia` | +| [Dell XPS 15 9510](dell/xps/15-9510) | `` | `dell-xps-15-9510` | +| [Dell XPS 15 9520, nvidia](dell/xps/15-9520/nvidia) | `` | `dell-xps-15-9520-nvidia` | +| [Dell XPS 15 9520](dell/xps/15-9520) | `` | `dell-xps-15-9520` | +| [Dell XPS 15 9530, nvidia](dell/xps/15-9530/nvidia) | `` | `dell-xps-15-9530-nvidia` | +| [Dell XPS 15 9530](dell/xps/15-9530) | `` | `dell-xps-15-9530` | +| [Dell XPS 15 9550, nvidia](dell/xps/15-9550/nvidia) | `` | `dell-xps-15-9550-nvidia` | +| [Dell XPS 15 9550](dell/xps/15-9550) | `` | `dell-xps-15-9550` | +| [Dell XPS 15 9560, intel only](dell/xps/15-9560/intel) | `` | `dell-xps-15-9560-intel` | +| [Dell XPS 15 9560, nvidia only](dell/xps/15-9560/nvidia) | `` | `dell-xps-15-9560-nvidia` | +| [Dell XPS 15 9560](dell/xps/15-9560) | `` | `dell-xps-15-9560` | +| [Dell XPS 15 9570, intel only](dell/xps/15-9570/intel) | `` | `dell-xps-15-9570-intel` | +| [Dell XPS 15 9570, nvidia](dell/xps/15-9570/nvidia) | `` | `dell-xps-15-9570-nvidia` | +| [Dell XPS 15 9570](dell/xps/15-9570) | `` | `dell-xps-15-9570` | +| [Dell XPS 17 9700, intel](dell/xps/17-9700/intel) | `` | `dell-xps-17-9700-nvidia` | +| [Dell XPS 17 9710, intel only](dell/xps/17-9710/intel) | `` | `dell-xps-17-9710-intel` | +| [Framework 11th Gen Intel Core](framework/13-inch/11th-gen-intel) | `` | `framework-11th-gen-intel` | +| [Framework 12th Gen Intel Core](framework/12-inch/13th-gen-intel) | `` | `framework-12th-gen-intel` | +| [Framework 13th Gen Intel Core](framework/13-inch/13th-gen-intel) | `` | `framework-13th-gen-intel` | +| [Framework Intel Core Ultra Series 1](framework/13-inch/intel-core-ultra-series1) | `` | `framework-intel-core-ultra-series1` | +| [Framework 13 AMD Ryzen 7040 Series](framework/13-inch/7040-amd) | `` | `framework-13-7040-amd` | +| [Framework 13 AMD AI 300 Series](framework/13-inch/amd-ai-300-series) | `` | `framework-amd-ai-300-series` | +| [Framework 12 13th Gen Intel Core](framework/12-inch/13th-gen-intel) | `` | `framework-12-13th-gen-intel` | +| [Framework 16 AMD Ryzen 7040 Series](framework/16-inch/7040-amd) | `` | `framework-16-7040-amd` | +| [FriendlyARM NanoPC-T4](friendlyarm/nanopc-t4) | `` | `friendlyarm-nanopc-t4` | +| [FriendlyARM NanoPi R5s](friendlyarm/nanopi-r5s) | `` | `friendlyarm-nanopi-r5s` | +| [Focus M2 Gen 1](focus/m2/gen1) | `` | `focus-m2-gen1` | +| [Gigabyte B550](gigabyte/b550) | `` | `gigabyte-b550` | +| [Gigabyte B650](gigabyte/b650) | `` | `gigabyte-b650` | +| [GMKtec NucBox G3 Plus](gmktec/nucbox/g3-plus) | `` | `gmktec-nucbox-g3-plus` | +| [GPD MicroPC](gpd/micropc) | `` | `gpd-micropc` | +| [GPD P2 Max](gpd/p2-max) | `` | `gpd-p2-max` | +| [GPD Pocket 3](gpd/pocket-3) | `` | `gpd-pocket-3` | +| [GPD Pocket 4](gpd/pocket-4) | `` | `gpd-pocket-4` | +| [GPD WIN 2](gpd/win-2) | `` | `gpd-win-2` | +| [GPD WIN Max 2 2023](gpd/win-max-2/2023) | `` | `gpd-win-max-2-2023` | +| [GPD WIN Mini 2024](gpd/win-mini/2024) | `` | `gpd-win-mini-2024` | +| [Google Pixelbook](google/pixelbook) | `` | `google-pixelbook` | +| [HP Elitebook 2560p](hp/elitebook/2560p) | `` | `hp-elitebook-2560p` | +| [HP Elitebook 830g6](hp/elitebook/830/g6) | `` | `hp-elitebook-830g6` | +| [HP Elitebook 845g7](hp/elitebook/845/g7) | `` | `hp-elitebook-845g7` | +| [HP Elitebook 845g8](hp/elitebook/845/g8) | `` | `hp-elitebook-845g8` | +| [HP Elitebook 845g9](hp/elitebook/845/g9) | `` | `hp-elitebook-845g9` | +| [HP Laptop 14s-dq2024nf](hp/laptop/14s-dq2024nf) | `` | `hp-laptop-14s-dq2024nf` | +| [HP Notebook 14-df0023](hp/notebook/14-df0023) | `` | `hp-notebook-14-df0023` | +| [HP Probook 440G5](hp/probook/440g5) | `` | `hp-probook-440G5` | +| [Huawei Matebook X Pro (2020)](huawei/machc-wa) | `` | `huawei-machc-wa` | +| [i.MX8QuadMax Multisensory Enablement Kit](nxp/imx8qm-mek/) | `` | `nxp-imx8qm-mek` | +| [Intel NUC 8i7BEH](intel/nuc/8i7beh/) | `` | `intel-nuc-8i7beh` | +| [Lenovo IdeaCentre K330](lenovo/ideacentre/k330) | `` | `lenovo-ideacentre-k330` | +| [Lenovo IdeaPad 3 15alc6](lenovo/ideapad/15alc6) | `` | `lenovo-ideapad-15alc6` | +| [Lenovo IdeaPad Gaming 3 15arh05](lenovo/ideapad/15arh05) | `` | `lenovo-ideapad-15arh05` | +| [Lenovo IdeaPad Gaming 3 15ach6](lenovo/ideapad/15ach6) | `` | `lenovo-ideapad-15ach6` | +| [Lenovo IdeaPad 5 Pro 14imh9](lenovo/ideapad/14imh9) | `` | `lenovo-ideapad-14imh9` | +| [Lenovo IdeaPad 5 Pro 16ach6](lenovo/ideapad/16ach6) | `` | `lenovo-ideapad-16ach6` | +| [Lenovo IdeaPad Z510](lenovo/ideapad/z510) | `` | `lenovo-ideapad-z510` | +| [Lenovo IdeaPad Slim 5](lenovo/ideapad/slim-5) | `` | `lenovo-ideapad-slim-5` | +| [Lenovo IdeaPad Slim 5 16iah8](lenovo/ideapad/16iah8) | `` | `lenovo-ideapad-16ahp9` | +| [Lenovo IdeaPad S145 15api](lenovo/ideapad/s145-15api) | `` | `lenovo-ideapad-s145-15api` | +| [Lenovo Legion 5 15ach6h](lenovo/legion/15ach6h) | `` | `lenovo-legion-15ach6h` | +| [Lenovo Legion 5 15arh05h](lenovo/legion/15arh05h) | `` | `lenovo-legion-15arh05h` | +| [Lenovo Legion 7 Slim 15ach6](lenovo/legion/15ach6) | `` | `lenovo-legion-15ach6` | +| [Lenovo Legion 5 Pro 16ach6h](lenovo/legion/16ach6h) | `` | `lenovo-legion-16ach6h` | +| [Lenovo Legion 5 Pro 16ach6h (Hybrid)](lenovo/legion/16ach6h/hybrid) | `` | `lenovo-legion-16ach6h-hybrid` | +| [Lenovo Legion 5 Pro 16ach6h (Nvidia)](lenovo/legion/16ach6h/nvidia) | `` | `lenovo-legion-16ach6h-nvidia` | +| [Lenovo Legion 5 Pro 16arh7h (IGPU Only)](lenovo/legion/16arh7h/igpu-only) | `` | `lenovo-legion-16arh7h-igpu-only` | +| [Lenovo Legion 5 Pro 16arh7h (Hybrid)](lenovo/legion/16arh7h/hybrid) | `` | `lenovo-legion-16arh7h-hybrid` | +| [Lenovo Legion 5 Pro 16IAH7H (Intel)](lenovo/legion/16iah7h/) | `` | `lenovo-legion-16iah7h` | +| [Lenovo Legion 7 16achg6 (Hybrid)](lenovo/legion/16achg6/hybrid) | `` | `lenovo-legion-16achg6-hybrid` | +| [Lenovo Legion 7 16achg6 (Nvidia)](lenovo/legion/16achg6/nvidia) | `` | `lenovo-legion-16achg6-nvidia` | +| [Lenovo Legion 7i Pro 16irx8h (Intel)](lenovo/legion/16irx8h) | `` | `lenovo-legion-16irx8h` | +| [Lenovo Legion 7 Pro 16irx9h (Intel)](lenovo/legion/16irx9h) | `` | `lenovo-legion-16irx9h` | +| [Lenovo Legion Slim 7 Gen 7 (AMD)](lenovo/legion/16arha7/) | `` | `lenovo-legion-16arha7` | +| [Lenovo Legion T5 AMR5](lenovo/legion/t526amr5) | `` | `lenovo-legion-t526amr5` | +| [Lenovo Legion Y530 15ICH](lenovo/legion/15ich) | `` | `lenovo-legion-15ich` | +| [Lenovo ThinkPad A475](lenovo/thinkpad/a475) | `` | `lenovo-thinkpad-a475` | +| [Lenovo ThinkPad E14 (AMD)](lenovo/thinkpad/e14/amd) | `` | `lenovo-thinkpad-e14-amd` | +| [Lenovo ThinkPad E14 (Intel - Gen 1)](lenovo/thinkpad/e14/intel) | `` | `lenovo-thinkpad-e14-intel` | +| [Lenovo ThinkPad E14 (Intel - Gen 4)](lenovo/thinkpad/e14/intel/gen4) | `` | `lenovo-thinkpad-e14-intel-gen4` | +| [Lenovo ThinkPad E14 (Intel - Gen 6)](lenovo/thinkpad/e14/intel/gen6) | `` | `lenovo-thinkpad-e14-intel-gen6` | +| [Lenovo ThinkPad E15 (Intel)](lenovo/thinkpad/e15/intel) | `` | `lenovo-thinkpad-e15-intel` | +| [Lenovo ThinkPad E470](lenovo/thinkpad/e470) | `` | `lenovo-thinkpad-e470` | +| [Lenovo ThinkPad E495](lenovo/thinkpad/e495) | `` | `lenovo-thinkpad-e495` | +| [Lenovo ThinkPad L13 Yoga](lenovo/thinkpad/l13/yoga) | `` | `lenovo-thinkpad-l13-yoga` | +| [Lenovo ThinkPad L13](lenovo/thinkpad/l13) | `` | `lenovo-thinkpad-l13` | +| [Lenovo ThinkPad L14 (AMD)](lenovo/thinkpad/l14/amd) | `` | `lenovo-thinkpad-l14-amd` | +| [Lenovo ThinkPad L14 (Intel)](lenovo/thinkpad/l14/intel) | `` | `lenovo-thinkpad-l14-intel` | +| [Lenovo ThinkPad L480](lenovo/thinkpad/l480) | `` | `lenovo-thinkpad-l480` | +| [Lenovo ThinkPad P1 Gen 3](lenovo/thinkpad/p1/3th-gen) | `` | `lenovo-thinkpad-p1-gen3` | +| [Lenovo ThinkPad P14s AMD Gen 1](lenovo/thinkpad/p14s/amd/gen1) | `` | `lenovo-thinkpad-p14s-amd-gen1` | +| [Lenovo ThinkPad P14s AMD Gen 2](lenovo/thinkpad/p14s/amd/gen2) | `` | `lenovo-thinkpad-p14s-amd-gen2` | +| [Lenovo ThinkPad P14s AMD Gen 3](lenovo/thinkpad/p14s/amd/gen3) | `` | `lenovo-thinkpad-p14s-amd-gen3` | +| [Lenovo ThinkPad P14s AMD Gen 4](lenovo/thinkpad/p14s/amd/gen4) | `` | `lenovo-thinkpad-p14s-amd-gen4` | +| [Lenovo ThinkPad P14s AMD Gen 5](lenovo/thinkpad/p14s/amd/gen5) | `` | `lenovo-thinkpad-p14s-amd-gen5` | +| [Lenovo ThinkPad P14s Intel Gen 3](lenovo/thinkpad/p14s/intel/gen3) | `` | `lenovo-thinkpad-p14s-intel-gen3`| +| [Lenovo ThinkPad P14s Intel Gen 5](lenovo/thinkpad/p14s/intel/gen5) | `` | `lenovo-thinkpad-p14s-intel-gen5`| +| [Lenovo ThinkPad P16s AMD Gen 1](lenovo/thinkpad/p16s/amd/gen1) | `` | `lenovo-thinkpad-p16s-amd-gen1` | +| [Lenovo ThinkPad P16s AMD Gen 2](lenovo/thinkpad/p16s/amd/gen2) | `` | `lenovo-thinkpad-p16s-amd-gen2` | +| [Lenovo ThinkPad P16s Intel Gen 2](lenovo/thinkpad/p16s/intel/gen2) | `` | `lenovo-thinkpad-p16s-intel-gen2`| +| [Lenovo ThinkPad P1](lenovo/thinkpad/p1) | `` | `lenovo-thinkpad-p1` | +| [Lenovo ThinkPad P43s](lenovo/thinkpad/p43s) | `` | `lenovo-thinkpad-p43s` | +| [Lenovo ThinkPad P50](lenovo/thinkpad/p50) | `` | `lenovo-thinkpad-p50` | +| [Lenovo ThinkPad P51](lenovo/thinkpad/p51) | `` | `lenovo-thinkpad-p51` | +| [Lenovo ThinkPad P52](lenovo/thinkpad/p52) | `` | `lenovo-thinkpad-p52` | +| [Lenovo ThinkPad P53](lenovo/thinkpad/p53) | `` | `lenovo-thinkpad-p53` | +| [Lenovo ThinkPad T14 AMD Gen 1](lenovo/thinkpad/t14/amd/gen1) | `` | `lenovo-thinkpad-t14-amd-gen1` | +| [Lenovo ThinkPad T14 AMD Gen 2](lenovo/thinkpad/t14/amd/gen2) | `` | `lenovo-thinkpad-t14-amd-gen2` | +| [Lenovo ThinkPad T14 AMD Gen 3](lenovo/thinkpad/t14/amd/gen3) | `` | `lenovo-thinkpad-t14-amd-gen3` | +| [Lenovo ThinkPad T14 AMD Gen 4](lenovo/thinkpad/t14/amd/gen4) | `` | `lenovo-thinkpad-t14-amd-gen4` | +| [Lenovo ThinkPad T14 AMD Gen 5](lenovo/thinkpad/t14/amd/gen5) | `` | `lenovo-thinkpad-t14-amd-gen5` | +| [Lenovo ThinkPad T14](lenovo/thinkpad/t14) | `` | `lenovo-thinkpad-t14` | +| [Lenovo ThinkPad T14s AMD Gen 1](lenovo/thinkpad/t14s/amd/gen1) | `` | `lenovo-thinkpad-t14s-amd-gen1` | +| [Lenovo ThinkPad T14s AMD Gen 4](lenovo/thinkpad/t14s/amd/gen4) | `` | `lenovo-thinkpad-t14s-amd-gen4` | +| [Lenovo ThinkPad T14s](lenovo/thinkpad/t14s) | `` | `lenovo-thinkpad-t14s` | +| [Lenovo ThinkPad T410](lenovo/thinkpad/t410) | `` | `lenovo-thinkpad-t410` | +| [Lenovo ThinkPad T420](lenovo/thinkpad/t420) | `` | `lenovo-thinkpad-t420` | +| [Lenovo ThinkPad T430](lenovo/thinkpad/t430) | `` | `lenovo-thinkpad-t430` | +| [Lenovo ThinkPad T440p](lenovo/thinkpad/t440p) | `` | `lenovo-thinkpad-t440p` | +| [Lenovo ThinkPad T440s](lenovo/thinkpad/t440s) | `` | `lenovo-thinkpad-t440s` | +| [Lenovo ThinkPad T450s](lenovo/thinkpad/t450s) | `` | `lenovo-thinkpad-t450s` | +| [Lenovo ThinkPad T460](lenovo/thinkpad/t460) | `` | `lenovo-thinkpad-t460` | +| [Lenovo ThinkPad T460p](lenovo/thinkpad/t460p) | `` | `lenovo-thinkpad-t460p` | +| [Lenovo ThinkPad T460s](lenovo/thinkpad/t460s) | `` | `lenovo-thinkpad-t460s` | +| [Lenovo ThinkPad T470s](lenovo/thinkpad/t470s) | `` | `lenovo-thinkpad-t470s` | +| [Lenovo ThinkPad T480](lenovo/thinkpad/t480) | `` | `lenovo-thinkpad-t480` | +| [Lenovo ThinkPad T480s](lenovo/thinkpad/t480s) | `` | `lenovo-thinkpad-t480s` | +| [Lenovo ThinkPad T490](lenovo/thinkpad/t490) | `` | `lenovo-thinkpad-t490` | +| [Lenovo ThinkPad T490s](lenovo/thinkpad/t490s) | `` | `lenovo-thinkpad-t490s` | +| [Lenovo ThinkPad T495](lenovo/thinkpad/t495) | `` | `lenovo-thinkpad-t495` | +| [Lenovo ThinkPad T520](lenovo/thinkpad/t520) | `` | `lenovo-thinkpad-t520` | +| [Lenovo ThinkPad T550](lenovo/thinkpad/t550) | `` | `lenovo-thinkpad-t550` | +| [Lenovo ThinkPad T590](lenovo/thinkpad/t590) | `` | `lenovo-thinkpad-t590` | +| [Lenovo ThinkPad W520](lenovo/thinkpad/w520) | `` | `lenovo-thinkpad-w520` | +| [Lenovo ThinkPad X1 Yoga](lenovo/thinkpad/x1/yoga) | `` | `lenovo-thinkpad-x1-yoga` | +| [Lenovo ThinkPad X1 Yoga Gen 7](lenovo/thinkpad/x1/yoga/7th-gen/) | `` | `lenovo-thinkpad-x1-yoga-7th-gen` | +| [Lenovo ThinkPad X1 Yoga Gen 8](lenovo/thinkpad/x1/yoga/8th-gen/) | `` | `lenovo-thinkpad-x1-yoga-8th-gen` | +| [Lenovo ThinkPad X1 (2nd Gen)](lenovo/thinkpad/x1/2nd-gen) | `` | `lenovo-thinkpad-x1-2nd-gen` | +| [Lenovo ThinkPad X1 (6th Gen)](lenovo/thinkpad/x1/6th-gen) | `` | `lenovo-thinkpad-x1-6th-gen` | +| [Lenovo ThinkPad X1 (7th Gen)](lenovo/thinkpad/x1/7th-gen) | `` | `lenovo-thinkpad-x1-7th-gen` | +| [Lenovo ThinkPad X1 (9th Gen)](lenovo/thinkpad/x1/9th-gen) | `` | `lenovo-thinkpad-x1-9th-gen` | +| [Lenovo ThinkPad X1 (10th Gen)](lenovo/thinkpad/x1/10th-gen) | `` | `lenovo-thinkpad-x1-10th-gen` | +| [Lenovo ThinkPad X1 (11th Gen)](lenovo/thinkpad/x1/11th-gen) | `` | `lenovo-thinkpad-x1-11th-gen` | +| [Lenovo ThinkPad X1 (12th Gen)](lenovo/thinkpad/x1/12th-gen) | `` | `lenovo-thinkpad-x1-12th-gen` | +| [Lenovo ThinkPad X1 (13th Gen)](lenovo/thinkpad/x1/13th-gen) | `` | `lenovo-thinkpad-x1-13th-gen` | +| [Lenovo ThinkPad X1 Extreme Gen 2](lenovo/thinkpad/x1-extreme/gen2) | `` | `lenovo-thinkpad-x1-extreme-gen2` | +| [Lenovo ThinkPad X1 Extreme Gen 3](lenovo/thinkpad/x1-extreme/gen3) | `` | `lenovo-thinkpad-x1-extreme-gen3` | +| [Lenovo ThinkPad X1 Extreme Gen 4](lenovo/thinkpad/x1-extreme/gen4) | `` | `lenovo-thinkpad-x1-extreme-gen4` | +| [Lenovo ThinkPad X1 Nano Gen 1](lenovo/thinkpad/x1-nano/gen1) | `` | `lenovo-thinkpad-x1-nano-gen1` | +| [Lenovo ThinkPad X13s](lenovo/thinkpad/x13s) | `` | `lenovo-thinkpad-x13s` | +| [Lenovo ThinkPad X13 Yoga](lenovo/thinkpad/x13/yoga) | `` | `lenovo-thinkpad-x13-yoga` | +| [Lenovo ThinkPad X13 Yoga (3th Gen)](lenovo/thinkpad/x13/yoga/3th-gen) | `` | `lenovo-thinkpad-x13-yoga-3th-gen` | +| [Lenovo ThinkPad X13 (Intel)](lenovo/thinkpad/x13/intel) | `` | `lenovo-thinkpad-x13-intel` | +| [Lenovo ThinkPad X13 (AMD)](lenovo/thinkpad/x13/amd) | `` | `lenovo-thinkpad-x13-amd` | +| [Lenovo ThinkPad X140e](lenovo/thinkpad/x140e) | `` | `lenovo-thinkpad-x140e` | +| [Lenovo ThinkPad X200s](lenovo/thinkpad/x200s) | `` | `lenovo-thinkpad-x200s` | +| [Lenovo ThinkPad X220](lenovo/thinkpad/x220) | `` | `lenovo-thinkpad-x220` | +| [Lenovo ThinkPad X230](lenovo/thinkpad/x230) | `` | `lenovo-thinkpad-x230` | +| [Lenovo ThinkPad X250](lenovo/thinkpad/x250) | `` | `lenovo-thinkpad-x250` | +| [Lenovo ThinkPad X260](lenovo/thinkpad/x260) | `` | `lenovo-thinkpad-x260` | +| [Lenovo ThinkPad X270](lenovo/thinkpad/x270) | `` | `lenovo-thinkpad-x270` | +| [Lenovo ThinkPad X280](lenovo/thinkpad/x280) | `` | `lenovo-thinkpad-x280` | +| [Lenovo ThinkPad X390](lenovo/thinkpad/x390) | `` | `lenovo-thinkpad-x390` | +| [Lenovo ThinkPad Z Series](lenovo/thinkpad/z) | `` | `lenovo-thinkpad-z` | +| [Lenovo ThinkPad Z13 Gen 1](lenovo/thinkpad/z/gen1/z13) | `` | `lenovo-thinkpad-z-gen1-z13` | +| [Lenovo ThinkPad Z13 Gen 2](lenovo/thinkpad/z/gen2/z13) | `` | `lenovo-thinkpad-z-gen2-z13` | +| [Lenovo XiaoXin Pro 14imh9 2024](lenovo/ideapad/14imh9) | `` | `lenovo-ideapad-14imh9` | +| [LENOVO Yoga 6 13ALC6 82ND](lenovo/yoga/6/13ALC6) | `` | `lenovo-yoga-6-13ALC6` | +| [LENOVO Yoga Slim 7 Pro-X 14ARH7 82ND](lenovo/yoga/7/14ARH7/amdgpu) | `` | `lenovo-yoga-7-14ARH7-amdgpu` | +| [LENOVO Yoga Slim 7 Pro-X 14ARH7 82ND](lenovo/yoga/7/14ARH7/nvidia) | `` | `lenovo-yoga-7-14ARH7-nvidia` | +| [Lenovo Yoga Slim 7i Pro X 14IAH7 (Integrated)](lenovo/yoga/7/14IAH7/integrated) | `` | `lenovo-yoga-7-14IAH7-integrated` | +| [Lenovo Yoga Slim 7i Pro X 14IAH7 (Hybrid)](lenovo/yoga/7/14IAH7/hybrid) | `` | `lenovo-yoga-7-14IAH7-hybrid` | +| [Lenovo Yoga Slim 7 14ILL10](lenovo/yoga/7/14ILL10) | `` | `lenovo-yoga-7-14ILL10` | +| [LENOVO Yoga 7 Slim Gen8](lenovo/yoga/7/slim/gen8) | `` | `lenovo-yoga-7-slim-gen8` | +| [MSI B550-A PRO](msi/b550-a-pro) | `` | `msi-b550-a-pro` | +| [MSI B350 TOMAHAWK](msi/b350-tomahawk) | `` | `msi-b350-tomahawk` | +| [MSI GS60 2QE](msi/gs60) | `` | `msi-gs60` | +| [MSI GL62/CX62](msi/gl62) | `` | `msi-gl62` | +| [MSI GL65 10SDR-492](msi/gl65/10SDR-492) | `` | `msi-gl65-10SDR-492` | +| [Microchip Icicle Kit](microchip/icicle-kit) | `` | `microchip-icicle-kit` | +| [Microsoft Surface Go](microsoft/surface/surface-go) | `` | `microsoft-surface-surface-go` | +| [Microsoft Surface Pro (Intel)](microsoft/surface/surface-pro-intel) | `` | `microsoft-surface-surface-pro-intel` | +| [Microsoft Surface Laptop (AMD)](microsoft/surface/surface-laptop-amd) | `` | `microsoft-surface-surface-laptop-amd` | +| [Microsoft Surface Range (Common Modules)](microsoft/surface/common) | `` | `microsoft-surface-common` | +| [Microsoft Surface Pro 3](microsoft/surface-pro/3) | `` | `microsoft-surface-pro-3` | +| [Microsoft Surface Pro 9](microsoft/surface-pro/9) | `` | `microsoft-surface-pro-9` | +| [Morefine M600](morefine/m600) | `` | `morefine-m600` | +| [Minisforum V3](minisforum/v3) | `` | `minisforum-v3` | +| [NXP iMX8 MPlus Evaluation Kit](nxp/imx8mp-evk) | `` | `nxp-imx8mp-evk` | +| [NXP iMX8 MQuad Evaluation Kit](nxp/imx8mq-evk) | `` | `nxp-imx8mq-evk` | +| [Hardkernel Odroid HC4](hardkernel/odroid-hc4/default.nix) | `` | `hardkernel-odroid-hc4` | +| [Hardkernel Odroid H3](hardkernel/odroid-h3/default.nix) | `` | `hardkernel-odroid-h3` | +| [Hardkernel Odroid H4](hardkernel/odroid-h4/default.nix) | `` | `hardkernel-odroid-h4` | +| [Omen 14-fb0798ng](omen/14-fb0798ng) | `` | `omen-14-fb0798ng` | +| [Omen 15-ce002ns](omen/15-ce002ns) | `` | `omen-15-ce002ns` | +| [Omen 15-en0010ca](omen/15-en0010ca) | `` | `omen-15-en0010ca` | +| [Omen 16-n0005ne](omen/16-n0005ne) | `` | `omen-16-n0005ne` | +| [Omen 16-n0280nd](/omen/16-n0280nd) | `` | `omen-16-n0280nd` | +| [Omen 15-en1007sa](omen/15-en1007sa) | `` | `omen-15-en1007sa` | +| [Omen 15-en0002np](omen/15-en0002np) | `` | `omen-15-en0002np` | +| [One-Netbook OneNetbook 4](onenetbook/4) | `` | `onenetbook-4` | +| [Panasonic Let's Note CF-LX4](panasonic/letsnote/cf-lx4) | `` | `panasonic-letsnote-cf-lx4` | +| [PC Engines APU](pcengines/apu) | `` | `pcengines-apu` | +| [PINE64 Pinebook Pro](pine64/pinebook-pro/) | `` | `pine64-pinebook-pro` | +| [PINE64 RockPro64](pine64/rockpro64/) | `` | `pine64-rockpro64` | +| [PINE64 STAR64](pine64/star64/) | `` | `pine64-star64` | +| [Protectli VP4670](protectli/vp4670/) | `` | `protectli-vp4670` | +| [Purism Librem 13v3](purism/librem/13v3) | `` | `purism-librem-13v3` | +| [Purism Librem 15v3](purism/librem/15v3) | `` | `purism-librem-15v3` | +| [Purism Librem 5r4](purism/librem/5r4) | `` | `purism-librem-5r4` | +| [Radxa ROCK 4C+](radxa/rock-4c-plus) | `` | `rock-4c-plus` | +| [Radxa ROCK 5 Model B](radxa/rock-5b) | `` | `rock-5b` | +| [Radxa ROCK Pi 4](radxa/rock-pi-4) | `` | `rock-pi-4` | +| [Radxa ROCK Pi E](radxa/rock-pi-e) | `` | `rock-pi-e`| +| [Raspberry Pi 2](raspberry-pi/2) | `` | `raspberry-pi-2`| +| [Raspberry Pi 3](raspberry-pi/3) | `` | `raspberry-pi-3`| +| [Raspberry Pi 4](raspberry-pi/4) | `` | `raspberry-pi-4`| +| [Raspberry Pi 5](raspberry-pi/5) | `` | `raspberry-pi-5`| +| [Samsung Series 9 NP900X3C](samsung/np900x3c) | `` | `samsung-np900x3c`| +| [Slimbook Hero RPL-RTX](slimbook/hero/rpl-rtx) | `` | `slimbook-hero-rpl-rtx`| +| [StarFive VisionFive v1](starfive/visionfive/v1) | `` | `starfive-visionfive-v1`| +| [StarFive VisionFive 2](starfive/visionfive/v2) | `` | `starfive-visionfive-2`| +| [StarLabs StarLite 5 (I5)](starlabs/starlite/i5) | `` | `starlabs-starlite-i5`| +| [Supermicro A1SRi-2758F](supermicro/a1sri-2758f) | `` | `supermicro-a1sri-2758f`| +| [Supermicro M11SDV-8C-LN4F](supermicro/m11sdv-8c-ln4f) | `` | `supermicro-m11sdv-8c-ln4f`| +| [Supermicro X10SLL-F](supermicro/x10sll-f) | `` | `supermicro-x10sll-f`| +| [Supermicro X12SCZ-TLN4F](supermicro/x12scz-tln4f) | `` | `supermicro-x12scz-tln4f`| +| [System76 (generic)](system76) | `` | `system76`| +| [System76 Darter Pro 6](system76/darp6) | `` | `system76-darp6`| +| [System76 Gazelle 18](system76/gaze18) | `` | `system76-gaze18`| +| [System76 Galago Pro 5](system76/galp5-1650) | `` | `system76-galp5-1650`| +| [Toshiba Chromebook 2 `swanky`](toshiba/swanky) | `` | `toshiba-swanky`| +| [Tuxedo InfinityBook v4](tuxedo/infinitybook/v4) | `` | `tuxedo-infinitybook-v4`| +| [TUXEDO Aura 15 - Gen1](tuxedo/aura/15/gen1) | `` | `tuxedo-aura-15-gen1`| +| [TUXEDO InfinityBook Pro 14 - Gen7](tuxedo/infinitybook/pro14/gen7) | `` | `tuxedo-infinitybook-pro14-gen7`| +| [TUXEDO InfinityBook Pro 14 - Gen9 - AMD](tuxedo/infinitybook/pro14/gen9/amd) | `` | `tuxedo-infinitybook-pro14-gen9-amd`| +| [TUXEDO InfinityBook Pro 14 - Gen9 - INTEL](tuxedo/infinitybook/pro14/gen9/intel) | `` | `tuxedo-infinitybook-pro14-gen9-intel`| +| [TUXEDO Pulse 14 - Gen3](tuxedo/pulse/14/gen3) | `` | `tuxedo-pulse-14-gen3`| +| [TUXEDO Pulse 15 - Gen2](tuxedo/pulse/15/gen2) | `` | `tuxedo-pulse-15-gen2`| +| [Xiaomi Redmibook 15 Pro 2021](xiaomi/redmibook/15-pro-2021) | `` | `xiaomi-redmibook-15-pro-2021`| +| [Xiaomi Redmibook 16 Pro 2024](xiaomi/redmibook/16-pro-2024) | `` | `xiaomi-redmibook-16-pro-2024`| diff --git a/flake.nix b/flake.nix index 389be153..fce2c783 100644 --- a/flake.nix +++ b/flake.nix @@ -167,6 +167,7 @@ lenovo-ideapad-16ahp9 = import ./lenovo/ideapad/16ahp9; lenovo-ideapad-z510 = import ./lenovo/ideapad/z510; lenovo-ideapad-slim-5 = import ./lenovo/ideapad/slim-5; + lenovo-ideapad-s5-16iah8 = import ./lenovo/ideapad/16iah8; lenovo-ideapad-s145-15api = import ./lenovo/ideapad/s145-15api; lenovo-legion-15ach6 = import ./lenovo/legion/15ach6; lenovo-legion-15ach6h = import ./lenovo/legion/15ach6h; From e9a0908c620cfd828f477ce815d691cbf4bf86cd Mon Sep 17 00:00:00 2001 From: AlexAntonik Date: Fri, 20 Jun 2025 01:21:04 +0300 Subject: [PATCH 118/134] flake.nix: add more distinct common modules import support --- flake.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/flake.nix b/flake.nix index fce2c783..1e668c8a 100644 --- a/flake.nix +++ b/flake.nix @@ -384,7 +384,15 @@ common-gpu-intel = import ./common/gpu/intel; common-gpu-intel-disable = import ./common/gpu/intel/disable.nix; common-gpu-nvidia = import ./common/gpu/nvidia/prime.nix; + common-gpu-nvidia-ada-lovelace = import ./common/gpu/nvidia/ada-lovelace; + common-gpu-nvidia-ampere = import ./common/gpu/nvidia/ampere; + common-gpu-nvidia-fermi = import ./common/gpu/nvidia/fermi; + common-gpu-nvidia-kepler = import ./common/gpu/nvidia/kepler; + common-gpu-nvidia-maxwell = import ./common/gpu/nvidia/maxwell; + common-gpu-nvidia-pascal = import ./common/gpu/nvidia/pascal; + common-gpu-nvidia-turing = import ./common/gpu/nvidia/turing; common-gpu-nvidia-sync = import ./common/gpu/nvidia/prime-sync.nix; + common-gpu-nvidia-prime = import ./common/gpu/nvidia/prime.nix; common-gpu-nvidia-nonprime = import ./common/gpu/nvidia; common-gpu-nvidia-disable = import ./common/gpu/nvidia/disable.nix; common-hidpi = import ./common/hidpi.nix; From 1552a9f4513f3f0ceedcf90320e48d3d47165712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 20 Jun 2025 16:35:38 +0200 Subject: [PATCH 119/134] add community meetings to CONTRIBUTING.md --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index dce01f4a..50b78d58 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,17 @@ See [CONTRIBUTING.md](./CONTRIBUTING.md). For questions and discussions, come join us in the [nixos-anywhere matrix](https://matrix.to/#/#nixos-hardware:nixos.org) room. +# Community Meetings + +The [NixOS hardware](https://nixos.org/community/teams/nix/) team meets regularly to discuss hardware profiles and maintenance: + +- **When**: Every 3rd Friday of the month +- **Time**: 04:00 pm (UTC) / 16:00 (UTC) +- **Where**: https://jitsi.lassul.us/Hardware-team +- **Contact**: hardware@nixos.org + +All contributors and users are welcome to join! + ## List of Profiles See code for all available configurations. From dcbb69f9bc071826aeb05e95014cb607b88f0c9b Mon Sep 17 00:00:00 2001 From: Andre Date: Sun, 22 Jun 2025 11:55:13 -0400 Subject: [PATCH 120/134] feat: update Surface stable kernel to 6.15.3 --- microsoft/surface/common/default.nix | 9 +++++---- .../surface/common/kernel/{6.14 => 6.15}/patches.nix | 0 microsoft/surface/common/kernel/linux-package.nix | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) rename microsoft/surface/common/kernel/{6.14 => 6.15}/patches.nix (100%) diff --git a/microsoft/surface/common/default.nix b/microsoft/surface/common/default.nix index 5d9d7d98..286383d8 100644 --- a/microsoft/surface/common/default.nix +++ b/microsoft/surface/common/default.nix @@ -8,7 +8,7 @@ let if kernelVersion == "longterm" then "6.12.19" else if kernelVersion == "stable" then - "6.14.2" + "6.15.3" else abort "Invalid kernel version: ${kernelVersion}"; @@ -16,7 +16,7 @@ let if kernelVersion == "longterm" then "sha256-1zvwV77ARDSxadG2FkGTb30Ml865I6KB8y413U3MZTE=" else if kernelVersion == "stable" then - "sha256-xcaCo1TqMZATk1elfTSnnlw3IhrOgjqTjhARa1d6Lhs=" + "sha256-ErUMiZJUONnNc4WgyvycQz5lYqxd8AohiJ/On1SNZbA=" else abort "Invalid kernel version: ${kernelVersion}"; @@ -25,7 +25,7 @@ let if kernelVersion == "longterm" then "6.12.7" else if kernelVersion == "stable" then - "6.14.2" + "6.15.3" else abort "Invalid kernel version: ${kernelVersion}"; @@ -33,7 +33,7 @@ let if kernelVersion == "longterm" then "sha256-Pv7O8D8ma+MPLhYP3HSGQki+Yczp8b7d63qMb6l4+mY=" else if kernelVersion == "stable" then - "sha256-Pzn+C52TtDcqDVepM5z2cVNCsnRDy0Wwn+FLwgsuicQ=" + "sha256-ozvYrZDiVtMkdCcVnNEdlF2Kdw4jivW0aMJrDynN3Hk=" else abort "Invalid kernel version: ${kernelVersion}"; @@ -52,6 +52,7 @@ let kernelPatches = surfacePatches { version = pkgVersion; patchFn = ./kernel/${versions.majorMinor pkgVersion}/patches.nix; + patchSrc = (repos.linux-surface + "/patches/${versions.majorMinor pkgVersion}"); }; kernelPackages = linuxPackage { inherit kernelPatches; version = srcVersion; diff --git a/microsoft/surface/common/kernel/6.14/patches.nix b/microsoft/surface/common/kernel/6.15/patches.nix similarity index 100% rename from microsoft/surface/common/kernel/6.14/patches.nix rename to microsoft/surface/common/kernel/6.15/patches.nix diff --git a/microsoft/surface/common/kernel/linux-package.nix b/microsoft/surface/common/kernel/linux-package.nix index 28e3e0e7..a44c4f24 100644 --- a/microsoft/surface/common/kernel/linux-package.nix +++ b/microsoft/surface/common/kernel/linux-package.nix @@ -29,7 +29,7 @@ let in linuxPackages'; surfacePatches = - { patchSrc ? (repos.linux-surface + "/patches/${versions.majorMinor version}"), + { patchSrc, version, patchFn, }: pkgs.callPackage patchFn { From 3a17771215396a208131f3217ef8fb48c395d06d Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Mon, 23 Jun 2025 01:51:09 +0200 Subject: [PATCH 121/134] README: fix team url --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 50b78d58..7f084e64 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ For questions and discussions, come join us in the [nixos-anywhere matrix](https # Community Meetings -The [NixOS hardware](https://nixos.org/community/teams/nix/) team meets regularly to discuss hardware profiles and maintenance: +The [NixOS hardware](https://github.com/orgs/NixOS/teams/nixos-hardware) team meets regularly to discuss hardware profiles and maintenance: - **When**: Every 3rd Friday of the month - **Time**: 04:00 pm (UTC) / 16:00 (UTC) From 42dedc05793c842ab7afbfd0cf5a8ee4007d7ea5 Mon Sep 17 00:00:00 2001 From: Cassie Cheung Date: Wed, 25 Jun 2025 17:43:58 +0800 Subject: [PATCH 122/134] apple/t2: kernel 6.14 -> 6.15; sync patches --- apple/t2/pkgs/linux-t2/latest.json | 54 ++++++++++++++++++------------ apple/t2/pkgs/linux-t2/latest.nix | 4 +-- apple/t2/pkgs/linux-t2/stable.json | 34 +++++++++++++------ 3 files changed, 58 insertions(+), 34 deletions(-) diff --git a/apple/t2/pkgs/linux-t2/latest.json b/apple/t2/pkgs/linux-t2/latest.json index d02a40eb..629d74d2 100644 --- a/apple/t2/pkgs/linux-t2/latest.json +++ b/apple/t2/pkgs/linux-t2/latest.json @@ -1,49 +1,61 @@ { - "base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/60a2912ad2d05f8a2d6c68a94641d912c3a555fd/", + "base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/8ec11f3aaa314d25e18842851a2124c0031e2e3f/", "patches": [ { "name": "1001-Add-apple-bce-driver.patch", - "hash": "sha256-e3RPvWPj2QASGOS4kieO8YFekrXsBCJtfF82OPlOn2E=" + "hash": "sha256-00K3LmId2Ag6s5K76p7mB2a0oEXp815yRd+U5wxWPMc=" }, { "name": "1002-Put-apple-bce-in-drivers-staging.patch", "hash": "sha256-wkveNo1qwAwXWDGTFed4ZDbuBnJbwKgWLmTHK9qq0oM=" }, { - "name": "1005-HID-hid-appletb-bl-add-driver-for-the-backlight-of-A.patch", - "hash": "sha256-kEscS1FAyDxLZPOPInYTXFEf4fouBEa4zGctX14hSu8=" + "name": "1003-Fix-sparse-errors.patch", + "hash": "sha256-nuCOPWa4Hp+HCCBe6Y++M4g1k4plOWzy2hqHXlJbp9g=" }, { - "name": "1006-HID-hid-appletb-kbd-add-driver-for-the-keyboard-mode.patch", - "hash": "sha256-eVEuvnoRItaDjwWu41nn9bTkgHgY+1SL/hFAvUR2IlY=" + "name": "1004-Fix-freezing-on-turning-off-camera.patch", + "hash": "sha256-rFrSUhiNXgQbfgKjryJktYxYcchXE1PI49Q1gW001+0=" }, { - "name": "1007-HID-multitouch-support-getting-the-contact-ID-from.patch", - "hash": "sha256-A4tExJafroVAv/Hbdt7farJM6RYl/DU5KwSbzqcdEVY=" + "name": "1007-HID-multitouch-Get-the-contact-ID-from-HID_DG_TRANSD.patch", + "hash": "sha256-JF5PjByo4S1Rd/B5luAzOXDv+iakCnJfmujIQuUiT1A=" }, { "name": "1008-HID-multitouch-support-getting-the-tip-state-from-HI.patch", - "hash": "sha256-GwK+d87p3UMy66037dzq6/Zearj8gnRHhqSdZczRadY=" + "hash": "sha256-m/NAKoHRC/HwxG5fFZxFl6DtY4Xv8kPBWvdKdtadrrk=" }, { "name": "1009-HID-multitouch-take-cls-maxcontacts-into-account-for.patch", - "hash": "sha256-fywzHnCQ657UFye1ckiufral3pBwBGtKdxWqWqaFHM0=" + "hash": "sha256-h6jk9yw/4txd8PATpMxB9mIzik9+X1zP6p4K35AqdXw=" }, { - "name": "1010-HID-multitouch-allow-specifying-if-a-device-is-direc.patch", - "hash": "sha256-87SOnLgeG60Svu2Z9QUyP9P6cZ1Gznt6ZYLFImfx+vY=" + "name": "1010-HID-multitouch-specify-that-Apple-Touch-Bar-is-direc.patch", + "hash": "sha256-5PbLynVnQqlJKPTWhcmwXCkYDEopLBQWnxWvZUt0EN4=" }, { - "name": "1011-HID-multitouch-add-device-ID-for-Apple-Touch-Bars.patch", - "hash": "sha256-TJjXAlQ4WEROnq/xd6/4JHTuEJjqT7dLLcE4etKdzc0=" + "name": "1011-HID-multitouch-add-device-ID-for-Apple-Touch-Bar.patch", + "hash": "sha256-dIzEOj89D2rIEc2/mjq3TkIfI3ZHzu0VRDQQOzp+Snc=" }, { - "name": "1014-drm-format-helper-Add-conversion-from-XRGB8888-to-BG.patch", - "hash": "sha256-Ky19+cCiYDaHBh2o5IhZO8J1ExDT7o8K9cgPz+AL8Cg=" + "name": "1013-lib-vsprintf-Add-support-for-generic-FourCCs-by-exte.patch", + "hash": "sha256-g8M3j1ZPND10/LtPD/txaSoJGV9Lp+g5bgn+vQc56p4=" }, { - "name": "1015-drm-tiny-add-driver-for-Apple-Touch-Bars-in-x86-Macs.patch", - "hash": "sha256-Ga0LlaS1jWTXSKh1ClcETPJctAymC6jYBQK9wwDU4Xs=" + "name": "1014-printf-add-tests-for-generic-FourCCs.patch", + "hash": "sha256-5Z4cFBMAY695OEU/CxiGQkUz68zmKdxssD+yp1DCYgs=" + }, + { + "name": "1015-drm-appletbdrm-use-p4cl-instead-of-p4cc.patch", + "hash": "sha256-rZej0ZbpPv+8NROuYnf4Jpu9scCsmbKWyz7yf5A3G3s=" + }, + { + "name": "1016-vsprintf-Use-p4chR-instead-of-p4cn-for-reading-data-.patch", + "hash": "sha256-/Ork2CmYk6SG213Owk+nGsw7KTEVDLRzQTeWcKrPZGw=" + }, + { + "name": "1017-checkpatch-remove-p4cn.patch", + "hash": "sha256-lnMnjnMiR9WSNf/XYsiOwFdC9xKv8zSluWiR584xFPU=" }, { "name": "2008-i915-4-lane-quirk-for-mbp15-1.patch", @@ -51,7 +63,7 @@ }, { "name": "2009-apple-gmux-allow-switching-to-igpu-at-probe.patch", - "hash": "sha256-XKwlyJZjJLQz39mc0/S7sPnRnwrqMsq9OKy+QCO+oho=" + "hash": "sha256-aE+MEu/jRrZBa+3Q03quOHUsIseRED6A7N/K9kEVtbM=" }, { "name": "3001-applesmc-convert-static-structures-to-drvdata.patch", @@ -91,7 +103,7 @@ }, { "name": "4001-asahi-trackpad.patch", - "hash": "sha256-yfkTKKokb/+JtTwE0Dzht14S0nrSIwLFAFND90P/Cis=" + "hash": "sha256-QM/FtDft4N4imJBuEHg6cH3e8vEyMPLt0alDhugLPy8=" }, { "name": "4002-HID-quirks-remove-T2-devices-from-hid_mouse_ignore_l.patch", @@ -119,7 +131,7 @@ }, { "name": "8001-Add-APFS-driver.patch", - "hash": "sha256-py4DNKBsUWvw6o730ApmNdUlSyabOFnFDoAPrF40DNE=" + "hash": "sha256-io17Kk6FDscDoDshddK9TqSPuXVFTzjvRUwOGTl5cjM=" }, { "name": "8002-Necessary-modifications-to-build-APFS-with-the-kerne.patch", diff --git a/apple/t2/pkgs/linux-t2/latest.nix b/apple/t2/pkgs/linux-t2/latest.nix index 70145fdb..747db71e 100644 --- a/apple/t2/pkgs/linux-t2/latest.nix +++ b/apple/t2/pkgs/linux-t2/latest.nix @@ -1,6 +1,6 @@ -{ callPackage, linux_6_14, ... }@args: +{ callPackage, linux_6_15, ... }@args: callPackage ./generic.nix args { - kernel = linux_6_14; + kernel = linux_6_15; patchesFile = ./latest.json; } diff --git a/apple/t2/pkgs/linux-t2/stable.json b/apple/t2/pkgs/linux-t2/stable.json index 3a788c72..325f42e4 100644 --- a/apple/t2/pkgs/linux-t2/stable.json +++ b/apple/t2/pkgs/linux-t2/stable.json @@ -1,5 +1,5 @@ { - "base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/0543a832ecf1400798e8aef6727110ec21c3484a/", + "base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/e08a76e1f1234885b9b68be6c843bf91833e8b0a/", "patches": [ { "name": "1001-Add-apple-bce-driver.patch", @@ -9,6 +9,14 @@ "name": "1002-Put-apple-bce-in-drivers-staging.patch", "hash": "sha256-DXj4CmE7TKMGrAhQDOR5RVw9YHmyQMiXZsmxYfkKAEA=" }, + { + "name": "1003-Fix-sparse-errors.patch", + "hash": "sha256-nuCOPWa4Hp+HCCBe6Y++M4g1k4plOWzy2hqHXlJbp9g=" + }, + { + "name": "1004-Fix-freezing-on-turning-off-camera.patch", + "hash": "sha256-rFrSUhiNXgQbfgKjryJktYxYcchXE1PI49Q1gW001+0=" + }, { "name": "1005-HID-hid-appletb-bl-add-driver-for-the-backlight-of-A.patch", "hash": "sha256-kEscS1FAyDxLZPOPInYTXFEf4fouBEa4zGctX14hSu8=" @@ -18,24 +26,28 @@ "hash": "sha256-eVEuvnoRItaDjwWu41nn9bTkgHgY+1SL/hFAvUR2IlY=" }, { - "name": "1007-HID-multitouch-support-getting-the-contact-ID-from.patch", - "hash": "sha256-A4tExJafroVAv/Hbdt7farJM6RYl/DU5KwSbzqcdEVY=" + "name": "1007-HID-multitouch-Get-the-contact-ID-from-HID_DG_TRANSD.patch", + "hash": "sha256-JF5PjByo4S1Rd/B5luAzOXDv+iakCnJfmujIQuUiT1A=" }, { "name": "1008-HID-multitouch-support-getting-the-tip-state-from-HI.patch", - "hash": "sha256-GwK+d87p3UMy66037dzq6/Zearj8gnRHhqSdZczRadY=" + "hash": "sha256-m/NAKoHRC/HwxG5fFZxFl6DtY4Xv8kPBWvdKdtadrrk=" }, { "name": "1009-HID-multitouch-take-cls-maxcontacts-into-account-for.patch", - "hash": "sha256-fywzHnCQ657UFye1ckiufral3pBwBGtKdxWqWqaFHM0=" + "hash": "sha256-h6jk9yw/4txd8PATpMxB9mIzik9+X1zP6p4K35AqdXw=" }, { - "name": "1010-HID-multitouch-allow-specifying-if-a-device-is-direc.patch", - "hash": "sha256-87SOnLgeG60Svu2Z9QUyP9P6cZ1Gznt6ZYLFImfx+vY=" + "name": "1010-HID-multitouch-specify-that-Apple-Touch-Bar-is-direc.patch", + "hash": "sha256-5PbLynVnQqlJKPTWhcmwXCkYDEopLBQWnxWvZUt0EN4=" }, { - "name": "1011-HID-multitouch-add-device-ID-for-Apple-Touch-Bars.patch", - "hash": "sha256-TJjXAlQ4WEROnq/xd6/4JHTuEJjqT7dLLcE4etKdzc0=" + "name": "1011-HID-multitouch-add-device-ID-for-Apple-Touch-Bar.patch", + "hash": "sha256-dIzEOj89D2rIEc2/mjq3TkIfI3ZHzu0VRDQQOzp+Snc=" + }, + { + "name": "1013-lib-vsprintf-Add-support-for-generic-FourCCs-by-exte.patch", + "hash": "sha256-h3gxaKtvdm/GSd+AP1sPC9avWHOsceUxTmoua/3rIf4=" }, { "name": "1014-drm-format-helper-Add-conversion-from-XRGB8888-to-BG.patch", @@ -43,7 +55,7 @@ }, { "name": "1015-drm-tiny-add-driver-for-Apple-Touch-Bars-in-x86-Macs.patch", - "hash": "sha256-zFeDJeoM/XS+Ds3DBLEcv4JbUhlEk9z4rHQ4t6XaghA=" + "hash": "sha256-tDjK/VipVQbuNOURW38gssqeRLy3s8I+DVq0+4zGnHs=" }, { "name": "2008-i915-4-lane-quirk-for-mbp15-1.patch", @@ -119,7 +131,7 @@ }, { "name": "8001-Add-APFS-driver.patch", - "hash": "sha256-1VHKrO2haBqXDCef2xt2fHfCCPv2q/AhFmmM4Xxu24E=" + "hash": "sha256-O3RNtpeZQENPEfyYi/0ZTLhAWBAw6pmxMS30NUxOTdk=" }, { "name": "8002-Necessary-modifications-to-build-APFS-with-the-kerne.patch", From d4b603125e98ce2da1340e0a67bc430d7384b344 Mon Sep 17 00:00:00 2001 From: QuietSeeker <123584613+QuietSeeker@users.noreply.github.com> Date: Thu, 26 Jun 2025 19:49:43 +0100 Subject: [PATCH 123/134] Updated nvidia offload mode to include amd drivers --- lenovo/legion/16arh7h/hybrid/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lenovo/legion/16arh7h/hybrid/default.nix b/lenovo/legion/16arh7h/hybrid/default.nix index 1654e23c..9d47b58a 100644 --- a/lenovo/legion/16arh7h/hybrid/default.nix +++ b/lenovo/legion/16arh7h/hybrid/default.nix @@ -13,7 +13,7 @@ ]; boot.kernelModules = ["amdgpu"]; - services.xserver.videoDrivers = ["nvidia"]; + services.xserver.videoDrivers = ["amdgpu" "nvidia"]; hardware = { amdgpu.initrd.enable = false; From 9ac3df2a020ea6c6efb9f30c42aa2a031a5e9241 Mon Sep 17 00:00:00 2001 From: Andre Date: Tue, 1 Jul 2025 11:26:23 -0400 Subject: [PATCH 124/134] Remove GitHub action --- .github/workflows/test.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7200246e..2efb8acc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,12 +5,6 @@ on: branches: - master jobs: - nixfmt: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v31 - - run: nix fmt . tests: needs: nixfmt runs-on: ubuntu-latest From c3f13f261032b6c393bd4fc2c25990783937b4d9 Mon Sep 17 00:00:00 2001 From: Andre Date: Tue, 1 Jul 2025 11:30:09 -0400 Subject: [PATCH 125/134] Remove GitHub action requirement --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2efb8acc..1a7c3f7e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,6 @@ on: - master jobs: tests: - needs: nixfmt runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From fe49c326d572e4a92f8d2aa6f5f0c6b39245cd37 Mon Sep 17 00:00:00 2001 From: Andre Date: Tue, 1 Jul 2025 11:35:17 -0400 Subject: [PATCH 126/134] chore: add formatting job to GitHub Actions --- .github/workflows/test.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1a7c3f7e..8d75b139 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,9 +5,16 @@ on: branches: - master jobs: - tests: + nixfmt: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: cachix/install-nix-action@v31 - - run: nix run ./tests#run . + - run: nix fmt . + tests: + needs: nixfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v31 + - run: nix run ./tests#run . \ No newline at end of file From a7600cef40e350c6f3fcb6eefb6f0d6b09c7d05e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 1 Jul 2025 19:13:17 +0200 Subject: [PATCH 127/134] move treefmt to tests flake this way we don't polute our consumers flake.lock with treefmt --- .github/workflows/test.yml | 2 +- flake.lock | 43 ++++---------------------------------- flake.nix | 27 +----------------------- tests/flake.lock | 23 +++++++++++++++++++- tests/flake.nix | 23 ++++++++++++++++++++ treefmt.nix | 19 ----------------- 6 files changed, 51 insertions(+), 86 deletions(-) delete mode 100644 treefmt.nix diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8d75b139..e34c7e7c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: steps: - uses: actions/checkout@v4 - uses: cachix/install-nix-action@v31 - - run: nix fmt . + - run: cd tests && nix fmt .. -- --fail-on-change tests: needs: nixfmt runs-on: ubuntu-latest diff --git a/flake.lock b/flake.lock index 0477b1ca..8f2f2e35 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1748995760, - "narHash": "sha256-f6UIyqm6JZs45pG667YdHOFYgDt+gvxQvt32ZLBp1h4=", + "lastModified": 1751290770, + "narHash": "sha256-u4s8yKAqTzPGY3vTcDyAIet11uXaNCM//93/0O0NlbA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "26a54a5886c238b5df6f1e9ba0aa713434d73f06", + "rev": "0620a50e9a847851bf802c59a4202552ed79b821", "type": "github" }, "original": { @@ -16,44 +16,9 @@ "type": "github" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1747958103, - "narHash": "sha256-qmmFCrfBwSHoWw7cVK4Aj+fns+c54EBP8cGqp/yK410=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "fe51d34885f7b5e3e7b59572796e1bcb427eccb1", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "root": { "inputs": { - "nixpkgs": "nixpkgs", - "treefmt-nix": "treefmt-nix" - } - }, - "treefmt-nix": { - "inputs": { - "nixpkgs": "nixpkgs_2" - }, - "locked": { - "lastModified": 1748243702, - "narHash": "sha256-9YzfeN8CB6SzNPyPm2XjRRqSixDopTapaRsnTpXUEY8=", - "owner": "numtide", - "repo": "treefmt-nix", - "rev": "1f3f7b784643d488ba4bf315638b2b0a4c5fb007", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "treefmt-nix", - "type": "github" + "nixpkgs": "nixpkgs" } } }, diff --git a/flake.nix b/flake.nix index aed8651d..c5d599bb 100644 --- a/flake.nix +++ b/flake.nix @@ -1,34 +1,9 @@ { description = "nixos-hardware"; - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05-small"; - treefmt-nix.url = "github:numtide/treefmt-nix"; - }; - outputs = + { ... }: { - nixpkgs, - self, - treefmt-nix, - }: - let - systems = [ - "aarch64-darwin" - "aarch64-linux" - "x86_64-darwin" - "x86_64-linux" - ]; - forEachSystem = - function: nixpkgs.lib.genAttrs (systems) (system: function nixpkgs.legacyPackages.${system}); - - treefmtEval = forEachSystem (pkgs: treefmt-nix.lib.evalModule pkgs ./treefmt.nix); - in - { - checks = forEachSystem (pkgs: { - formatting = treefmtEval.${pkgs.system}.config.build.check self; - }); - formatter = forEachSystem (pkgs: treefmtEval.${pkgs.system}.config.build.wrapper); nixosModules = let diff --git a/tests/flake.lock b/tests/flake.lock index ba2dc9ab..bc9dc885 100644 --- a/tests/flake.lock +++ b/tests/flake.lock @@ -74,7 +74,28 @@ "flake-parts": "flake-parts", "nixos-hardware": "nixos-hardware", "nixos-stable": "nixos-stable", - "nixos-unstable-small": "nixos-unstable-small" + "nixos-unstable-small": "nixos-unstable-small", + "treefmt-nix": "treefmt-nix" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixos-unstable-small" + ] + }, + "locked": { + "lastModified": 1750931469, + "narHash": "sha256-0IEdQB1nS+uViQw4k3VGUXntjkDp7aAlqcxdewb/hAc=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "ac8e6f32e11e9c7f153823abc3ab007f2a65d3e1", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" } } }, diff --git a/tests/flake.nix b/tests/flake.nix index bf20ed3a..aa493971 100644 --- a/tests/flake.nix +++ b/tests/flake.nix @@ -8,11 +8,16 @@ nixos-hardware.url = "github:NixOS/nixos-hardware"; flake-parts.url = "github:hercules-ci/flake-parts"; flake-parts.inputs.nixpkgs-lib.follows = "nixos-unstable-small"; + treefmt-nix.url = "github:numtide/treefmt-nix"; + treefmt-nix.inputs.nixpkgs.follows = "nixos-unstable-small"; }; outputs = inputs@{ flake-parts, ... }: flake-parts.lib.mkFlake { inherit inputs; } { + imports = [ + inputs.treefmt-nix.flakeModule + ]; systems = [ "aarch64-linux" "x86_64-linux" @@ -85,6 +90,24 @@ in { _module.args.pkgs = nixpkgsUnstable; + + treefmt = { + projectRootFile = "COPYING"; + programs = { + deadnix = { + enable = true; + no-lambda-pattern-names = true; + }; + nixfmt = { + enable = true; + package = pkgs.nixfmt-rfc-style; + }; + }; + settings = { + on-unmatched = "info"; + }; + }; + checks = checksForNixpkgs "nixos-unstable" nixpkgsUnstable // checksForNixpkgs "nixos-stable" nixpkgsStable; diff --git a/treefmt.nix b/treefmt.nix deleted file mode 100644 index 7039d8b5..00000000 --- a/treefmt.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ pkgs, ... }: -{ - projectRootFile = "flake.nix"; - - programs = { - deadnix = { - enable = true; - no-lambda-pattern-names = true; - }; - nixfmt = { - enable = true; - package = pkgs.nixfmt-rfc-style; - }; - }; - - settings = { - on-unmatched = "info"; - }; -} From b2c7dee5c6aa93cf1029bbe38e32d4799042cc9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 1 Jul 2025 19:19:15 +0200 Subject: [PATCH 128/134] ci: support for merge queues --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e34c7e7c..4f58d888 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,6 +4,7 @@ on: push: branches: - master + merge_group: jobs: nixfmt: runs-on: ubuntu-latest From bd65595c6d689c407d7f15f3b5a8f681c91101b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 1 Jul 2025 19:27:33 +0200 Subject: [PATCH 129/134] Add .git-blame-ignore-revs file for auto-rebasing --- .git-blame-ignore-revs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .git-blame-ignore-revs diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 00000000..4c9bbd01 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,12 @@ +# This file contains commits that should be ignored by git blame +# See https://git-scm.com/docs/git-blame#Documentation/git-blame.txt---ignore-revs-file +# and https://github.com/NixOS/nixpkgs/blob/master/.git-blame-ignore-revs for more info + +# To enable this in your local repository, run: +# git config blame.ignoreRevsFile .git-blame-ignore-revs + +# For rebasing PRs, commits marked with !autorebase will be automatically +# reapplied by the auto-rebase script + +# nixfmt-rfc-style formatting +51e51e601448705c0d2f92ef90ec7b680123077c #!autorebase cd tests && nix fmt .. \ No newline at end of file From 1ead2d05dd46c21b721a28ae1ce963849e1f3423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 1 Jul 2025 19:30:42 +0200 Subject: [PATCH 130/134] bump nixos-stable/nixos-unstable --- tests/flake.lock | 10 +++++----- tests/flake.nix | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/flake.lock b/tests/flake.lock index bc9dc885..4363c6d1 100644 --- a/tests/flake.lock +++ b/tests/flake.lock @@ -37,16 +37,16 @@ }, "nixos-stable": { "locked": { - "lastModified": 1746957726, - "narHash": "sha256-k9ut1LSfHCr0AW82ttEQzXVCqmyWVA5+SHJkS5ID/Jo=", - "ref": "nixos-24.11", - "rev": "a39ed32a651fdee6842ec930761e31d1f242cb94", + "lastModified": 1751211869, + "narHash": "sha256-1Cu92i1KSPbhPCKxoiVG5qnoRiKTgR5CcGSRyLpOd7Y=", + "ref": "nixos-25.05", + "rev": "b43c397f6c213918d6cfe6e3550abfe79b5d1c51", "shallow": true, "type": "git", "url": "https://github.com/NixOS/nixpkgs" }, "original": { - "ref": "nixos-24.11", + "ref": "nixos-25.05", "shallow": true, "type": "git", "url": "https://github.com/NixOS/nixpkgs" diff --git a/tests/flake.nix b/tests/flake.nix index aa493971..9e5aa0ed 100644 --- a/tests/flake.nix +++ b/tests/flake.nix @@ -3,7 +3,7 @@ inputs = { nixos-unstable-small.url = "git+https://github.com/NixOS/nixpkgs?shallow=1&ref=nixos-unstable-small"; - nixos-stable.url = "git+https://github.com/NixOS/nixpkgs?shallow=1&ref=nixos-24.11"; + nixos-stable.url = "git+https://github.com/NixOS/nixpkgs?shallow=1&ref=nixos-25.05"; # override in the test nixos-hardware.url = "github:NixOS/nixos-hardware"; flake-parts.url = "github:hercules-ci/flake-parts"; From 72cdb2246305abf2bd3cbc88d2c72ea6040fcef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 1 Jul 2025 19:31:14 +0200 Subject: [PATCH 131/134] add script to update nar hashes in tests --- scripts/update-tests-hash | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 scripts/update-tests-hash diff --git a/scripts/update-tests-hash b/scripts/update-tests-hash new file mode 100755 index 00000000..f2508b9a --- /dev/null +++ b/scripts/update-tests-hash @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# Helper script to update the tests flake hash +set -euo pipefail + +# Go to the root of the repository +cd "$(dirname "$0")/.." + +echo "Updating tests.narHash..." >&2 + +# Update the flake lock file +nix --extra-experimental-features 'flakes nix-command' flake lock ./tests + +# Generate the hash +nix --extra-experimental-features 'flakes nix-command' hash path ./tests > ./tests.narHash + +echo "Hash updated successfully: $(cat tests.narHash)" \ No newline at end of file From e8bd6a44ac0d6041996531b96ed190d0de9f8598 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 1 Jul 2025 20:02:30 +0200 Subject: [PATCH 132/134] disable treefmt on riscv64 --- tests/flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/flake.nix b/tests/flake.nix index 9e5aa0ed..443bfbd7 100644 --- a/tests/flake.nix +++ b/tests/flake.nix @@ -92,6 +92,7 @@ _module.args.pkgs = nixpkgsUnstable; treefmt = { + flakeCheck = pkgs.hostPlatform.system != "riscv64-linux"; projectRootFile = "COPYING"; programs = { deadnix = { From a724614b86a2a67f7dbb3873942dcd0561106102 Mon Sep 17 00:00:00 2001 From: Rishabh <40533251+Rishabh5321@users.noreply.github.com> Date: Wed, 2 Jul 2025 07:52:52 +0530 Subject: [PATCH 133/134] xiaomi/redmibook/15-pro-2021: fix flake.nix --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index c5d599bb..0a0a749d 100644 --- a/flake.nix +++ b/flake.nix @@ -355,6 +355,7 @@ tuxedo-infinitybook-pro14-gen9-intel = import ./tuxedo/infinitybook/pro14/gen9/intel; tuxedo-pulse-14-gen3 = import ./tuxedo/pulse/14/gen3; tuxedo-pulse-15-gen2 = import ./tuxedo/pulse/15/gen2; + xiaomi-redmibook-15-pro-2021 = import ./xiaomi/redmibook/15-pro-2021; xiaomi-redmibook-16-pro-2024 = import ./xiaomi/redmibook/16-pro-2024; common-cpu-amd = import ./common/cpu/amd; From 3b622ae6e613bf0b59bd142394ee86ed62cd2a60 Mon Sep 17 00:00:00 2001 From: Tristan Ross Date: Wed, 25 Jun 2025 21:22:07 -0700 Subject: [PATCH 134/134] Add System76 Thelio Mega module --- README.md | 1 + flake.nix | 1 + system76/thelio-mega/default.nix | 16 ++++++++++++++++ 3 files changed, 18 insertions(+) create mode 100644 system76/thelio-mega/default.nix diff --git a/README.md b/README.md index 7f084e64..a064978f 100644 --- a/README.md +++ b/README.md @@ -406,6 +406,7 @@ See code for all available configurations. | [System76 Darter Pro 6](system76/darp6) | `` | `system76-darp6`| | [System76 Gazelle 18](system76/gaze18) | `` | `system76-gaze18`| | [System76 Galago Pro 5](system76/galp5-1650) | `` | `system76-galp5-1650`| +| [System76 Thelio Mega](system76/thelio-mega) | `` | `system76-thelio-mega`| | [Toshiba Chromebook 2 `swanky`](toshiba/swanky) | `` | `toshiba-swanky`| | [Tuxedo InfinityBook v4](tuxedo/infinitybook/v4) | `` | `tuxedo-infinitybook-v4`| | [TUXEDO Aura 15 - Gen1](tuxedo/aura/15/gen1) | `` | `tuxedo-aura-15-gen1`| diff --git a/flake.nix b/flake.nix index c5d599bb..18867756 100644 --- a/flake.nix +++ b/flake.nix @@ -348,6 +348,7 @@ system76-gaze18 = import ./system76/gaze18; system76-galp5-1650 = import ./system76/galp5-1650; system76-darp6 = import ./system76/darp6; + system76-thelio-mega = import ./system76/thelio-mega; toshiba-swanky = import ./toshiba/swanky; tuxedo-aura-15-gen1 = import ./tuxedo/aura/15/gen1; tuxedo-infinitybook-v4 = import ./tuxedo/infinitybook/v4; diff --git a/system76/thelio-mega/default.nix b/system76/thelio-mega/default.nix new file mode 100644 index 00000000..b88f1366 --- /dev/null +++ b/system76/thelio-mega/default.nix @@ -0,0 +1,16 @@ +# Hardware profile for the Thelio Mega desktop workstation by System76. +# +# https://system76.com/desktops/thelio-mega-r4-n3/configure +{ + config, + lib, + ... +}: +{ + imports = [ + ../../common/cpu/amd + ../../common/gpu/nvidia + ]; + + hardware.nvidia.open = true; +}