1{
2 config,
3 pkgs,
4 lib,
5 ...
6}:
7
8with lib;
9
10let
11 inInitrd = config.boot.initrd.supportedFilesystems.f2fs or false;
12in
13{
14 config = mkIf (config.boot.supportedFilesystems.f2fs or false) {
15
16 system.fsPackages = [ pkgs.f2fs-tools ];
17
18 boot.initrd.availableKernelModules = mkIf inInitrd [
19 "f2fs"
20 "crc32"
21 ];
22
23 boot.initrd.extraUtilsCommands = mkIf (inInitrd && !config.boot.initrd.systemd.enable) ''
24 copy_bin_and_libs ${pkgs.f2fs-tools}/sbin/fsck.f2fs
25 '';
26
27 boot.initrd.systemd.initrdBin = mkIf inInitrd [ pkgs.f2fs-tools ];
28 };
29}