NixDaemon

NixOS pentest workstation as one flake — IceBreaker's successor
git clone https://git.daemon-sec.xyz/NixDaemon.git
Log | Files | Refs | README

_package.nix (1240B)


      1 # Out-of-tree build of drivers/platform/x86/uniwill from torvalds/linux v6.19
      2 # (uniwill-acpi.c, uniwill-wmi.c, uniwill-wmi.h, vendored verbatim; GPL-2.0-or-later).
      3 # Takes `kernel` and `kernelModuleMakeFlags` from the kernelPackages scope.
      4 {
      5   lib,
      6   stdenv,
      7   kernel,
      8   kernelModuleMakeFlags,
      9 }:
     10 stdenv.mkDerivation {
     11   pname = "uniwill-laptop";
     12   version = "6.19-${kernel.version}";
     13 
     14   src = lib.fileset.toSource {
     15     root = ./.;
     16     fileset = lib.fileset.unions [
     17       ./Makefile
     18       ./uniwill-acpi.c
     19       ./uniwill-wmi.c
     20       ./uniwill-wmi.h
     21     ];
     22   };
     23 
     24   hardeningDisable = [ "pic" ];
     25   nativeBuildInputs = kernel.moduleBuildDependencies;
     26 
     27   makeFlags = kernelModuleMakeFlags ++ [
     28     "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
     29   ];
     30 
     31   installPhase = ''
     32     install -D uniwill-laptop.ko $out/lib/modules/${kernel.modDirVersion}/extra/uniwill-laptop.ko
     33   '';
     34 
     35   meta = {
     36     description = "Uniwill/TongFang laptop extras (hwmon fans and temperatures, lightbar, hotkeys), Linux 6.19 driver for older kernels";
     37     homepage = "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/platform/x86/uniwill";
     38     license = lib.licenses.gpl2Plus;
     39     platforms = [ "x86_64-linux" ];
     40   };
     41 }