2014-04-14 16:26:48 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
2012-03-09 16:17:37 +00:00
|
|
|
|
2014-04-14 16:26:48 +02:00
|
|
|
with lib;
|
2012-03-09 16:17:37 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
|
2024-02-18 23:35:17 +01:00
|
|
|
inInitrd = config.boot.initrd.supportedFilesystems.vfat or false;
|
2012-03-09 16:17:37 +00:00
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
2024-02-18 23:35:17 +01:00
|
|
|
config = mkIf (config.boot.supportedFilesystems.vfat or false) {
|
2012-03-09 16:17:37 +00:00
|
|
|
|
2023-03-03 16:16:31 +03: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 20:46:32 +01:00
|
|
|
boot.initrd.extraUtilsCommands = mkIf (inInitrd && !config.boot.initrd.systemd.enable)
|
2012-03-09 16:17:37 +00:00
|
|
|
''
|
2015-03-28 17:15:41 -07:00
|
|
|
copy_bin_and_libs ${pkgs.dosfstools}/sbin/dosfsck
|
2015-03-28 19:06:43 -07:00
|
|
|
ln -sv dosfsck $out/bin/fsck.vfat
|
2012-03-09 16:17:37 +00:00
|
|
|
'';
|
|
|
|
|
2023-10-26 17:59:35 +02:00
|
|
|
boot.initrd.systemd.initrdBin = mkIf inInitrd [ pkgs.dosfstools ];
|
2023-10-19 21:09:12 -04:00
|
|
|
|
2012-03-09 16:17:37 +00:00
|
|
|
};
|
|
|
|
}
|