2014-05-05 14:58:51 -04:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
2014-03-25 16:39:10 -04:00
|
|
|
|
2014-05-05 14:58:51 -04:00
|
|
|
with lib;
|
2014-03-25 16:39:10 -04:00
|
|
|
|
|
|
|
let
|
2024-02-18 23:35:17 +01:00
|
|
|
inInitrd = config.boot.initrd.supportedFilesystems.f2fs or false;
|
2014-03-25 16:39:10 -04:00
|
|
|
in
|
|
|
|
{
|
2024-02-18 23:35:17 +01:00
|
|
|
config = mkIf (config.boot.supportedFilesystems.f2fs or false) {
|
2014-03-25 16:39:10 -04:00
|
|
|
|
|
|
|
system.fsPackages = [ pkgs.f2fs-tools ];
|
|
|
|
|
2017-02-22 16:13:11 -08:00
|
|
|
boot.initrd.availableKernelModules = mkIf inInitrd [
|
|
|
|
"f2fs"
|
|
|
|
"crc32"
|
|
|
|
];
|
2014-03-25 16:39:10 -04:00
|
|
|
|
2022-04-16 20:46:32 +01:00
|
|
|
boot.initrd.extraUtilsCommands = mkIf (inInitrd && !config.boot.initrd.systemd.enable) ''
|
2015-03-28 17:15:41 -07:00
|
|
|
copy_bin_and_libs ${pkgs.f2fs-tools}/sbin/fsck.f2fs
|
2014-03-25 16:39:10 -04:00
|
|
|
'';
|
2023-10-19 21:09:12 -04:00
|
|
|
|
|
|
|
boot.initrd.systemd.initrdBin = mkIf inInitrd [ pkgs.f2fs-tools ];
|
2014-03-25 16:39:10 -04:00
|
|
|
};
|
|
|
|
}
|