2014-04-14 14:26:48 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
2012-03-09 16:17:37 +00:00
|
|
|
|
2014-04-14 14:26:48 +00:00
|
|
|
with lib;
|
2012-03-09 16:17:37 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
inInitrd = any (fs: fs == "vfat") config.boot.initrd.supportedFilesystems;
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
config = mkIf (any (fs: fs == "vfat") config.boot.supportedFilesystems) {
|
|
|
|
|
2023-03-03 13:16:31 +00:00
|
|
|
system.fsPackages = [ pkgs.dosfstools pkgs.mtools ];
|
2012-03-09 16:17:37 +00:00
|
|
|
|
|
|
|
boot.initrd.kernelModules = mkIf inInitrd [ "vfat" "nls_cp437" "nls_iso8859-1" ];
|
|
|
|
|
2022-04-16 19:46:32 +00:00
|
|
|
boot.initrd.extraUtilsCommands = mkIf (inInitrd && !config.boot.initrd.systemd.enable)
|
2012-03-09 16:17:37 +00:00
|
|
|
''
|
2015-03-29 00:15:41 +00:00
|
|
|
copy_bin_and_libs ${pkgs.dosfstools}/sbin/dosfsck
|
2015-03-29 02:06:43 +00:00
|
|
|
ln -sv dosfsck $out/bin/fsck.vfat
|
2012-03-09 16:17:37 +00:00
|
|
|
'';
|
|
|
|
|
2023-10-20 01:09:12 +00:00
|
|
|
boot.initrd.systemd.extraBin = mkIf inInitrd [ pkgs.dosfstools ];
|
|
|
|
|
2012-03-09 16:17:37 +00:00
|
|
|
};
|
|
|
|
}
|