Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib
2, stdenv
3, fetchpatch
4, kernel
5, commitDate ? "2023-06-28"
6# bcachefs-tools stores the expected-revision in:
7# https://evilpiepirate.org/git/bcachefs-tools.git/tree/.bcachefs_revision
8# but this does not means that it'll be the latest-compatible revision
9, currentCommit ? "84f132d5696138bb038d2dc8f1162d2fab5ac832"
10, diffHash ? "sha256-RaBWBU7rXjJFb1euFAFBHWCBQAG7npaCodjp/vMYpyw="
11, kernelPatches # must always be defined in bcachefs' all-packages.nix entry because it's also a top-level attribute supplied by callPackage
12, argsOverride ? {}
13, ...
14} @ args:
15
16# NOTE: bcachefs-tools should be updated simultaneously to preserve compatibility
17(kernel.override ( args // {
18 version = "${kernel.version}-bcachefs-unstable-${commitDate}";
19
20 extraMeta = {
21 branch = "master";
22 broken = stdenv.isAarch64;
23 maintainers = with lib.maintainers; [ davidak Madouura pedrohlc raitobezarius ];
24 };
25
26 structuredExtraConfig = with lib.kernel; {
27 BCACHEFS_FS = module;
28 BCACHEFS_QUOTA = option yes;
29 BCACHEFS_POSIX_ACL = option yes;
30 };
31
32 kernelPatches = [ {
33 name = "bcachefs-${currentCommit}";
34
35 patch = fetchpatch {
36 name = "bcachefs-${currentCommit}.diff";
37 url = "https://evilpiepirate.org/git/bcachefs.git/rawdiff/?id=${currentCommit}&id2=v${lib.versions.majorMinor kernel.version}";
38 sha256 = diffHash;
39 };
40 } ] ++ kernelPatches;
41}))