nixos/bcachefs: init module
This commit is contained in:
parent
bd79b8c9fc
commit
8f389f3316
@ -679,6 +679,7 @@
|
|||||||
./tasks/cpu-freq.nix
|
./tasks/cpu-freq.nix
|
||||||
./tasks/encrypted-devices.nix
|
./tasks/encrypted-devices.nix
|
||||||
./tasks/filesystems.nix
|
./tasks/filesystems.nix
|
||||||
|
./tasks/filesystems/bcachefs.nix
|
||||||
./tasks/filesystems/btrfs.nix
|
./tasks/filesystems/btrfs.nix
|
||||||
./tasks/filesystems/cifs.nix
|
./tasks/filesystems/cifs.nix
|
||||||
./tasks/filesystems/exfat.nix
|
./tasks/filesystems/exfat.nix
|
||||||
|
@ -221,6 +221,9 @@ checkFS() {
|
|||||||
# Don't check resilient COWs as they validate the fs structures at mount time
|
# Don't check resilient COWs as they validate the fs structures at mount time
|
||||||
if [ "$fsType" = btrfs -o "$fsType" = zfs ]; then return 0; fi
|
if [ "$fsType" = btrfs -o "$fsType" = zfs ]; then return 0; fi
|
||||||
|
|
||||||
|
# Skip fsck for bcachefs - not implemented yet.
|
||||||
|
if [ "$fsType" = bcachefs ]; then return 0; fi
|
||||||
|
|
||||||
# Skip fsck for inherently readonly filesystems.
|
# Skip fsck for inherently readonly filesystems.
|
||||||
if [ "$fsType" = squashfs ]; then return 0; fi
|
if [ "$fsType" = squashfs ]; then return 0; fi
|
||||||
|
|
||||||
|
26
nixos/modules/tasks/filesystems/bcachefs.nix
Normal file
26
nixos/modules/tasks/filesystems/bcachefs.nix
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
inInitrd = any (fs: fs == "bcachefs") config.boot.initrd.supportedFilesystems;
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
config = mkIf (any (fs: fs == "bcachefs") config.boot.supportedFilesystems) {
|
||||||
|
|
||||||
|
system.fsPackages = [ pkgs.bcachefs-tools ];
|
||||||
|
|
||||||
|
# use kernel package with bcachefs support until it's in mainline
|
||||||
|
boot.kernelPackages = pkgs.linuxPackages_testing_bcachefs;
|
||||||
|
boot.initrd.availableKernelModules = mkIf inInitrd [ "bcachefs" ];
|
||||||
|
|
||||||
|
boot.initrd.extraUtilsCommands = mkIf inInitrd
|
||||||
|
''
|
||||||
|
copy_bin_and_libs ${pkgs.bcachefs-tools}/bin/fsck.bcachefs
|
||||||
|
'';
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user