bcachefs-kernel-module: Nest within bcachefs-tools (#446975)
This commit is contained in:
@@ -178,8 +178,20 @@ let
|
||||
in
|
||||
|
||||
{
|
||||
options.boot.bcachefs.package = lib.mkPackageOption pkgs "bcachefs-tools" { } // {
|
||||
description = "Configured Bcachefs userspace package.";
|
||||
options.boot.bcachefs = {
|
||||
package = lib.mkPackageOption pkgs "bcachefs-tools" {
|
||||
extraDescription = ''
|
||||
This package should also provide a passthru 'kernelModule'
|
||||
attribute to build the out-of-tree kernel module.
|
||||
'';
|
||||
};
|
||||
|
||||
modulePackage = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
# See NOTE in linux-kernels.nix
|
||||
default = config.boot.kernelPackages.callPackage cfg.package.kernelModule { };
|
||||
internal = true;
|
||||
};
|
||||
};
|
||||
|
||||
options.services.bcachefs.autoScrub = {
|
||||
@@ -245,8 +257,8 @@ in
|
||||
system.fsPackages = [ cfg.package ];
|
||||
services.udev.packages = [ cfg.package ];
|
||||
|
||||
boot.extraModulePackages = lib.optionals (!config.boot.kernelPackages.bcachefs.meta.broken) [
|
||||
config.boot.kernelPackages.bcachefs
|
||||
boot.extraModulePackages = lib.optionals (!cfg.modulePackage.meta.broken) [
|
||||
cfg.modulePackage
|
||||
];
|
||||
|
||||
systemd = {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
bcachefs-tools:
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
bcachefs-tools,
|
||||
kernelModuleMakeFlags,
|
||||
kernel,
|
||||
}:
|
||||
@@ -118,6 +118,9 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
# See NOTE in linux-kernels.nix
|
||||
kernelModule = import ./kernel-module.nix finalAttrs.finalPackage;
|
||||
|
||||
tests = {
|
||||
version = testers.testVersion {
|
||||
package = finalAttrs.finalPackage;
|
||||
|
||||
@@ -375,7 +375,11 @@ in
|
||||
|
||||
bbswitch = callPackage ../os-specific/linux/bbswitch { };
|
||||
|
||||
bcachefs = callPackage ../os-specific/linux/bcachefs-kernel-module { };
|
||||
# NOTE: The bcachefs module is called this way to facilitate
|
||||
# easy overriding, as it is expected many users will want to
|
||||
# pull from the upstream git repo, which may include
|
||||
# unreleased changes to the module build process.
|
||||
bcachefs = callPackage pkgs.bcachefs-tools.kernelModule { };
|
||||
|
||||
ch9344 = callPackage ../os-specific/linux/ch9344 { };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user