BCACHEFS BCACHEFS BCACHEFS BCACHEFS

This commit is contained in:
Max Headroom 2024-01-15 19:29:40 +01:00
parent 6ee981f403
commit 719d606a86
4 changed files with 1 additions and 134 deletions

View file

@ -1,8 +1,5 @@
{ config, lib, pkgs, aspect, inputs, hosts, ... }: { config, lib, pkgs, aspect, inputs, hosts, ... }:
let
inherit (inputs.self.packages.${pkgs.system}) bcachefs-tools linux-bcachefs;
in
{ {
imports = [ imports = [
@ -31,13 +28,7 @@ in
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
boot.kernelPackages = lib.mkForce (pkgs.linuxPackagesFor (linux-bcachefs.override { boot.kernelPackages = pkgs.linuxPackages_latest;
ignoreConfigErrors = true;
}));
nixpkgs.overlays = lib.singleton (_: _: {
inherit bcachefs-tools;
});
networking.hostName = "TITAN"; networking.hostName = "TITAN";

View file

@ -1,34 +0,0 @@
{ lib
, fetchpatch
, kernel
, commitDate ? "2022-12-07"
, currentCommit ? "d73d13472d932df2ecf3cbc5fb122be2d06c6a73"
, diffHash ? "sha256-//0H6Ax24qoHx1iR0s+HGDhEm6mSJwtrKmzN5trNbcw="
, 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}";
extraMeta = {
branch = "master";
maintainers = with lib.maintainers; [ davidak Madouura ];
};
} // argsOverride;
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;
};
extraConfig = "BCACHEFS_FS m";
} ] ++ kernelPatches;
}))

View file

@ -15,18 +15,10 @@ let
}; };
sandbox = path: extra: (pkgs.callPackage path ({ inherit mkNixPak; } // extra)).config.env; sandbox = path: extra: (pkgs.callPackage path ({ inherit mkNixPak; } // extra)).config.env;
useUpstreamBcachefs = true;
in in
{ {
amberol = sandbox ./nixpak/amberol { }; amberol = sandbox ./nixpak/amberol { };
bcachefs-tools = if useUpstreamBcachefs
then
pkgs.bcachefs-tools
else
pkgs.callPackage ./tools/bcachefs-tools { };
brig = pkgs.callPackage ./tools/brig { }; brig = pkgs.callPackage ./tools/brig { };
dialect = sandbox ./nixpak/dialect { }; dialect = sandbox ./nixpak/dialect { };
@ -57,15 +49,6 @@ in
identity = pkgs.callPackage ./apps/identity { }; identity = pkgs.callPackage ./apps/identity { };
linux-bcachefs = if useUpstreamBcachefs
then
pkgs.linuxKernel.kernels.linux_testing_bcachefs
else
pkgs.callPackage ./kernels/linux-bcachefs rec {
kernel = pkgs.linux_6_0;
inherit (kernel) kernelPatches;
};
obfuscate = pkgs.callPackage ./apps/obfuscate { }; obfuscate = pkgs.callPackage ./apps/obfuscate { };
neovim-gtk = pkgs.callPackage ./apps/neovim-gtk { }; neovim-gtk = pkgs.callPackage ./apps/neovim-gtk { };

View file

@ -1,73 +0,0 @@
{ lib
, stdenv
, fetchFromGitHub
, pkg-config
, docutils
, libuuid
, libscrypt
, libsodium
, keyutils
, liburcu
, zlib
, libaio
, zstd
, lz4
, python3Packages
, udev
, valgrind
, nixosTests
, fuse3
, fuseSupport ? false
}:
stdenv.mkDerivation {
pname = "bcachefs-tools";
version = "unstable-2022-12-03";
src = fetchFromGitHub {
owner = "koverstreet";
repo = "bcachefs-tools";
rev = "787768043dba6646712eef77c8076f3bfb0621cb";
sha256 = "sha256-Mtbfg6tiQvzSrR6Rp4ZUnM2d4nxaAYE7eeINLxiWzqQ=";
};
postPatch = ''
patchShebangs .
substituteInPlace Makefile \
--replace "pytest-3" "pytest --verbose" \
--replace "INITRAMFS_DIR=/etc/initramfs-tools" \
"INITRAMFS_DIR=${placeholder "out"}/etc/initramfs-tools"
'';
nativeBuildInputs = [ pkg-config docutils python3Packages.python ];
buildInputs = [
libuuid libscrypt libsodium keyutils liburcu zlib libaio
zstd lz4 python3Packages.pytest udev valgrind
] ++ lib.optional fuseSupport fuse3;
doCheck = false; # needs bcachefs module loaded on builder
checkFlags = [ "BCACHEFS_TEST_USE_VALGRIND=no" ];
checkInputs = [ valgrind ];
preCheck = lib.optionalString fuseSupport ''
rm tests/test_fuse.py
'';
installFlags = [ "PREFIX=${placeholder "out"}" ];
passthru.tests = {
smoke-test = nixosTests.bcachefs;
inherit (nixosTests.installer) bcachefsSimple bcachefsEncrypted bcachefsMulti;
};
enableParallelBuilding = true;
meta = with lib; {
description = "Tool for managing bcachefs filesystems";
homepage = "https://bcachefs.org/";
license = licenses.gpl2;
maintainers = with maintainers; [ davidak Madouura ];
platforms = platforms.linux;
};
}