monolith: fix bluetooth dongle
This commit is contained in:
		
							parent
							
								
									a4ebb60595
								
							
						
					
					
						commit
						9c8bc05856
					
				
					 4 changed files with 80 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -8,4 +8,5 @@ rec {
 | 
			
		|||
  emmet-cli = pkgs.callPackage ./emmet-cli.nix { };
 | 
			
		||||
  material-wifi-icons = pkgs.callPackage ./material-wifi-icons.nix { };
 | 
			
		||||
  gnome-pass-search-provider = pkgs.callPackage ./gnome-pass-search-provider.nix { };
 | 
			
		||||
  linux-bluetooth = pkgs.callPackage ./linux-bluetooth.nix { };
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										47
									
								
								pkgs/linux-bluetooth.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								pkgs/linux-bluetooth.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,47 @@
 | 
			
		|||
{
 | 
			
		||||
  pkgs,
 | 
			
		||||
  lib,
 | 
			
		||||
  kernel ? pkgs.linuxPackages_latest.kernel,
 | 
			
		||||
  patches ? [ ],
 | 
			
		||||
}:
 | 
			
		||||
 | 
			
		||||
pkgs.stdenv.mkDerivation {
 | 
			
		||||
  pname = "bluetooth-kernel-module";
 | 
			
		||||
  inherit (kernel)
 | 
			
		||||
    src
 | 
			
		||||
    version
 | 
			
		||||
    postPatch
 | 
			
		||||
    nativeBuildInputs
 | 
			
		||||
    ;
 | 
			
		||||
 | 
			
		||||
  inherit patches;
 | 
			
		||||
 | 
			
		||||
  kernel_dev = kernel.dev;
 | 
			
		||||
  kernelVersion = kernel.modDirVersion;
 | 
			
		||||
 | 
			
		||||
  modulePath = "drivers/bluetooth";
 | 
			
		||||
 | 
			
		||||
  buildPhase = ''
 | 
			
		||||
    BUILT_KERNEL=$kernel_dev/lib/modules/$kernelVersion/build
 | 
			
		||||
 | 
			
		||||
    cp $BUILT_KERNEL/Module.symvers .
 | 
			
		||||
    cp $BUILT_KERNEL/.config        .
 | 
			
		||||
    cp $kernel_dev/vmlinux          .
 | 
			
		||||
 | 
			
		||||
    make "-j$NIX_BUILD_CORES" modules_prepare
 | 
			
		||||
    make "-j$NIX_BUILD_CORES" M=$modulePath modules
 | 
			
		||||
  '';
 | 
			
		||||
 | 
			
		||||
  installPhase = ''
 | 
			
		||||
    make \
 | 
			
		||||
      INSTALL_MOD_PATH="$out" \
 | 
			
		||||
      XZ="xz -T$NIX_BUILD_CORES" \
 | 
			
		||||
      M="$modulePath" \
 | 
			
		||||
      modules_install
 | 
			
		||||
  '';
 | 
			
		||||
 | 
			
		||||
  meta = {
 | 
			
		||||
    description = "Bluetooth kernel module";
 | 
			
		||||
    license = lib.licenses.gpl3;
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue