2021-10-28 06:52:43 +00:00
|
|
|
{ lib
|
2023-03-24 00:07:29 +00:00
|
|
|
, stdenv
|
2021-10-28 06:52:43 +00:00
|
|
|
, fetchpatch
|
|
|
|
, kernel
|
2023-07-15 17:15:38 +00:00
|
|
|
, 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 ? "84f132d5696138bb038d2dc8f1162d2fab5ac832"
|
|
|
|
, diffHash ? "sha256-RaBWBU7rXjJFb1euFAFBHWCBQAG7npaCodjp/vMYpyw="
|
2021-10-28 06:52:43 +00:00
|
|
|
, kernelPatches # must always be defined in bcachefs' all-packages.nix entry because it's also a top-level attribute supplied by callPackage
|
|
|
|
, argsOverride ? {}
|
|
|
|
, ...
|
|
|
|
} @ args:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
# NOTE: bcachefs-tools should be updated simultaneously to preserve compatibility
|
|
|
|
(kernel.override ( args // {
|
2023-03-24 00:07:29 +00:00
|
|
|
version = "${kernel.version}-bcachefs-unstable-${commitDate}";
|
2021-12-30 13:39:12 +00:00
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
extraMeta = {
|
|
|
|
branch = "master";
|
|
|
|
broken = stdenv.isAarch64;
|
2023-07-15 17:15:38 +00:00
|
|
|
maintainers = with lib.maintainers; [ davidak Madouura pedrohlc raitobezarius ];
|
|
|
|
};
|
|
|
|
|
|
|
|
structuredExtraConfig = with lib.kernel; {
|
|
|
|
BCACHEFS_FS = module;
|
|
|
|
BCACHEFS_QUOTA = option yes;
|
|
|
|
BCACHEFS_POSIX_ACL = option yes;
|
2023-03-24 00:07:29 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
kernelPatches = [ {
|
2022-10-21 18:38:19 +00:00
|
|
|
name = "bcachefs-${currentCommit}";
|
2021-12-30 13:39:12 +00:00
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
patch = fetchpatch {
|
2022-10-21 18:38:19 +00:00
|
|
|
name = "bcachefs-${currentCommit}.diff";
|
|
|
|
url = "https://evilpiepirate.org/git/bcachefs.git/rawdiff/?id=${currentCommit}&id2=v${lib.versions.majorMinor kernel.version}";
|
2021-10-28 06:52:43 +00:00
|
|
|
sha256 = diffHash;
|
|
|
|
};
|
|
|
|
} ] ++ kernelPatches;
|
2021-12-06 16:07:01 +00:00
|
|
|
}))
|