Unverified Commit aec87d52 authored by Masum Reza's avatar Masum Reza Committed by GitHub
Browse files

bcachefs-kernel-module: Nest within bcachefs-tools (#446975)

parents 4e32ecdc 6e331d90
Loading
Loading
Loading
Loading
+16 −4
Original line number Diff line number Diff line
@@ -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 −1
Original line number Diff line number Diff line
bcachefs-tools:
{
  lib,
  stdenv,
  bcachefs-tools,
  kernelModuleMakeFlags,
  kernel,
}:
+3 −0
Original line number Diff line number Diff line
@@ -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;
+5 −1
Original line number Diff line number Diff line
@@ -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 { };