From da7e364c3dd71cda04828ddad511f0f60c905fa5 Mon Sep 17 00:00:00 2001 From: Kevin J Hoerr Date: Fri, 10 Nov 2023 15:26:56 -0500 Subject: [PATCH 01/11] Reorganize current framework modules into 13-inch directory --- README.md | 6 +-- flake.nix | 5 +- framework/13-inch/11th-gen-intel/README.md | 17 ++++++ framework/13-inch/11th-gen-intel/default.nix | 10 ++++ .../{ => 13-inch}/12th-gen-intel/README.md | 2 +- .../{ => 13-inch}/12th-gen-intel/default.nix | 38 +------------ .../{ => 13-inch}/13th-gen-intel/README.md | 2 +- .../{ => 13-inch}/13th-gen-intel/default.nix | 2 +- framework/13-inch/7040-amd/default.nix | 23 +------- framework/13-inch/default.nix | 32 +++++++++++ framework/13-inch/intel.nix | 30 +++++++++++ framework/README.md | 2 +- framework/default.nix | 54 ++----------------- 13 files changed, 106 insertions(+), 117 deletions(-) create mode 100644 framework/13-inch/11th-gen-intel/README.md create mode 100644 framework/13-inch/11th-gen-intel/default.nix rename framework/{ => 13-inch}/12th-gen-intel/README.md (91%) rename framework/{ => 13-inch}/12th-gen-intel/default.nix (53%) rename framework/{ => 13-inch}/13th-gen-intel/README.md (86%) rename framework/{ => 13-inch}/13th-gen-intel/default.nix (88%) create mode 100644 framework/13-inch/default.nix create mode 100644 framework/13-inch/intel.nix diff --git a/README.md b/README.md index a987196..70ba060 100644 --- a/README.md +++ b/README.md @@ -131,9 +131,9 @@ See code for all available configurations. | [Dell XPS 17 9700, nvidia](dell/xps/17-9700/nvidia) | `` | | [Dell XPS 17 9710, intel only](dell/xps/17-9710/intel) | `` | | [Dell XPS E7240](dell/e7240) | `` | -| [Framework 11th Gen Intel Core](framework) | `` | -| [Framework 12th Gen Intel Core](framework/12th-gen-intel) | `` | -| [Framework 13th Gen Intel Core](framework/13th-gen-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 13 AMD Ryzen 7040 Series](framework/13-inch/7040-amd) | `` | | [FriendlyARM NanoPC-T4](friendlyarm/nanopc-t4) | `` | | [FriendlyARM NanoPi R5s](friendlyarm/nanopi-r5s) | `` | diff --git a/flake.nix b/flake.nix index eb40bb4..051974e 100644 --- a/flake.nix +++ b/flake.nix @@ -66,8 +66,9 @@ 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-12th-gen-intel = import ./framework/12th-gen-intel; - framework-13th-gen-intel = import ./framework/13th-gen-intel; + 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-13-7040-amd = import ./framework/13-inch/7040-amd; friendlyarm-nanopc-t4 = import ./friendlyarm/nanopc-t4; friendlyarm-nanopi-r5s = import ./friendlyarm/nanopi-r5s; diff --git a/framework/13-inch/11th-gen-intel/README.md b/framework/13-inch/11th-gen-intel/README.md new file mode 100644 index 0000000..b1cc561 --- /dev/null +++ b/framework/13-inch/11th-gen-intel/README.md @@ -0,0 +1,17 @@ +# [Framework Laptop 13](https://frame.work/) + +## 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.Laptop.TGL.BIOS.firmware) diff --git a/framework/13-inch/11th-gen-intel/default.nix b/framework/13-inch/11th-gen-intel/default.nix new file mode 100644 index 0000000..22e14fd --- /dev/null +++ b/framework/13-inch/11th-gen-intel/default.nix @@ -0,0 +1,10 @@ +{ lib, pkgs, ...}: { + imports = [ + ../. + ../intel.nix + ]; + + # 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); +} diff --git a/framework/12th-gen-intel/README.md b/framework/13-inch/12th-gen-intel/README.md similarity index 91% rename from framework/12th-gen-intel/README.md rename to framework/13-inch/12th-gen-intel/README.md index 104566f..ca6122e 100644 --- a/framework/12th-gen-intel/README.md +++ b/framework/13-inch/12th-gen-intel/README.md @@ -11,7 +11,7 @@ services.fwupd.enable = true; Then run ```sh - $ sudo fwupdmgr update + $ fwupdmgr update ``` - [Latest Update](https://fwupd.org/lvfs/devices/work.frame.Laptop.ADL.BIOS.firmware) diff --git a/framework/12th-gen-intel/default.nix b/framework/13-inch/12th-gen-intel/default.nix similarity index 53% rename from framework/12th-gen-intel/default.nix rename to framework/13-inch/12th-gen-intel/default.nix index b07d2d5..345daf2 100644 --- a/framework/12th-gen-intel/default.nix +++ b/framework/13-inch/12th-gen-intel/default.nix @@ -1,17 +1,13 @@ { lib, pkgs, ... }: { imports = [ - ../../common/cpu/intel - ../../common/pc/laptop - ../../common/pc/laptop/ssd + ../. + ../intel.nix ]; boot.kernelParams = [ # For Power consumption # https://kvark.github.io/linux/framework/2021/10/17/framework-nixos.html "mem_sleep_default=deep" - # For Power consumption - # https://community.frame.work/t/linux-battery-life-tuning/6665/156 - "nvme.noacpi=1" # Workaround iGPU hangs # https://discourse.nixos.org/t/intel-12th-gen-igpu-freezes/21768/4 "i915.enable_psr=1" @@ -48,34 +44,4 @@ # https://www.tomshardware.com/news/intel-thread-director-coming-to-linux-5-18 boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.18") (lib.mkDefault pkgs.linuxPackages_latest); - # Fix TRRS headphones missing a mic - # https://community.frame.work/t/headset-microphone-on-linux/12387/3 - boot.extraModprobeConfig = '' - options snd-hda-intel model=dell-headset-multi - ''; - - # For fingerprint support - services.fprintd.enable = lib.mkDefault true; - - # Custom udev rules - services.udev.extraRules = '' - # Fix headphone noise when on powersave - # https://community.frame.work/t/headphone-jack-intermittent-noise/5246/55 - SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0xa0e0", ATTR{power/control}="on" - # Ethernet expansion card support - ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0bda", ATTR{idProduct}=="8156", ATTR{power/autosuspend}="20" - ''; - - # Mis-detected by nixos-generate-config - # https://github.com/NixOS/nixpkgs/issues/171093 - # https://wiki.archlinux.org/title/Framework_Laptop#Changing_the_brightness_of_the_monitor_does_not_work - hardware.acpilight.enable = lib.mkDefault true; - - # Fix font sizes in X - # services.xserver.dpi = 200; - - # This adds a patched ectool, to interact with the Embedded Controller - # Can be used to interact with leds from userspace, etc. - # Not part of a nixos release yet, so package only gets added if it exists. - environment.systemPackages = lib.optional (pkgs ? "fw-ectool") pkgs.fw-ectool; } diff --git a/framework/13th-gen-intel/README.md b/framework/13-inch/13th-gen-intel/README.md similarity index 86% rename from framework/13th-gen-intel/README.md rename to framework/13-inch/13th-gen-intel/README.md index fc333d2..8f3b7a4 100644 --- a/framework/13th-gen-intel/README.md +++ b/framework/13-inch/13th-gen-intel/README.md @@ -11,5 +11,5 @@ services.fwupd.enable = true; Then run ```sh - $ sudo fwupdmgr update + $ fwupdmgr update ``` diff --git a/framework/13th-gen-intel/default.nix b/framework/13-inch/13th-gen-intel/default.nix similarity index 88% rename from framework/13th-gen-intel/default.nix rename to framework/13-inch/13th-gen-intel/default.nix index 56a2697..6912ebb 100644 --- a/framework/13th-gen-intel/default.nix +++ b/framework/13-inch/13th-gen-intel/default.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, ... }: { +{ imports = [ # Same config as 12th Gen. The chipsets and mainboard are similar enough # that no separate configuration is needed. diff --git a/framework/13-inch/7040-amd/default.nix b/framework/13-inch/7040-amd/default.nix index 128ace8..d6f8b6e 100644 --- a/framework/13-inch/7040-amd/default.nix +++ b/framework/13-inch/7040-amd/default.nix @@ -1,10 +1,9 @@ { lib, pkgs, ... }: { imports = [ + ../. ../../../common/cpu/amd ../../../common/cpu/amd/pstate.nix ../../../common/gpu/amd - ../../../common/pc/laptop - ../../../common/pc/laptop/ssd ]; # Newer kernel is better for amdgpu driver updates @@ -15,24 +14,4 @@ # AMD has better battery life with PPD over TLP: # https://community.frame.work/t/responded-amd-7040-sleep-states/38101/13 services.power-profiles-daemon.enable = lib.mkDefault true; - - # Fix TRRS headphones missing a mic - # https://community.frame.work/t/headset-microphone-on-linux/12387/3 - # - # Temporary until a kernel patch is merged to fix this - boot.extraModprobeConfig = '' - options snd-hda-intel model=dell-headset-multi - ''; - - # For fingerprint support - services.fprintd.enable = lib.mkDefault true; - - # Custom udev rules - services.udev.extraRules = '' - # Ethernet expansion card support - ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0bda", ATTR{idProduct}=="8156", ATTR{power/autosuspend}="20" - ''; - - # Needed for desktop environments to detect/manage display brightness - hardware.sensor.iio.enable = lib.mkDefault true; } diff --git a/framework/13-inch/default.nix b/framework/13-inch/default.nix new file mode 100644 index 0000000..6d44b9c --- /dev/null +++ b/framework/13-inch/default.nix @@ -0,0 +1,32 @@ +{ lib, pkgs, ... }: { + imports = [ + ../common/pc/laptop + ../common/pc/laptop/ssd + ]; + + # Fix TRRS headphones missing a mic + # https://community.frame.work/t/headset-microphone-on-linux/12387/3 + boot.extraModprobeConfig = '' + options snd-hda-intel model=dell-headset-multi + ''; + + # For fingerprint support + services.fprintd.enable = lib.mkDefault true; + + # Custom udev rules + services.udev.extraRules = '' + # Ethernet expansion card support + ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0bda", ATTR{idProduct}=="8156", ATTR{power/autosuspend}="20" + ''; + + # Fix font sizes in X + # services.xserver.dpi = 200; + + # Needed for desktop environments to detect/manage display brightness + hardware.sensor.iio.enable = lib.mkDefault true; + + # This adds a patched ectool, to interact with the Embedded Controller + # Can be used to interact with leds from userspace, etc. + # Not part of a nixos release yet, so package only gets added if it exists. + environment.systemPackages = lib.optional (pkgs ? "fw-ectool") pkgs.fw-ectool; +} diff --git a/framework/13-inch/intel.nix b/framework/13-inch/intel.nix new file mode 100644 index 0000000..a0f3e08 --- /dev/null +++ b/framework/13-inch/intel.nix @@ -0,0 +1,30 @@ +{ lib, pkgs, ... }: { + imports = [ + ../../common/cpu/intel + ]; + + boot.kernelParams = [ + # Fixes a regression in s2idle, making it more power efficient than deep sleep + "acpi_osi=\"!Windows 2020\"" + # For Power consumption + # https://community.frame.work/t/linux-battery-life-tuning/6665/156 + "nvme.noacpi=1" + ]; + + # 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); + + # Custom udev rules + services.udev.extraRules = '' + # Fix headphone noise when on powersave + # https://community.frame.work/t/headphone-jack-intermittent-noise/5246/55 + SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0xa0e0", ATTR{power/control}="on" + ''; + + # Mis-detected by nixos-generate-config + # https://github.com/NixOS/nixpkgs/issues/171093 + # https://wiki.archlinux.org/title/Framework_Laptop#Changing_the_brightness_of_the_monitor_does_not_work + hardware.acpilight.enable = lib.mkDefault true; + +} diff --git a/framework/README.md b/framework/README.md index 5d54aed..b1cc561 100644 --- a/framework/README.md +++ b/framework/README.md @@ -11,7 +11,7 @@ services.fwupd.enable = true; Then run ```sh - $ sudo fwupdmgr update + $ fwupdmgr update ``` [Latest Update](https://fwupd.org/lvfs/devices/work.frame.Laptop.TGL.BIOS.firmware) diff --git a/framework/default.nix b/framework/default.nix index a1eff2c..b693c13 100644 --- a/framework/default.nix +++ b/framework/default.nix @@ -1,53 +1,7 @@ -{ lib, pkgs, ... }: { +{ + # Per original module layout, default framework export was the 11th gen Intel + # of the Framework 13 Laptop imports = [ - ../common/cpu/intel - ../common/pc/laptop - ../common/pc/laptop/ssd + ./13-inch/11th-gen-intel ]; - - boot.kernelParams = [ - # Fixes a regression in s2idle, making it more power efficient than deep sleep - "acpi_osi=\"!Windows 2020\"" - # For Power consumption - # https://community.frame.work/t/linux-battery-life-tuning/6665/156 - "nvme.noacpi=1" - ]; - - # 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); - - # Fix TRRS headphones missing a mic - # https://community.frame.work/t/headset-microphone-on-linux/12387/3 - boot.extraModprobeConfig = '' - options snd-hda-intel model=dell-headset-multi - ''; - - # For fingerprint support - services.fprintd.enable = lib.mkDefault true; - - # Custom udev rules - services.udev.extraRules = '' - # Fix headphone noise when on powersave - # https://community.frame.work/t/headphone-jack-intermittent-noise/5246/55 - SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0xa0e0", ATTR{power/control}="on" - # Ethernet expansion card support - ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0bda", ATTR{idProduct}=="8156", ATTR{power/autosuspend}="20" - ''; - - # Mis-detected by nixos-generate-config - # https://github.com/NixOS/nixpkgs/issues/171093 - # https://wiki.archlinux.org/title/Framework_Laptop#Changing_the_brightness_of_the_monitor_does_not_work - hardware.acpilight.enable = lib.mkDefault true; - - # Needed for desktop environments to detect/manage display brightness - hardware.sensor.iio.enable = lib.mkDefault true; - - # Fix font sizes in X - # services.xserver.dpi = 200; - - # This adds a patched ectool, to interact with the Embedded Controller - # Can be used to interact with leds from userspace, etc. - # Not part of a nixos release yet, so package only gets added if it exists. - environment.systemPackages = lib.optional (pkgs ? "fw-ectool") pkgs.fw-ectool; } From 5f6b875273c1725eda9c2163c1e729a1a0b92168 Mon Sep 17 00:00:00 2001 From: Kevin J Hoerr Date: Fri, 10 Nov 2023 15:29:39 -0500 Subject: [PATCH 02/11] Fix common module imports for fw13 common module --- framework/13-inch/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/13-inch/default.nix b/framework/13-inch/default.nix index 6d44b9c..111bdf7 100644 --- a/framework/13-inch/default.nix +++ b/framework/13-inch/default.nix @@ -1,7 +1,7 @@ { lib, pkgs, ... }: { imports = [ - ../common/pc/laptop - ../common/pc/laptop/ssd + ../../common/pc/laptop + ../../common/pc/laptop/ssd ]; # Fix TRRS headphones missing a mic From de0c9310d397fa9f954d364ef738f5b11935c7b3 Mon Sep 17 00:00:00 2001 From: Kevin J Hoerr Date: Fri, 10 Nov 2023 16:10:31 -0500 Subject: [PATCH 03/11] Move common modules into folder --- framework/13-inch/11th-gen-intel/default.nix | 4 ++-- framework/13-inch/12th-gen-intel/default.nix | 4 ++-- framework/13-inch/7040-amd/default.nix | 10 ++-------- framework/13-inch/common/amd.nix | 11 +++++++++++ framework/13-inch/{ => common}/default.nix | 9 +++------ framework/13-inch/{ => common}/intel.nix | 5 +++++ 6 files changed, 25 insertions(+), 18 deletions(-) create mode 100644 framework/13-inch/common/amd.nix rename framework/13-inch/{ => common}/default.nix (70%) rename framework/13-inch/{ => common}/intel.nix (79%) diff --git a/framework/13-inch/11th-gen-intel/default.nix b/framework/13-inch/11th-gen-intel/default.nix index 22e14fd..a29966f 100644 --- a/framework/13-inch/11th-gen-intel/default.nix +++ b/framework/13-inch/11th-gen-intel/default.nix @@ -1,7 +1,7 @@ { lib, pkgs, ...}: { imports = [ - ../. - ../intel.nix + ../common + ../common/intel.nix ]; # Requires at least 5.16 for working wi-fi and bluetooth. diff --git a/framework/13-inch/12th-gen-intel/default.nix b/framework/13-inch/12th-gen-intel/default.nix index 345daf2..315c688 100644 --- a/framework/13-inch/12th-gen-intel/default.nix +++ b/framework/13-inch/12th-gen-intel/default.nix @@ -1,7 +1,7 @@ { lib, pkgs, ... }: { imports = [ - ../. - ../intel.nix + ../common + ../common/intel.nix ]; boot.kernelParams = [ diff --git a/framework/13-inch/7040-amd/default.nix b/framework/13-inch/7040-amd/default.nix index d6f8b6e..991221a 100644 --- a/framework/13-inch/7040-amd/default.nix +++ b/framework/13-inch/7040-amd/default.nix @@ -1,17 +1,11 @@ { lib, pkgs, ... }: { imports = [ - ../. - ../../../common/cpu/amd - ../../../common/cpu/amd/pstate.nix - ../../../common/gpu/amd + ../common + ../common/amd.nix ]; # Newer kernel is better for amdgpu driver updates # Requires at least 5.16 for working wi-fi and bluetooth (RZ616, kmod mt7922): # https://wireless.wiki.kernel.org/en/users/drivers/mediatek boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.1") (lib.mkDefault pkgs.linuxPackages_latest); - - # AMD has better battery life with PPD over TLP: - # https://community.frame.work/t/responded-amd-7040-sleep-states/38101/13 - services.power-profiles-daemon.enable = lib.mkDefault true; } diff --git a/framework/13-inch/common/amd.nix b/framework/13-inch/common/amd.nix new file mode 100644 index 0000000..249f6f3 --- /dev/null +++ b/framework/13-inch/common/amd.nix @@ -0,0 +1,11 @@ +{ lib, ... }: { + imports = [ + ../../../common/cpu/amd + ../../../common/cpu/amd/pstate.nix + ../../../common/gpu/amd + ]; + + # AMD has better battery life with PPD over TLP: + # https://community.frame.work/t/responded-amd-7040-sleep-states/38101/13 + services.power-profiles-daemon.enable = lib.mkDefault true; +} diff --git a/framework/13-inch/default.nix b/framework/13-inch/common/default.nix similarity index 70% rename from framework/13-inch/default.nix rename to framework/13-inch/common/default.nix index 111bdf7..784256c 100644 --- a/framework/13-inch/default.nix +++ b/framework/13-inch/common/default.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, ... }: { +{ lib, ... }: { imports = [ ../../common/pc/laptop ../../common/pc/laptop/ssd @@ -6,6 +6,8 @@ # Fix TRRS headphones missing a mic # https://community.frame.work/t/headset-microphone-on-linux/12387/3 + # + # This is temporary until a kernel patch is submitted boot.extraModprobeConfig = '' options snd-hda-intel model=dell-headset-multi ''; @@ -24,9 +26,4 @@ # Needed for desktop environments to detect/manage display brightness hardware.sensor.iio.enable = lib.mkDefault true; - - # This adds a patched ectool, to interact with the Embedded Controller - # Can be used to interact with leds from userspace, etc. - # Not part of a nixos release yet, so package only gets added if it exists. - environment.systemPackages = lib.optional (pkgs ? "fw-ectool") pkgs.fw-ectool; } diff --git a/framework/13-inch/intel.nix b/framework/13-inch/common/intel.nix similarity index 79% rename from framework/13-inch/intel.nix rename to framework/13-inch/common/intel.nix index a0f3e08..1ea20b3 100644 --- a/framework/13-inch/intel.nix +++ b/framework/13-inch/common/intel.nix @@ -27,4 +27,9 @@ # https://wiki.archlinux.org/title/Framework_Laptop#Changing_the_brightness_of_the_monitor_does_not_work hardware.acpilight.enable = lib.mkDefault true; + # This adds a patched ectool, to interact with the Embedded Controller + # Can be used to interact with leds from userspace, etc. + # Not part of a nixos release yet, so package only gets added if it exists. + environment.systemPackages = lib.optional (pkgs ? "fw-ectool") pkgs.fw-ectool; + } From 87d3381c789dca7d87c99ebf009307c8ac8666e1 Mon Sep 17 00:00:00 2001 From: Kevin J Hoerr Date: Fri, 10 Nov 2023 16:10:54 -0500 Subject: [PATCH 04/11] Add assertion for default framework import --- framework/OLD-BEHAVIOUR-DEPRECATION.md | 34 ++++++++++++++++++++++++++ framework/default.nix | 9 ++++--- 2 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 framework/OLD-BEHAVIOUR-DEPRECATION.md diff --git a/framework/OLD-BEHAVIOUR-DEPRECATION.md b/framework/OLD-BEHAVIOUR-DEPRECATION.md new file mode 100644 index 0000000..4f8f4a1 --- /dev/null +++ b/framework/OLD-BEHAVIOUR-DEPRECATION.md @@ -0,0 +1,34 @@ +# Changes to the framework top-level + +## Overview + +When the framework profile was created, there weren't other models of laptop available by the +company. Now there are multiple generations of the Framework 13, and the Framework 16 shipping by +the end of 2023. + +## How to update + +By preference, there will already be a specialised module for your model's configuration. + +If not and you have a 13-inch model, the common module under `framework/13-inch/common/default.nix` +can be imported directly, and the options provided can be used in your own system's configuration. + +Alternatively, you can create a new specialisation for your model under `framework` configured for +that model. + +## Changes + +### 13-inch profile + +All of the existing modules have been reconfigured to be under the `framework/13-inch` folder. + +The 12th and 13th gen Intel Framework 13's had their own specialisation modules separately available +already. To mirror those modules, the 11th gen Intel Framework 13 configuration has been moved to +`framework/13-inch/11th-gen-intel/default.nix`. + +### "Common" modules + +Tools / services that are shared among several models are now extracted to their own module under +`13-inch/common/` and imported by `13-inch/common/default.nix`. There were several tweaks for +11th gen/12th gen that were duplicated and are now a part of common modules. + diff --git a/framework/default.nix b/framework/default.nix index b693c13..b8c6c12 100644 --- a/framework/default.nix +++ b/framework/default.nix @@ -1,7 +1,8 @@ { - # Per original module layout, default framework export was the 11th gen Intel - # of the Framework 13 Laptop - imports = [ - ./13-inch/11th-gen-intel + assertions = [ + { + assertion = false; + message = "Importing framework/ (default.nix) directly is deprecated! See https://github.com/NixOS/nixos-hardware/blob/master/framework/OLD-BEHAVIOUR-DEPRECATED.md for more details."; + } ]; } From a14a7746f971f1c1e34b659c8cbbca4aa1717275 Mon Sep 17 00:00:00 2001 From: Kevin J Hoerr Date: Sat, 11 Nov 2023 16:25:20 -0500 Subject: [PATCH 05/11] Fix module paths for common framework modules --- framework/13-inch/common/default.nix | 4 ++-- framework/13-inch/common/intel.nix | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/13-inch/common/default.nix b/framework/13-inch/common/default.nix index 784256c..e19b3f5 100644 --- a/framework/13-inch/common/default.nix +++ b/framework/13-inch/common/default.nix @@ -1,7 +1,7 @@ { lib, ... }: { imports = [ - ../../common/pc/laptop - ../../common/pc/laptop/ssd + ../../../common/pc/laptop + ../../../common/pc/laptop/ssd ]; # Fix TRRS headphones missing a mic diff --git a/framework/13-inch/common/intel.nix b/framework/13-inch/common/intel.nix index 1ea20b3..d5c68ef 100644 --- a/framework/13-inch/common/intel.nix +++ b/framework/13-inch/common/intel.nix @@ -1,6 +1,6 @@ { lib, pkgs, ... }: { imports = [ - ../../common/cpu/intel + ../../../common/cpu/intel ]; boot.kernelParams = [ From ec3609cc5977c39362fb8460470f31d39ebe891b Mon Sep 17 00:00:00 2001 From: Kevin J Hoerr Date: Sat, 11 Nov 2023 16:32:26 -0500 Subject: [PATCH 06/11] Explicitly speak of 11th gen Intel Framework new profile --- framework/OLD-BEHAVIOUR-DEPRECATION.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/framework/OLD-BEHAVIOUR-DEPRECATION.md b/framework/OLD-BEHAVIOUR-DEPRECATION.md index 4f8f4a1..5dbadb6 100644 --- a/framework/OLD-BEHAVIOUR-DEPRECATION.md +++ b/framework/OLD-BEHAVIOUR-DEPRECATION.md @@ -8,7 +8,9 @@ the end of 2023. ## How to update -By preference, there will already be a specialised module for your model's configuration. +By preference, there will already be a specialised module for your model's configuration. If you +have an 11th gen Intel Framework 13 and were importing the `framework` profile, you would need to +update to use the `framework-11th-gen-intel` profile instead. If not and you have a 13-inch model, the common module under `framework/13-inch/common/default.nix` can be imported directly, and the options provided can be used in your own system's configuration. From 502d05fcf628c76ccdbecbd645f2808529e55b5d Mon Sep 17 00:00:00 2001 From: Kevin J Hoerr Date: Sat, 11 Nov 2023 17:19:50 -0500 Subject: [PATCH 07/11] framework: Add notice to README.md --- framework/README.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/framework/README.md b/framework/README.md index b1cc561..2dd58aa 100644 --- a/framework/README.md +++ b/framework/README.md @@ -1,4 +1,9 @@ -# [Framework Laptop 13](https://frame.work/) +# NOTE: Structure changes from 2023-11-11 + +Please read the [Deprecated Behaviour README](./OLD-BEHAVIOUR-DEPRECATION.md) to understand how some structural changes to +the code might affect you! + +# [Framework Laptops](https://frame.work/) ## Updating Firmware @@ -14,4 +19,17 @@ Then run $ fwupdmgr update ``` -[Latest Update](https://fwupd.org/lvfs/devices/work.frame.Laptop.TGL.BIOS.firmware) +## Common Modules + +For the Framework 13 laptops, there are common configuration modules available under the `13-inch/common/` directory, +including some modules specific to AMD- or Intel-based laptops. By preference, there will already be a specialised +module for your model's configuration. Otherwise, it can be added alongside the existing modules. + +## Support Tools + +### fw-ectool + +There is a `fw-ectool` package available in nixpkgs-unstable that provides some system configuration options via the EC. +This ectool only works with the Intel-based Framework laptops at present, as the Framework EC for AMD-based mainboards +is based on the Zephyr port of the ChromeOS EC, which involves a slightly changed communication interface. + From 9eb41407ab93fd7f2876defdf459945f24f1b54c Mon Sep 17 00:00:00 2001 From: Stig Palmquist Date: Sat, 14 Oct 2023 12:29:57 +0200 Subject: [PATCH 08/11] surface: linux 6.5.5 -> 6.5.7 --- microsoft/surface/common/default.nix | 2 +- microsoft/surface/common/kernel/default.nix | 2 +- .../kernel/{linux-6.5.5 => linux-6.5.7}/default.nix | 8 ++++---- .../kernel/{linux-6.5.5 => linux-6.5.7}/patches.nix | 0 4 files changed, 6 insertions(+), 6 deletions(-) rename microsoft/surface/common/kernel/{linux-6.5.5 => linux-6.5.7}/default.nix (80%) rename microsoft/surface/common/kernel/{linux-6.5.5 => linux-6.5.7}/patches.nix (100%) diff --git a/microsoft/surface/common/default.nix b/microsoft/surface/common/default.nix index 29ae5dc..2aec8db 100644 --- a/microsoft/surface/common/default.nix +++ b/microsoft/surface/common/default.nix @@ -10,7 +10,7 @@ in { ./surface-control ]; - microsoft-surface.kernelVersion = mkDefault "6.5.5"; + microsoft-surface.kernelVersion = mkDefault "6.5.7"; # Seems to be required to properly enable S0ix "Modern Standby": boot.kernelParams = mkDefault [ "mem_sleep_default=deep" ]; diff --git a/microsoft/surface/common/kernel/default.nix b/microsoft/surface/common/kernel/default.nix index 0799b46..95dce72 100644 --- a/microsoft/surface/common/kernel/default.nix +++ b/microsoft/surface/common/kernel/default.nix @@ -6,7 +6,7 @@ let in { imports = [ ./linux-6.1.55 - ./linux-6.5.5 + ./linux-6.5.7 ]; options.microsoft-surface.kernelVersion = mkOption { diff --git a/microsoft/surface/common/kernel/linux-6.5.5/default.nix b/microsoft/surface/common/kernel/linux-6.5.7/default.nix similarity index 80% rename from microsoft/surface/common/kernel/linux-6.5.5/default.nix rename to microsoft/surface/common/kernel/linux-6.5.7/default.nix index 485063a..fe6825b 100644 --- a/microsoft/surface/common/kernel/linux-6.5.5/default.nix +++ b/microsoft/surface/common/kernel/linux-6.5.7/default.nix @@ -8,7 +8,7 @@ let cfg = config.microsoft-surface; - version = "6.5.5"; + version = "6.5.7"; extraMeta.branch = "6.5"; patchDir = repos.linux-surface + "/patches/${extraMeta.branch}"; kernelPatches = pkgs.callPackage ./patches.nix { @@ -20,17 +20,17 @@ let inherit version extraMeta kernelPatches; src = fetchurl { url = "mirror://kernel/linux/kernel/v6.x/linux-${version}.tar.xz"; - sha256 = "15gg8sb6cfgk1afwj7fl7mj4nkj14w43vzwvw0qsg3nzyxwh7wcc"; + sha256 = "135v3y2vgc83dca4xi7q52wqi4dkfal74k1y73jwzj85h12fl28d"; }; }; in { options.microsoft-surface.kernelVersion = mkOption { - type = types.enum [ "6.5.5" ]; + type = types.enum [ "6.5.7" ]; }; - config = mkIf (cfg.kernelVersion == "6.5.5") { + config = mkIf (cfg.kernelVersion == "6.5.7") { boot = { inherit kernelPackages; }; diff --git a/microsoft/surface/common/kernel/linux-6.5.5/patches.nix b/microsoft/surface/common/kernel/linux-6.5.7/patches.nix similarity index 100% rename from microsoft/surface/common/kernel/linux-6.5.5/patches.nix rename to microsoft/surface/common/kernel/linux-6.5.7/patches.nix From 27ac7d57bcfe6609281c1a31a1577470bcfd5db9 Mon Sep 17 00:00:00 2001 From: Stig Palmquist Date: Sat, 14 Oct 2023 12:30:33 +0200 Subject: [PATCH 09/11] surface: linux 6.1.55 -> 6.1.57 --- microsoft/surface/common/kernel/default.nix | 2 +- .../kernel/{linux-6.1.55 => linux-6.1.57}/default.nix | 8 ++++---- .../kernel/{linux-6.1.55 => linux-6.1.57}/patches.nix | 0 microsoft/surface/surface-go/default.nix | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) rename microsoft/surface/common/kernel/{linux-6.1.55 => linux-6.1.57}/default.nix (80%) rename microsoft/surface/common/kernel/{linux-6.1.55 => linux-6.1.57}/patches.nix (100%) diff --git a/microsoft/surface/common/kernel/default.nix b/microsoft/surface/common/kernel/default.nix index 95dce72..93ac0e7 100644 --- a/microsoft/surface/common/kernel/default.nix +++ b/microsoft/surface/common/kernel/default.nix @@ -5,7 +5,7 @@ let in { imports = [ - ./linux-6.1.55 + ./linux-6.1.57 ./linux-6.5.7 ]; diff --git a/microsoft/surface/common/kernel/linux-6.1.55/default.nix b/microsoft/surface/common/kernel/linux-6.1.57/default.nix similarity index 80% rename from microsoft/surface/common/kernel/linux-6.1.55/default.nix rename to microsoft/surface/common/kernel/linux-6.1.57/default.nix index 7119a3d..76c21de 100644 --- a/microsoft/surface/common/kernel/linux-6.1.55/default.nix +++ b/microsoft/surface/common/kernel/linux-6.1.57/default.nix @@ -8,7 +8,7 @@ let cfg = config.microsoft-surface; - version = "6.1.55"; + version = "6.1.57"; extraMeta.branch = "6.1"; patchDir = repos.linux-surface + "/patches/${extraMeta.branch}"; kernelPatches = pkgs.callPackage ./patches.nix { @@ -20,17 +20,17 @@ let inherit version extraMeta kernelPatches; src = fetchurl { url = "mirror://kernel/linux/kernel/v6.x/linux-${version}.tar.xz"; - sha256 = "1h0mzx52q9pvdv7rhnvb8g68i7bnlc9rf8gy9qn4alsxq4g28zm8"; + sha256 = "1ccidrxswblxw9yaa45y6ds16pc7647f6fz36xxxhljivhyzxszr"; }; }; in { options.microsoft-surface.kernelVersion = mkOption { - type = types.enum [ "6.1.55" ]; + type = types.enum [ "6.1.57" ]; }; - config = mkIf (cfg.kernelVersion == "6.1.55") { + config = mkIf (cfg.kernelVersion == "6.1.57") { boot = { inherit kernelPackages; }; diff --git a/microsoft/surface/common/kernel/linux-6.1.55/patches.nix b/microsoft/surface/common/kernel/linux-6.1.57/patches.nix similarity index 100% rename from microsoft/surface/common/kernel/linux-6.1.55/patches.nix rename to microsoft/surface/common/kernel/linux-6.1.57/patches.nix diff --git a/microsoft/surface/surface-go/default.nix b/microsoft/surface/surface-go/default.nix index 31f4804..efd7075 100644 --- a/microsoft/surface/surface-go/default.nix +++ b/microsoft/surface/surface-go/default.nix @@ -17,7 +17,7 @@ in { ../../../common/cpu/intel/kaby-lake ]; - microsoft-surface.kernelVersion = "6.1.55"; + microsoft-surface.kernelVersion = "6.1.57"; boot.kernelParams = [ "i915.enable_rc6=1" From 8bb2d5ca134832da48fe515a60a039d192f071a5 Mon Sep 17 00:00:00 2001 From: Stig Palmquist Date: Sun, 12 Nov 2023 11:23:14 +0100 Subject: [PATCH 10/11] surface: linux 6.1.57 -> 6.1.62 --- microsoft/surface/common/kernel/default.nix | 2 +- .../kernel/{linux-6.1.57 => linux-6.1.x}/default.nix | 8 ++++---- .../kernel/{linux-6.1.57 => linux-6.1.x}/patches.nix | 0 microsoft/surface/surface-go/default.nix | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) rename microsoft/surface/common/kernel/{linux-6.1.57 => linux-6.1.x}/default.nix (80%) rename microsoft/surface/common/kernel/{linux-6.1.57 => linux-6.1.x}/patches.nix (100%) diff --git a/microsoft/surface/common/kernel/default.nix b/microsoft/surface/common/kernel/default.nix index 93ac0e7..a209460 100644 --- a/microsoft/surface/common/kernel/default.nix +++ b/microsoft/surface/common/kernel/default.nix @@ -5,8 +5,8 @@ let in { imports = [ - ./linux-6.1.57 ./linux-6.5.7 + ./linux-6.1.x ]; options.microsoft-surface.kernelVersion = mkOption { diff --git a/microsoft/surface/common/kernel/linux-6.1.57/default.nix b/microsoft/surface/common/kernel/linux-6.1.x/default.nix similarity index 80% rename from microsoft/surface/common/kernel/linux-6.1.57/default.nix rename to microsoft/surface/common/kernel/linux-6.1.x/default.nix index 76c21de..05ec4cf 100644 --- a/microsoft/surface/common/kernel/linux-6.1.57/default.nix +++ b/microsoft/surface/common/kernel/linux-6.1.x/default.nix @@ -8,7 +8,7 @@ let cfg = config.microsoft-surface; - version = "6.1.57"; + version = "6.1.62"; extraMeta.branch = "6.1"; patchDir = repos.linux-surface + "/patches/${extraMeta.branch}"; kernelPatches = pkgs.callPackage ./patches.nix { @@ -20,17 +20,17 @@ let inherit version extraMeta kernelPatches; src = fetchurl { url = "mirror://kernel/linux/kernel/v6.x/linux-${version}.tar.xz"; - sha256 = "1ccidrxswblxw9yaa45y6ds16pc7647f6fz36xxxhljivhyzxszr"; + sha256 = "sha256-uf1hb6zWvs/O74i5vnGNDxZiXKs/6B0ROEgCpwkehew="; }; }; in { options.microsoft-surface.kernelVersion = mkOption { - type = types.enum [ "6.1.57" ]; + type = types.enum [ version ]; }; - config = mkIf (cfg.kernelVersion == "6.1.57") { + config = mkIf (cfg.kernelVersion == version ) { boot = { inherit kernelPackages; }; diff --git a/microsoft/surface/common/kernel/linux-6.1.57/patches.nix b/microsoft/surface/common/kernel/linux-6.1.x/patches.nix similarity index 100% rename from microsoft/surface/common/kernel/linux-6.1.57/patches.nix rename to microsoft/surface/common/kernel/linux-6.1.x/patches.nix diff --git a/microsoft/surface/surface-go/default.nix b/microsoft/surface/surface-go/default.nix index efd7075..a1073dd 100644 --- a/microsoft/surface/surface-go/default.nix +++ b/microsoft/surface/surface-go/default.nix @@ -17,7 +17,7 @@ in { ../../../common/cpu/intel/kaby-lake ]; - microsoft-surface.kernelVersion = "6.1.57"; + microsoft-surface.kernelVersion = "6.1.62"; boot.kernelParams = [ "i915.enable_rc6=1" From df9bb8a436607da124e8cfa0fd19e70e9d9e0b7b Mon Sep 17 00:00:00 2001 From: Stig Palmquist Date: Sun, 12 Nov 2023 11:23:50 +0100 Subject: [PATCH 11/11] surface: linux 6.5.7 -> 6.5.11 --- microsoft/surface/common/default.nix | 2 +- microsoft/surface/common/kernel/default.nix | 2 +- .../kernel/{linux-6.5.7 => linux-6.5.x}/default.nix | 8 ++++---- .../kernel/{linux-6.5.7 => linux-6.5.x}/patches.nix | 0 4 files changed, 6 insertions(+), 6 deletions(-) rename microsoft/surface/common/kernel/{linux-6.5.7 => linux-6.5.x}/default.nix (80%) rename microsoft/surface/common/kernel/{linux-6.5.7 => linux-6.5.x}/patches.nix (100%) diff --git a/microsoft/surface/common/default.nix b/microsoft/surface/common/default.nix index 2aec8db..b6b00ee 100644 --- a/microsoft/surface/common/default.nix +++ b/microsoft/surface/common/default.nix @@ -10,7 +10,7 @@ in { ./surface-control ]; - microsoft-surface.kernelVersion = mkDefault "6.5.7"; + microsoft-surface.kernelVersion = mkDefault "6.5.11"; # Seems to be required to properly enable S0ix "Modern Standby": boot.kernelParams = mkDefault [ "mem_sleep_default=deep" ]; diff --git a/microsoft/surface/common/kernel/default.nix b/microsoft/surface/common/kernel/default.nix index a209460..a0637a3 100644 --- a/microsoft/surface/common/kernel/default.nix +++ b/microsoft/surface/common/kernel/default.nix @@ -5,8 +5,8 @@ let in { imports = [ - ./linux-6.5.7 ./linux-6.1.x + ./linux-6.5.x ]; options.microsoft-surface.kernelVersion = mkOption { diff --git a/microsoft/surface/common/kernel/linux-6.5.7/default.nix b/microsoft/surface/common/kernel/linux-6.5.x/default.nix similarity index 80% rename from microsoft/surface/common/kernel/linux-6.5.7/default.nix rename to microsoft/surface/common/kernel/linux-6.5.x/default.nix index fe6825b..b26b466 100644 --- a/microsoft/surface/common/kernel/linux-6.5.7/default.nix +++ b/microsoft/surface/common/kernel/linux-6.5.x/default.nix @@ -8,7 +8,7 @@ let cfg = config.microsoft-surface; - version = "6.5.7"; + version = "6.5.11"; extraMeta.branch = "6.5"; patchDir = repos.linux-surface + "/patches/${extraMeta.branch}"; kernelPatches = pkgs.callPackage ./patches.nix { @@ -20,17 +20,17 @@ let inherit version extraMeta kernelPatches; src = fetchurl { url = "mirror://kernel/linux/kernel/v6.x/linux-${version}.tar.xz"; - sha256 = "135v3y2vgc83dca4xi7q52wqi4dkfal74k1y73jwzj85h12fl28d"; + sha256 = "sha256-LuJK+SgrgJI7LaVrcKrX3y6O5OPwdkUuBbpmviBZtRk="; }; }; in { options.microsoft-surface.kernelVersion = mkOption { - type = types.enum [ "6.5.7" ]; + type = types.enum [ version ]; }; - config = mkIf (cfg.kernelVersion == "6.5.7") { + config = mkIf (cfg.kernelVersion == version) { boot = { inherit kernelPackages; }; diff --git a/microsoft/surface/common/kernel/linux-6.5.7/patches.nix b/microsoft/surface/common/kernel/linux-6.5.x/patches.nix similarity index 100% rename from microsoft/surface/common/kernel/linux-6.5.7/patches.nix rename to microsoft/surface/common/kernel/linux-6.5.x/patches.nix