ctucx.git: nixfiles

ctucx' nixfiles

commit a1f0bf974c9f4c5cb25988d936823ccc1d0c36e4
parent d200ac05cc9009b8c8d57e36225d99754226d134
Author: Leah (ctucx) <leah@ctu.cx>
Date: Mon, 21 Feb 2022 23:15:37 +0100

machines/currywurst: add kernel module for xmm7360 lte-modem
2 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/machines/currywurst/configuration.nix b/machines/currywurst/configuration.nix
@@ -22,6 +22,10 @@
     kernel.sysctl."kernel/sysrq"  = 1;
     kernelPackages                = pkgs.linuxKernel.packages.linux_5_16;
     kernelModules                 = [ "tpm-rng" ];
+    extraModulePackages           = [
+      pkgs.linuxKernel.packages.linux_5_16.acpi_call
+      (pkgs.callPackage ./xmm7360.nix { kernel = pkgs.linux_5_16; })
+    ];
     kernelParams = [
       "quiet"
       "scsi_mod.use_blk_mq=1"
diff --git a/machines/currywurst/xmm7360.nix b/machines/currywurst/xmm7360.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, kernel, perl, bc, breakpointHook }:
+
+stdenv.mkDerivation rec {
+  pname   = "xmm7360-pci";
+  version = "unstable-2022-02-10";
+
+  src = fetchFromGitHub {
+    owner  = "xmm7360";
+    repo   = "xmm7360-pci";
+    rev    = "cf6625ace8da1bd44f46eb71b2557ac01ee1d11a";
+    sha256 = "0yzjk8mv2rm74fqrxrpxv1hl2w4lmlqg9yyb4dnyds6c9wbflni1";
+  };
+
+  makeFlags = [ "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ];
+
+  nativeBuildInputs = kernel.moduleBuildDependencies;
+  INSTALL_MOD_PATH  = placeholder "out";
+  installFlags      = [ "DEPMOD=true" ];
+
+  meta = with lib; {
+    homepage = "https://github.com/xmm7360/xmm7360-pci";
+    description = "PCI driver for Fibocom L850-GL modem based on Intel XMM7360 modem";
+    downloadPage = "https://github.com/xmm7360/xmm7360-pci";
+    license = licenses.isc;
+    maintainers = with maintainers; [ flokli hexa ];
+    platforms = platforms.linux;
+#    broken = kernel.kernelOlder "4.10" || kernel.kernelAtLeast "5.14";
+  };
+}