Skip to content

Commit ec7bf03

Browse files
authored
Merge pull request #1656 from r-vdp/rvdp/framework-kmod
framework/kmod: remove compatibility with Linux version < 6.10
2 parents 2379bc4 + e114820 commit ec7bf03

File tree

1 file changed

+19
-40
lines changed

1 file changed

+19
-40
lines changed

framework/kmod.nix

Lines changed: 19 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,35 @@
11
{
22
config,
33
lib,
4-
pkgs,
54
...
65
}:
7-
let
8-
kernel_version_compatible = lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.10";
9-
in
106
{
117
options.hardware.framework.enableKmod =
12-
(lib.mkEnableOption "Enable the community created Framework kernel module that allows interacting with the embedded controller from sysfs.")
8+
(lib.mkEnableOption "the community-created Framework kernel module that allows interacting with the embedded controller from sysfs.")
139
// {
1410
# enable by default on NixOS >= 24.05 and kernel >= 6.10
15-
default = lib.and (lib.versionAtLeast (lib.versions.majorMinor lib.version) "24.05") kernel_version_compatible;
16-
defaultText = "enabled by default on NixOS >= 24.05 and kernel >= 6.10";
11+
default = lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.10";
12+
defaultText = "enabled by default if kernel >= 6.10";
1713
};
1814

19-
config.boot = lib.mkIf config.hardware.framework.enableKmod {
20-
extraModulePackages = with config.boot.kernelPackages; [
21-
framework-laptop-kmod
22-
];
23-
24-
# https://github.com/DHowett/framework-laptop-kmod?tab=readme-ov-file#usage
25-
kernelModules = [
26-
"cros_ec"
27-
"cros_ec_lpcs"
15+
config = lib.mkIf config.hardware.framework.enableKmod {
16+
assertions = [
17+
{
18+
assertion = lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.10";
19+
message = "The framework laptop kernel module requires Linux 6.10 or above";
20+
}
2821
];
2922

30-
# add required patch if enabled on kernel <6.10
31-
kernelPatches = lib.mkIf (!kernel_version_compatible) [
32-
rec {
33-
name = "platform/chrome: cros_ec_lpc: add support for AMD Framework Laptops";
34-
msgid = "[email protected]";
35-
version = "3";
36-
hash = "sha256-aQSyys8CMzlj9EdNhg8vtp76fg1qEwUVeJL0E+8w5HU=";
37-
patch =
38-
pkgs.runCommandLocal "patch-${msgid}"
39-
{
40-
nativeBuildInputs = with pkgs; [
41-
b4
42-
git
43-
cacert
44-
];
45-
SSL_CERT_FILE = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
23+
boot = {
24+
extraModulePackages = with config.boot.kernelPackages; [
25+
framework-laptop-kmod
26+
];
4627

47-
outputHash = hash;
48-
}
49-
''
50-
export HOME="$TMP"
51-
PYTHONHASHSEED=0 ${pkgs.b4}/bin/b4 -n am -C -T -v ${version} -o- "${msgid}" > "$out"
52-
'';
53-
}
54-
];
28+
# https://github.com/DHowett/framework-laptop-kmod?tab=readme-ov-file#usage
29+
kernelModules = [
30+
"cros_ec"
31+
"cros_ec_lpcs"
32+
];
33+
};
5534
};
5635
}

0 commit comments

Comments
 (0)