diff --git a/default.nix b/default.nix index 642b075..c599e21 100644 --- a/default.nix +++ b/default.nix @@ -81,3 +81,10 @@ in } else {} ) + // ( + if pkgs.system == "x86_64-linux" + then { + inherit (pkgsWithOverlay) linux-bcachefs; + } + else {} + ) diff --git a/flake.nix b/flake.nix index 7379e97..da1303d 100644 --- a/flake.nix +++ b/flake.nix @@ -124,6 +124,13 @@ inherit (pkgs) vf2Kernel; } else {} + ) + // ( + if system == "x86_64-linux" + then { + inherit (pkgs) linux-bcachefs; + } + else {} ); modules = import ./modules; diff --git a/linux/bcachefs/default.nix b/linux/bcachefs/default.nix new file mode 100644 index 0000000..f868953 --- /dev/null +++ b/linux/bcachefs/default.nix @@ -0,0 +1,33 @@ +{ + lib, + fetchFromGitHub, + buildLinux, + ... +} @ args: let + modDirVersion = "6.3.0"; + source = builtins.fromJSON (builtins.readFile ./source.json); +in + buildLinux (args + // { + inherit modDirVersion; + version = "6.3.0+${source.rev}"; + src = fetchFromGitHub { + owner = "koverstreet"; + repo = "bcachefs"; + inherit (source) rev sha256; + }; + structuredExtraConfig = with lib.kernel; { + BCACHEFS_FS = module; + BCACHEFS_DEBUG = yes; + KALLSYMS = yes; + KALLSYMS_ALL = yes; + DEBUG_FS = yes; + DYNAMIC_FTRACE = yes; + FTRACE = yes; + }; + passthru.updateScript = [ + ../../scripts/update-git.sh + "github.com/koverstreet/bcachefs" + "linux/bcachefs/source.json" + ]; + }) diff --git a/linux/bcachefs/source.json b/linux/bcachefs/source.json new file mode 100644 index 0000000..4a79569 --- /dev/null +++ b/linux/bcachefs/source.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/koverstreet/bcachefs", + "rev": "799716df00709f7480f575e8fd626915bafba006", + "date": "2023-05-14T23:01:14-04:00", + "path": "/nix/store/mx6zdja6ii9g3pd7vzv9k4rnm4p4spqm-bcachefs", + "sha256": "0zid3g15034nd5cwmn233kn6fjyphkax2nklzhb46sz2283gzkiv", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/overlay.nix b/overlay.nix index ca1e3f6..9acee66 100644 --- a/overlay.nix +++ b/overlay.nix @@ -87,6 +87,7 @@ system: self: super: let fcitx5 = super.fcitx5.overrideAttrs (_: { src = self.callPackage ./i18n/fcitx5/patched-source.nix {inherit (super) fcitx5;}; }); + linux-bcachefs = self.callPackage ./linux/bcachefs {kernelPatches = [];}; }) riscv-overlay ];