Skip to content

framework: disable kernel module on 6.12+ #1437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions framework/13-inch/11th-gen-intel/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
imports = [
../common
../common/intel.nix
../common/intel-legacy.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);

hardware.framework.laptop13.audioEnhancement.rawDeviceName = lib.mkDefault "alsa_output.pci-0000_00_1f.3.analog-stereo";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missed a part (two extra spaces)


}
1 change: 1 addition & 0 deletions framework/13-inch/12th-gen-intel/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
imports = [
../common
../common/intel.nix
../common/intel-legacy.nix
];

config = lib.mkMerge [
Expand Down
8 changes: 8 additions & 0 deletions framework/13-inch/common/intel-legacy.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{ config, lib, ... }: {
# on intel 11-13th gen, enable kmod by default if
# - kernel >= 6.10
# - nixos >= 24.05
hardware.framework.enableKmod =
lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.10" &&
lib.versionAtLeast (lib.versions.majorMinor lib.version) "24.05";
}
22 changes: 11 additions & 11 deletions framework/kmod.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{ 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 6.10 <= kernel <= 6.12
default = lib.versionAtLeast (lib.versions.majorMinor lib.version) "24.05" &&
kernel_version_compatible &&
!lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.12";
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; [
Expand Down