Skip to content
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

msi-ec-kmods: init at 0-unstable-2024-09-19 #343038

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12502,6 +12502,12 @@
githubId = 3044438;
name = "Lucas Savva";
};
m1dugh = {
email = "[email protected]";
name = "Romain LE MIERE";
github = "m1dugh";
githubId = 42266017;
};
ma27 = {
email = "[email protected]";
matrix = "@ma27:nicht-so.sexy";
Expand Down
51 changes: 51 additions & 0 deletions pkgs/os-specific/linux/msi-ec/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
stdenv,
lib,
fetchFromGitHub,
linuxPackages,
kernel ? linuxPackages.kernel,
}:
stdenv.mkDerivation {
pname = "msi-ec-kmods";
version = "0-unstable-2024-09-19";

src = fetchFromGitHub {
owner = "m1dugh";
repo = "msi-ec";
rev = "60aad95e2c8948140232f4c4d70f4ceba821d5a5";
hash = "sha256-qgM4KeGoLvbVsii5YR3GTGi2MVlU+JeArzEoA+6A3a0=";
};
m1dugh marked this conversation as resolved.
Show resolved Hide resolved

dontMakeSourcesWritable = false;

patchPhase = ''
cp ${./patches/Makefile} ./Makefile
'';

hardeningDisable = [
"pic"
];

NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";

makeFlags = kernel.makeFlags ++ [
"KERNELDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
"INSTALL_MOD_PATH=$(out)"
];

nativeBuildInputs = kernel.moduleBuildDependencies;

buildFlags = [ "modules" ];
installTargets = [ "modules_install" ];

enableParallelBuilding = true;

meta = {
description = "Kernel modules for MSI Embedded controller";
homepage = "https://github.com/m1dugh/msi-ec";
license = lib.licenses.gpl2;
maintainers = [ lib.maintainers.m1dugh ];
platforms = lib.platforms.linux;
broken = kernel.kernelOlder "6.2";
};
}
21 changes: 21 additions & 0 deletions pkgs/os-specific/linux/msi-ec/patches/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Out of the box, the build with this Makefile only works in FHS environments,
# such as on Ubuntu or Debian. On NixOS, you either need to open an FHS
# environment using a Nix shell or build this from a specially crafted Nix
# derivation.
#
# This file follows the conventions written down here:
# https://docs.kernel.org/kbuild/modules.html
# Make it possible to override the kernel src tree location from Nix derivation.
KERNEL ?= $(shell uname -r)
KERNELDIR ?= /lib/modules/$(KERNEL)/build/
.PHONY: default
default: modules
# -m: Build as module.
obj-m = msi-ec.o
.PHONY: modules
modules:
@#"M=": Module source. Special variable of the kernel's main Makefile.
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
.PHONY: modules_install
modules_install:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
2 changes: 2 additions & 0 deletions pkgs/top-level/linux-kernels.nix
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,8 @@ in {

nullfs = callPackage ../os-specific/linux/nullfs { };

msi-ec = callPackage ../os-specific/linux/msi-ec { };

} // lib.optionalAttrs config.allowAliases {
ati_drivers_x11 = throw "ati drivers are no longer supported by any kernel >=4.1"; # added 2021-05-18;
hid-nintendo = throw "hid-nintendo was added in mainline kernel version 5.16"; # Added 2023-07-30
Expand Down