From 8f389f331641561c2c0355edd9e83593bf908a39 Mon Sep 17 00:00:00 2001 From: davidak Date: Thu, 31 Aug 2017 05:24:48 -0500 Subject: nixos/bcachefs: init module --- nixos/modules/tasks/filesystems/bcachefs.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 nixos/modules/tasks/filesystems/bcachefs.nix (limited to 'nixos/modules/tasks') diff --git a/nixos/modules/tasks/filesystems/bcachefs.nix b/nixos/modules/tasks/filesystems/bcachefs.nix new file mode 100644 index 00000000000..227707173a3 --- /dev/null +++ b/nixos/modules/tasks/filesystems/bcachefs.nix @@ -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 + ''; + + }; +} -- cgit 1.4.1