at 17.09-beta 517 B view raw
1{ config, lib, pkgs, ... }: 2 3with lib; 4 5let 6 7 inInitrd = any (fs: fs == "vfat") config.boot.initrd.supportedFilesystems; 8 9in 10 11{ 12 config = mkIf (any (fs: fs == "vfat") config.boot.supportedFilesystems) { 13 14 system.fsPackages = [ pkgs.dosfstools ]; 15 16 boot.initrd.kernelModules = mkIf inInitrd [ "vfat" "nls_cp437" "nls_iso8859-1" ]; 17 18 boot.initrd.extraUtilsCommands = mkIf inInitrd 19 '' 20 copy_bin_and_libs ${pkgs.dosfstools}/sbin/dosfsck 21 ln -sv dosfsck $out/bin/fsck.vfat 22 ''; 23 24 }; 25}