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
|
|
|
|
|
2024-02-18 22:35:17 +00:00
|
|
|
inInitrd = config.boot.initrd.supportedFilesystems.vfat or false;
|
2012-03-09 16:17:37 +00:00
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
2024-02-18 22:35:17 +00:00
|
|
|
config = mkIf (config.boot.supportedFilesystems.vfat or false) {
|
2012-03-09 16:17:37 +00:00
|
|
|
|
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-26 15:59:35 +00:00
|
|
|
boot.initrd.systemd.initrdBin = mkIf inInitrd [ pkgs.dosfstools ];
|
2023-10-20 01:09:12 +00:00
|
|
|
|
2012-03-09 16:17:37 +00:00
|
|
|
};
|
|
|
|
}
|