summary refs log blame commit diff
path: root/pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix
blob: c58c4e67e4d0c937bb967f09a75cda1b0a2bb279 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
     
        

            
                           


                                                                            

                                                                  



                                                                                                                                            

                                                                                 
 
                  

                                                                  






                                                                                                  
 



                                            

                            

    
                     
                                         
 
                          


                                                                                                                                       
        
                         
   
{ lib
, stdenv
, fetchpatch
, kernel
, commitDate ? "2023-06-28"
# bcachefs-tools stores the expected-revision in:
#   https://evilpiepirate.org/git/bcachefs-tools.git/tree/.bcachefs_revision
# but this does not means that it'll be the latest-compatible revision
, currentCommit ? "4d2faeb4fb58c389dc9f76b8d5ae991ef4497e04"
, diffHash ? "sha256-DtMc8P4lTRzvS6PVvD7WtWEPsfnxIXSpqMsKKWs+edI="
, kernelPatches # must always be defined in bcachefs' all-packages.nix entry because it's also a top-level attribute supplied by callPackage
, argsOverride ? {}
, ...
} @ args:
# NOTE: bcachefs-tools should be updated simultaneously to preserve compatibility
(kernel.override ( args // {

  argsOverride = {
    version = "${kernel.version}-bcachefs-unstable-${commitDate}";
    modDirVersion = kernel.modDirVersion;

    extraMeta = {
      homepage = "https://bcachefs.org/";
      branch = "master";
      maintainers = with lib.maintainers; [ davidak Madouura pedrohlc raitobezarius YellowOnion ];
    };
  } // argsOverride;

  structuredExtraConfig = with lib.kernel; {
    BCACHEFS_FS = module;
    BCACHEFS_QUOTA = option yes;
    BCACHEFS_POSIX_ACL = option yes;
    # useful for bug reports
    FTRACE = option yes;
  };

  kernelPatches = [ {
      name = "bcachefs-${currentCommit}";

      patch = fetchpatch {
        name = "bcachefs-${currentCommit}.diff";
        url = "https://evilpiepirate.org/git/bcachefs.git/rawdiff/?id=${currentCommit}&id2=v${lib.versions.majorMinor kernel.version}";
        sha256 = diffHash;
      };
    } ] ++ kernelPatches;
}))